*
lsh
2025-04-21 787ac0c93db67a3ead8e8dd306ad631ac8dd8a56
src/main/resources/mapper/RoleMapper.xml
@@ -4,12 +4,36 @@
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.system.entity.Role">
        <id column="id" property="id" />
        <result column="code" property="code" />
        <result column="name" property="name" />
        <result column="leader" property="leader" />
        <result column="level" property="level" />
        <id column="ID" property="id" />
        <result column="CODE" property="code" />
        <result column="NAME" property="name" />
        <result column="LEADER" property="leader" />
        <result column="LEVEL" property="level" />
    </resultMap>
    <select id="selectRoleList" resultMap="BaseResultMap">
        SELECT * FROM "SOURCE"."sys_role"
        WHERE 1=1
        <if test="leaderIdList != null">
            and ID not in
            <foreach collection="leaderIdList" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        ORDER BY ID DESC
        LIMIT #{pageSize} OFFSET ((#{pageNumber} - 1) * #{pageSize});
    </select>
    <select id="selectRoleListTotal" resultType="Long">
        SELECT count(1) FROM "SOURCE"."sys_role"
        WHERE 1=1
        <if test="leaderIdList != null">
            and ID not in
            <foreach collection="leaderIdList" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
    </select>
</mapper>