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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
<?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.yifu.cloud.plus.v1.yifu.archives.mapper.EmployeeRegistrationPreMapper">
<resultMap id="employeeRegistrationPreMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre">
<id property="id" column="id"/>
<result property="employeeName" column="employee_name"/>
<result property="empIdcard" column="emp_idcard"/>
<result property="empPhone" column="emp_phone"/>
<result property="position" column="position"/>
<result property="joinLeaveDate" column="join_leave_date"/>
<result property="processStatus" column="process_status"/>
<result property="customerUsername" column="customer_username"/>
<result property="customerUserLoginname" column="customer_user_loginname"/>
<result property="deptName" column="dept_name"/>
<result property="deptNo" column="dept_no"/>
<result property="deptId" column="dept_id"/>
<result property="empNature" column="emp_nature"/>
<result property="contractType" column="contract_type"/>
<result property="contractSubName" column="contract_sub_name"/>
<result property="dataSource" column="data_source"/>
<result property="expectedCollectionTime" column="expected_collection_time"/>
<result property="serverItem" column="server_item"/>
<result property="fileProvince" column="file_province"/>
<result property="fileCity" column="file_city"/>
<result property="fileTown" column="file_town"/>
<result property="provinceCode" column="province_code"/>
<result property="cityCode" column="city_code"/>
<result property="townCode" column="town_code"/>
<result property="confirmUser" column="confirm_user"/>
<result property="confirmTime" column="confirm_time"/>
<result property="createBy" column="create_by"/>
<result property="createName" column="create_name"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="customerUsernameNew" column="customer_username_new"/>
</resultMap>
<resultMap id="employeeRegistrationPreExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreExportVo">
<result property="employeeName" column="employee_name"/>
<result property="empIdcard" column="emp_idcard"/>
<result property="empPhone" column="emp_phone"/>
<result property="joinLeaveDate" column="join_leave_date"/>
<result property="customerUsernameNew" column="customer_username_new"/>
<result property="deptName" column="dept_name"/>
<result property="deptNo" column="dept_no"/>
<result property="empNature" column="emp_nature"/>
<result property="contractType" column="contract_type"/>
<result property="dataSource" column="data_source"/>
<result property="expectedCollectionTime" column="expected_collection_time"/>
<result property="processStatus" column="process_status"/>
</resultMap>
<resultMap id="employeeRegistrationPreInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreInfoExportVo">
<result property="employeeName" column="employee_name"/>
<result property="empIdcard" column="emp_idcard"/>
<result property="empPhone" column="emp_phone"/>
<result property="position" column="position"/>
<result property="joinLeaveDate" column="join_leave_date"/>
<result property="deptName" column="dept_name"/>
<result property="deptNo" column="dept_no"/>
<result property="empNature" column="emp_nature"/>
<result property="contractType" column="contract_type"/>
<result property="serverItem" column="server_item"/>
<result property="confirmUser" column="confirm_user"/>
<result property="confirmTime" column="confirm_time"/>
<result property="fileAdress" column="fileAdress"/>
</resultMap>
<resultMap id="messageTempleteVoMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.MessageTempleteVo">
<result property="signName" column="sign_name"/>
<result property="templeteCode" column="model_code"/>
</resultMap>
<resultMap id="getEmployeeInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeInfoMsgVo">
<result property="deptId" column="deptId"/>
<result property="name" column="name"/>
<result property="card" column="card"/>
<result property="phone" column="phone"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.employee_name,
a.emp_idcard,
a.emp_phone,
a.position,
a.join_leave_date,
a.process_status,
a.customer_username,
a.customer_user_loginname,
a.dept_name,
a.dept_no,
a.dept_id,
a.emp_nature,
a.contract_type,
a.data_source,
a.expected_collection_time,
a.server_item,
a.file_province,
a.file_city,
a.file_town,
a.confirm_user,
a.confirm_time,
a.create_by,
a.create_name,
a.create_time,
a.update_by,
a.update_time,
a.contract_sub_name,
a.customer_username_new,
province_code,city_code,town_code
</sql>
<sql id="employeeRegistrationPre_where">
<if test="employeeRegistrationPre != null">
<if test="employeeRegistrationPre.id != null and employeeRegistrationPre.id.trim() != ''">
AND a.id = #{employeeRegistrationPre.id}
</if>
<if test="employeeRegistrationPre.employeeName != null and employeeRegistrationPre.employeeName.trim() != ''">
AND a.employee_name like CONCAT('%',#{employeeRegistrationPre.employeeName},'%')
</if>
<if test="employeeRegistrationPre.empIdcard != null and employeeRegistrationPre.empIdcard.trim() != ''">
AND a.emp_idcard like CONCAT('%',#{employeeRegistrationPre.empIdcard},'%')
</if>
<if test="employeeRegistrationPre.empPhone != null and employeeRegistrationPre.empPhone.trim() != ''">
AND a.emp_phone = #{employeeRegistrationPre.empPhone}
</if>
<if test="employeeRegistrationPre.position != null and employeeRegistrationPre.position.trim() != ''">
AND a.position = #{employeeRegistrationPre.position}
</if>
<if test="employeeRegistrationPre.joinLeaveDate != null">
AND a.join_leave_date = #{employeeRegistrationPre.joinLeaveDate}
</if>
<if test="employeeRegistrationPre.statusList != null and employeeRegistrationPre.statusList.size() > 0">
AND a.process_status in
<foreach item="item" index="index" collection="employeeRegistrationPre.statusList" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
<if test="employeeRegistrationPre.customerUsernameNew != null and employeeRegistrationPre.customerUsernameNew.trim() != ''">
AND a.customer_username_new = #{employeeRegistrationPre.customerUsernameNew}
</if>
<if test="employeeRegistrationPre.customerUserLoginname != null and employeeRegistrationPre.customerUserLoginname.trim() != ''">
AND a.customer_user_loginname = #{employeeRegistrationPre.customerUserLoginname}
</if>
<if test="employeeRegistrationPre.deptName != null and employeeRegistrationPre.deptName.trim() != ''">
AND a.dept_name like CONCAT('%',#{employeeRegistrationPre.deptName},'%')
</if>
<if test="employeeRegistrationPre.deptNo != null and employeeRegistrationPre.deptNo.trim() != ''">
AND a.dept_no = #{employeeRegistrationPre.deptNo}
</if>
<if test="employeeRegistrationPre.deptId != null and employeeRegistrationPre.deptId.trim() != ''">
AND a.dept_id = #{employeeRegistrationPre.deptId}
</if>
<if test="employeeRegistrationPre.empNature != null and employeeRegistrationPre.empNature.trim() != ''">
AND a.emp_nature = #{employeeRegistrationPre.empNature}
</if>
<if test="employeeRegistrationPre.contractType != null and employeeRegistrationPre.contractType.trim() != ''">
AND a.contract_type = #{employeeRegistrationPre.contractType}
</if>
<if test="employeeRegistrationPre.dataSource != null and employeeRegistrationPre.dataSource.trim() != ''">
AND a.data_source = #{employeeRegistrationPre.dataSource}
</if>
<if test="employeeRegistrationPre.expectedCollectionTime != null">
AND a.expected_collection_time = #{employeeRegistrationPre.expectedCollectionTime}
</if>
<if test="employeeRegistrationPre.serverItem != null and employeeRegistrationPre.serverItem.trim() != ''">
AND a.server_item = #{employeeRegistrationPre.serverItem}
</if>
<if test="employeeRegistrationPre.fileProvince != null">
AND a.file_province = #{employeeRegistrationPre.fileProvince}
</if>
<if test="employeeRegistrationPre.fileCity != null">
AND a.file_city = #{employeeRegistrationPre.fileCity}
</if>
<if test="employeeRegistrationPre.fileTown != null">
AND a.file_town = #{employeeRegistrationPre.fileTown}
</if>
<if test="employeeRegistrationPre.confirmUser != null and employeeRegistrationPre.confirmUser.trim() != ''">
AND a.confirm_user = #{employeeRegistrationPre.confirmUser}
</if>
<if test="employeeRegistrationPre.authSql != null and employeeRegistrationPre.authSql.trim() != ''">
${employeeRegistrationPre.authSql}
</if>
<if test="employeeRegistrationPre.deptNoList != null and employeeRegistrationPre.deptNoList.size > 0">
AND a.dept_no in
<foreach item="idStr" index="index" collection="employeeRegistrationPre.deptNoList" open="(" separator=","
close=")">
#{idStr}
</foreach>
</if>
</if>
</sql>
<!--employeeRegistrationPre简单分页查询-->
<select id="getEmployeeRegistrationPrePage" resultMap="employeeRegistrationPreMap">
SELECT
<include refid="Base_Column_List"/>
FROM employee_registration_pre a
<where>
1=1
<include refid="employeeRegistrationPre_where"/>
</where>
order by a.create_time desc
</select>
<select id="selectExportCount" resultType="java.lang.Long">
SELECT
count(1)
FROM employee_registration_pre a
<where>
1=1
<include refid="employeeRegistrationPre_where"/>
</where>
</select>
<!--employeeRegistrationPre导出查询-->
<select id="selectExportList" resultMap="employeeRegistrationPreExportMap">
SELECT
a.employee_name,
a.emp_idcard,
a.emp_phone,
a.join_leave_date,
a.customer_username_new,
a.dept_name,
a.dept_no,
a.emp_nature,
a.contract_type,
if(a.data_source = '1','客户端','客服端') data_source,
a.expected_collection_time,
if(a.process_status = '0','短信待发送',if(a.process_status = '1','信息待填写',if(a.process_status = '2','信息待审核','拒绝入职'))) process_status
FROM employee_registration_pre a
<where>
1=1
<include refid="employeeRegistrationPre_where"/>
</where>
order by a.create_time desc
<if test="employeeRegistrationPre.limitStart != null">
limit #{employeeRegistrationPre.limitStart},#{employeeRegistrationPre.limitEnd}
</if>
</select>
<!--employeeRegistrationPre导出查询-->
<select id="selectConfirmExportList" resultMap="employeeRegistrationPreInfoMap">
SELECT
a.dept_name,
a.dept_no,
a.employee_name,
a.emp_idcard,
a.emp_phone,
a.position,
a.join_leave_date,
a.confirm_user,
a.confirm_time,
a.server_item,
a.emp_nature,
a.contract_type,
concat(a.file_province,'/',a.file_city,if(a.file_town is null,'',concat('/',a.file_town))) as fileAdress
FROM employee_registration_pre a
<where>
1=1
<include refid="employeeRegistrationPre_where"/>
</where>
order by a.create_time desc
<if test="employeeRegistrationPre.limitStart != null">
limit #{employeeRegistrationPre.limitStart},#{employeeRegistrationPre.limitEnd}
</if>
</select>
<select id="selectTempleteVo" resultMap="messageTempleteVoMap">
SELECT
a.model_code,
a.sign_name
from t_message_templete a
where id = #{id}
</select>
<!-- 判断简档详档-优先从档案维护任务表 -->
<select id="judegIsSimpleByPre" resultType="java.lang.String">
select
if(a.emp_nature is null or (a.emp_nature != '2' and (a.contract_type is null or a.contract_type in ('1','20','9'))),1,2) 类型1详档2简档
from employee_registration_pre a where a.emp_idcard = #{empIdCard} and a.dept_id = #{deptId}
</select>
<!-- 判断简档详档-从项目档案表 -->
<select id="judegIsSimpleByEmpProject" resultType="java.lang.String">
select
if(a.EMP_NATRUE is null or (a.EMP_NATRUE != '2' and (a.contract_type is null or a.contract_type in ('1','20','9'))),1,2) 类型1详档2简档
from t_employee_project a where a.DELETE_FLAG = '0' and a.PROJECT_STATUS = 0 and a.emp_idcard = #{empIdCard} and a.dept_id = #{deptId}
</select>
<!-- 获取员工类型与档案地市-优先从档案维护任务表 -->
<select id="getPreByPre" resultMap="employeeRegistrationPreMap">
select
<include refid="Base_Column_List"/>
from employee_registration_pre a where a.emp_idcard = #{empIdCard} and a.dept_id = #{deptId}
</select>
<!-- 获取员工类型与档案地市-从项目档案表 -->
<select id="getPreByEmpProject" resultMap="employeeRegistrationPreMap">
select
a.id,
a.emp_natrue emp_nature,
e.file_province,
e.file_city,
e.file_town
from t_employee_project a
left join t_employee_info e on e.id = a.EMP_ID
where a.DELETE_FLAG = '0' and a.PROJECT_STATUS = 0 and a.emp_idcard = #{empIdCard} and a.dept_id = #{deptId}
</select>
<select id="getEmployeeArchivesInfo" resultMap="getEmployeeInfoMap">
SELECT
a.emp_idcard as card,
a.emp_phone as phone,
a.dept_id as deptId,
a.emp_name as name
from t_registe_warning_employee a
where a.id = #{id}
</select>
</mapper>