| | |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <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> |