CenterUserMapper.xml
2.48 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
40
41
42
43
44
45
46
47
48
49
50
51
<?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.admin.user.dao.CenterUserMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="org.nafmii.admin.user.entity.CenterUserPO">
<id column="ID" property="id" />
<result column="LOGIN_NAME" property="loginName" />
<result column="LOGIN_PWD" property="loginPwd" />
<result column="CN_NAME" property="cnName" />
<result column="EN_NAME" property="enName" />
<result column="PHONE" property="phone" />
<result column="TELPHONE" property="telphone" />
<result column="SEX" property="sex" />
<result column="EMAIL" property="email" />
<result column="CREATE_USER_ID" property="createUserId" />
<result column="UPDATE_USER_ID" property="updateUserId" />
<result column="CREATE_TIME" property="createTime" />
<result column="UPDATE_TIME" property="updateTime" />
<result column="IS_ENABLE" property="isEnable" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
ID, LOGIN_NAME, LOGIN_PWD, CN_NAME, EN_NAME, PHONE, TELPHONE, SEX, EMAIL, CREATE_USER_ID, UPDATE_USER_ID, CREATE_TIME, UPDATE_TIME, IS_ENABLE
</sql>
<!-- 根据登录人账号(手机号)查询用户信息 -->
<select id="selectUserByPhone" parameterType="map" resultType="org.nafmii.admin.user.vo.CenterUserVO">
select
ID as id, LOGIN_NAME as loginName, LOGIN_PWD as loginPwd, CN_NAME as cnName, EN_NAME as enName, PHONE as phone,
TELPHONE as telphone, SEX as sex, EMAIL as email, CREATE_USER_ID as createUserId, UPDATE_USER_ID as updateUserId,
CREATE_TIME as createTime, UPDATE_TIME as updateTime, IS_ENABLE as isEnable
from CENTER_USER
where IS_ENABLE = 0
<if test="phone !=null">
and PHONE =#{phone}
</if>
</select>
<select id="queryUserList" parameterType="org.nafmii.admin.user.dto.QueryUsersDto"
resultType="org.nafmii.admin.user.vo.CenterUserVO">
SELECT
<include refid="Base_Column_List" />
FROM CENTER_USER CU
<where>
<if test="StartCreateTime != null and endCreateTime != null">
DATE_FORMAT(CU.CREATE_TIME,'%Y-%m-%d') BETWEEN #{StartCreateTime} and #{endCreateTime}
</if>
</where>
</select>
</mapper>