MemberMapper.xml
3.34 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?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.subsidy.mapper.MemberMapper">
<select id="getMembers" resultType="com.subsidy.vo.member.GetAllVO">
SELECT
t2.id,
t2.user_name,
t2.account_name,
t2.account_name_en,
t2.telephone,
t2.gender,
t2.id_card,
t2.status,
t2.email,
t2.work_no,
t2.induction_date
FROM
member_department_mapping t
LEFT JOIN member t2 ON t.member_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
and t.member_status = 1
and t.department_id = #{departmentId}
<if test="userName != null and userName !=''">
and t2.user_name like concat('%',#{userName} ,'%')
</if>
<if test="status != null and status !=''">
and t2.status = #{status}
</if>
<if test="startDate != null and startEndDate !=''">
and DATE_FORMAT(t2.induction_date ,'%Y-%m-%d')>=DATE_FORMAT(#{startDate}, '%Y-%m-%d')
</if>
<if test="endDate != null and endDate !=''">
and DATE_FORMAT(t2.induction_date ,'%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
</if>
</select>
<select id="manageMember" parameterType="string" resultType="com.subsidy.vo.member.ManageMemberVO">
SELECT
t.id,
t.user_name,
t.telephone,
t.id_card,
t.account_name,
t2.company_name,
t.check_image,
t.check_time,
t.first_login
FROM
member t
left join company_member_mapping t5 on t5.member_id = t.id and t5.member_status = 1
LEFT JOIN company_dict t2 ON t5.company_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
<if test="userName != null and userName != ''">
AND t.user_name LIKE concat('%',#{userName} ,'%')
</if>
<if test="companyId != null and companyId != ''">
and t5.company_id = #{companyId}
</if>
</select>
<select id="getMemberWithoutPage" resultType="com.subsidy.model.MemberDO">
SELECT
t2.id,
t2.user_name,
t2.account_name,
t2.account_name_en,
t2.telephone,
t2.gender,
t2.id_card,
t2.status,
t2.email,
t2.work_no,
t2.induction_date
FROM
member_department_mapping t
LEFT JOIN member t2 ON t.member_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t2.id IS NOT NULL
and t.department_id = #{departmentId}
and t.member_status = 1
<if test="userName != null and userName !=''">
and t2.user_name like concat('%',#{userName} ,'%')
</if>
<if test="status != null and status !=''">
and t2.status = #{status}
</if>
<if test="startDate != null and startEndDate !=''">
and DATE_FORMAT(t2.induction_date ,'%Y-%m-%d')>=DATE_FORMAT(#{startDate}, '%Y-%m-%d')
</if>
<if test="endDate != null and endDate !=''">
and DATE_FORMAT(t2.induction_date ,'%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
</if>
</select>
</mapper>