LaborServiceDictMapper.xml
3.23 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
<?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.LaborServiceDictMapper">
<select id="labors" resultType="com.subsidy.vo.labor.LaborsVO">
SELECT
t.id,
t.labor_service_name,
t.short_name,
t.location,
t.service_code,
t2.account_name,
t2.`password`
FROM
labor_service_dict t
LEFT JOIN administer t2 ON t.id = t2.labor_id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
<if test="laborServiceName != null and laborServiceName != ''">
AND t.labor_service_name like concat('%',#{laborServiceName} ,'%')
</if>
</select>
<select id="laborAccount" resultType="com.subsidy.vo.labor.LaborAccountVO">
SELECT distinct
t2.id,
t2.user_name,
t2.`password`,
t2.telephone,
t2.remark,
t2.role,
t2.account_name
FROM
administer t2
LEFT JOIN administer_labor_mapping t1 ON t2.id = t1.administer_id
LEFT JOIN labor_service_dict t3 ON t1.labor_id = t3.id
WHERE
t2.delete_date IS NULL
AND t1.delete_date IS NULL
AND t3.delete_date IS NULL
AND t2.role = 7
<if test="accountName != null and accountName != ''">
and (t3.labor_service_name like concat('%',#{accountName} ,'%') or t2.account_name like concat('%',#{accountName},'%') )
</if>
</select>
<select id="relateLabors" parameterType="long" resultType="com.subsidy.model.LaborServiceDictDO">
SELECT
t2.id,
t2.labor_service_name
FROM
administer_labor_mapping t
LEFT JOIN labor_service_dict t2 ON t.labor_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.administer_id = #{administerId}
</select>
<select id="accountLabors" parameterType="long" resultType="long">
SELECT
t.labor_id
FROM
administer_labor_mapping t
WHERE
t.delete_date IS NULL
AND t.administer_id = #{administerId}
</select>
<select id="talentManagement" parameterType="long" resultType="com.subsidy.vo.labor.TalentManagementVO">
SELECT
t3.id,
t3.gender,
t3.user_name,
t3.telephone,
t3.id_card,
t3.email,
t3.payroll_account,
t3.bank,
IF
( t3.open_id IS NULL, '未绑定', '已绑定' ) wechatStatus
FROM
labor_group_dict t
LEFT JOIN group_member_mapping t2 ON t.id = t2.group_id
LEFT JOIN member t3 ON t2.member_id = t3.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t3.delete_date IS NULL
<if test="laborId != null and laborId != ''">
AND t.labor_id = #{laborId}
</if>
<if test="userName != null and userName != ''" >
and t3.user_name like concat('%',#{userName} ,'%')
</if>
and t2.id is not null
</select>
</mapper>