AccessTokenMapper.xml
2.79 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?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.meishu.mapper.AccessTokenMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.meishu.model.AccessTokenDO">
<id column="id" property="id" />
<result column="create_date" property="createTime" />
<result column="update_date" property="updateTime" />
<result column="delete_date" property="deleteTime" />
<result column="access_token" property="accessToken" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_date,
update_date,
delete_date,
id, access_token
</sql>
<select id="getAllTeachers" parameterType="com.meishu.dto.token.GetAllTeachersDTO" resultType="com.meishu.vo.accesstoken.GetAllTeachersVO">
SELECT
id,
telephone,
user_name,
intro
FROM
administer t
where t.delete_date is null
<if test="telephone != null and telephone != ''">
and t.telephone = #{telephone}
</if>
<if test="userName != null and userName != ''">
and t.user_name like concat('%', #{userName} ,'%')
</if>
</select>
<select id="getAllStudents" parameterType="com.meishu.dto.token.GetAllStudentsDTO" resultType="com.meishu.vo.accesstoken.GetAllStudentsVO">
SELECT
t.id,
t.user_name,
t.gender,
t.img_url,
t.user_status,
t.role_type,
t.SESSION,
t.phone,
t.id_card,
t.study_code,
t3.class_name,
t.password
FROM
user_role t
LEFT JOIN classes_user_mapping t2 ON t.id = t2.user_id
LEFT JOIN classes_dict t3 ON t2.classes_id = t3.id
WHERE
t.delete_date IS NULL
-- AND t2.`status` = 1
AND t2.delete_date IS NULL
AND t3.delete_date IS NULL
<if test="userName != null and userName !=''">
and t.user_name like concat('%',#{userName} ,'%')
</if>
<if test="idCard != null and idCard != ''">
and t.id_card like concat('%',#{idCard} ,'%')
</if>
<if test="phone != null and phone !=''">
and t.phone like concat('%',#{phone} ,'%')
</if>
<if test="gender != null and gender != ''">
and t.gender = #{gender}
</if>
<if test="studyCode != null and studyCode !='' ">
and t.study_code like concat('%',#{studyCode} ,'%')
</if>
<!-- <if test="className != null and className !=''">-->
<!-- and t.class_name like concat('%',#{className} ,'%')-->
<!-- </if>-->
</select>
</mapper>