CenterRoleMapper.xml
1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?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="org.nafmii.webcenter.user.dao.CenterRoleMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="org.nafmii.webcenter.user.entity.CenterRolePO">
<id column="ID" property="id" />
<result column="R_NAME" property="rName" />
<result column="CREAT_TIME" property="creatTime" />
<result column="UPDATE_TIME" property="updateTime" />
<result column="IS_ENABLE" property="isEnable" />
<result column="CREATE_USER_ID" property="createUserId" />
<result column="UPDATE_USER_ID" property="updateUserId" />
<result column="DEL_FLAG" property="delFlag" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
ID, R_NAME, CREAT_TIME, UPDATE_TIME, IS_ENABLE, CREATE_USER_ID, UPDATE_USER_ID ,DEL_FLAG
</sql>
<select id="selectAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from CENTER_ROLE
where IS_ENABLE = 0 and DEL_FLAG = 0
</select>
<select id="selectByName" parameterType="org.nafmii.webcenter.user.dto.QueryRoleListDto" resultType="org.nafmii.webcenter.user.vo.RoleListVo">
select
ID as roleID,
R_NAME as roleName,
CREATE_USER_ID as createUserId,
IS_ENABLE as isEnable
from CENTER_ROLE
where DEL_FLAG = 0
<if test="roleName != null">
and R_NAME like CONCAT('%',#{roleName},'%')
</if>
</select>
</mapper>