<?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.yunzhi.marketing.mapper.SysAdvancedConfigMapper">

    <select id="getSysAdvancedConfigList" resultType="com.yunzhi.marketing.entity.SysAdvancedConfig">
        SELECT
            t.*,
            IF(s.checked_id IS NULL, 0, 1) AS has_rights
        FROM
            sys_advanced_config t
        LEFT JOIN ( SELECT org_id,advanced_config_id as checked_id FROM ta_advanced_controller WHERE org_id = #{orgId} ) s ON t.advanced_config_id = s.checked_id
        ORDER BY t.create_date
    </select>
</mapper>
