<?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.xjrsoft.module.system.mapper.XjrMenuGroupMapper">
    <select id="getMenuList" parameterType="com.xjrsoft.module.system.dto.XjrMenuGroupMenuListDto" resultType="com.xjrsoft.module.system.vo.XjrMenuGroupMenuListVo">
        SELECT id, name,(
            SELECT COUNT(*) FROM xjr_menu_group WHERE delete_mark = 0 AND xjr_menu_group_set_id = #{dto.xjrMenuGroupSetId}
            AND xjr_menu_id = xjr_menu.id
        ) AS is_selected,
            (SELECT COUNT(*) FROM xjr_menu_group WHERE delete_mark = 0 AND xjr_menu_group_set_id != #{dto.xjrMenuGroupSetId}
                                                                AND xjr_menu_id = xjr_menu.id) as is_used FROM xjr_menu WHERE system_id = 1726806691140907010
        AND delete_mark = 0 AND enabled_mark = 1
        and system_type = 'system_app'
    </select>
</mapper>