<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.njzscloud.supervisory.biz.mapper.BizAuditConfigMapper">
    <update id="modify">
        update biz_audit_config
        <set>
            city_role = #{cityRole},
            area_role = #{areaRole}
        </set>
        where id = #{id}
    </update>
    <select id="paging" resultType="com.njzscloud.supervisory.biz.pojo.result.SearchAuditConfigResult">
        SELECT a.*,
        b.role_name city_role_name,
        c.role_name area_role_name
        FROM biz_audit_config a
        LEFT JOIN sys_role b ON b.role_code = a.city_role
        LEFT JOIN sys_role c ON c.role_code = a.area_role
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            ${ew.customSqlSegment}
        </if>
    </select>
    <select id="getAreaName" resultType="java.lang.String">
        SELECT district_name
        FROM sys_district
        WHERE id = #{area}
    </select>
</mapper>
