CompanyMemberMappingMapper.xml
2.52 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
<?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.CompanyMemberMappingMapper">
<select id="companyAuthMembersCount" parameterType="long" resultType="integer">
SELECT
count(
DISTINCT ( t2.id ))
FROM
company_member_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.company_id = #{companyId}
AND t.member_status = 1
AND t2.first_login IS NOT NULL
</select>
<select id="memberCompany" parameterType="long" resultType="com.subsidy.model.CompanyDictDO">
SELECT
t2.*
FROM
company_member_mapping t
LEFT JOIN company_dict t2 ON t.company_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.member_status = 1
AND t.member_id = #{memberId}
</select>
<select id="companyMembers" parameterType="long" resultType="string">
SELECT
concat(t2.user_name,t2.telephone,t2.id_card)
FROM
company_member_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.company_id = #{companyId}
AND t.member_status = 1
</select>
<select id="noCompanyMembers" resultType="com.subsidy.model.MemberDO">
SELECT
*
FROM
member t
WHERE
t.delete_date IS NOT NULL
AND t.id NOT IN (
SELECT DISTINCT
( t2.member_id )
FROM
company_member_mapping t2
WHERE
t2.delete_date IS NOT NULL
AND t2.member_status = 1)
and t.user_name like concat('%',#{userName} ,'%')
and t.id_card like concat('%',#{idCard} ,'%')
</select>
<select id="companyAccountMembers" resultType="com.subsidy.model.MemberDO">
SELECT
t2.*
FROM
company_member_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.company_id = #{companyId}
AND t2.account_name = #{accountName}
AND t.member_status = 1
</select>
</mapper>