MemberMapper.xml
1.87 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
<?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="queryMembers" resultType="com.subsidy.vo.member.QueryMembersVO">
SELECT
t.id AS mappingId,
t2.id,
t2.user_name,
t2.gender,
t2.telephone,
t2.payroll_account,
t2.bank,
t2.id_card,
if( t2.open_id IS NULL, '未绑定', '已绑定' ) AS wechatStatus
FROM
group_member_mapping t
LEFT JOIN member t2 ON t.member_id = t2.id
WHERE
t2.delete_date IS NULL
and t.delete_date is null
AND t.group_id = #{groupId}
<if test="userInfo != null and userInfo != ''">
and (t2.user_name like concat('%', #{userInfo},'%') or t2.telephone like concat('%', #{userInfo},'%') or t2.id_card like concat('%', #{userInfo},'%') )
</if>
</select>
<select id="checkTalentMember" resultType="integer">
SELECT
count( 1 )
FROM
member t
LEFT JOIN member_role t2 ON t.id = t2.member_id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t2.role_type = 3
AND (
t.id_card = #{idCard}
OR t.telephone = #{telephone})
<if test=" id != null">
and t.id != #{id}
</if>
</select>
<select id="checkMember">
SELECT
count( 1 )
FROM
member t
LEFT JOIN member_role t2 ON t.id = t2.member_id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND (
t.id_card = #{idCard}
OR t.telephone = #{telephone})
</select>
</mapper>