<?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.zy.system.mapper.RoleMapper">
|
|
<!-- 通用查询映射结果 -->
|
<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" />
|
|
</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>
|