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
<?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.salary.mapper.THaveSalaryNosocialMapper">
<resultMap id="tHaveSalaryNosocialMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial">
<id property="id" column="ID"/>
<result property="employeeId" column="employee_id"/>
<result property="employeeName" column="employee_name"/>
<result property="employeeIdCard" column="employee_id_card"/>
<result property="customerId" column="Customer_id"/>
<result property="settleDomainId" column="settle_domain_id"/>
<result property="customerName" column="CUSTOMER_NAME"/>
<result property="settlementOrganName" column="SETTLEMENT_ORGAN_NAME"/>
<result property="settlementOrganNo" column="SETTLEMENT_ORGAN_NO"/>
<result property="feedBack" column="FEED_BACK"/>
<result property="reasonType" column="REASON_TYPE"/>
<result property="month" column="month"/>
</resultMap>
<resultMap id="haveSalaryNoSocialExportMap" type="com.yifu.cloud.plus.v1.yifu.salary.vo.THaveSalaryNoSocialExportVo">
<result property="customerName" column="CUSTOMER_NAME"/>
<result property="settlementOrganName" column="SETTLEMENT_ORGAN_NAME"/>
<result property="employeeName" column="employee_name"/>
<result property="employeeIdCard" column="employee_id_card"/>
<result property="month" column="month"/>
<result property="relaySalary" column="RELAY_SALARY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="feedBack" column="FEED_BACK"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.employee_id,
a.employee_name,
a.employee_id_card,
a.Customer_id,
a.settle_domain_id,
a.CUSTOMER_NAME,
a.SETTLEMENT_ORGAN_NAME,
a.SETTLEMENT_ORGAN_NO,
a.month,
a.CREATE_MONTH,
a.relay_salary,
a.FEED_BACK,
a.CREATE_NAME,
a.REASON_TYPE
</sql>
<sql id="tHaveSalaryNosocial_where">
<if test="tHaveSalaryNosocial != null">
<if test="tHaveSalaryNosocial.id != null and tHaveSalaryNosocial.id.trim() != ''">
AND a.ID = #{tHaveSalaryNosocial.id}
</if>
<if test="tHaveSalaryNosocial.employeeId != null and tHaveSalaryNosocial.employeeId.trim() != ''">
AND a.employee_id = #{tHaveSalaryNosocial.employeeId}
</if>
<if test="tHaveSalaryNosocial.employeeName != null and tHaveSalaryNosocial.employeeName.trim() != ''">
AND a.employee_name = #{tHaveSalaryNosocial.employeeName}
</if>
<if test="tHaveSalaryNosocial.employeeIdCard != null and tHaveSalaryNosocial.employeeIdCard.trim() != ''">
AND a.employee_id_card = #{tHaveSalaryNosocial.employeeIdCard}
</if>
<if test="tHaveSalaryNosocial.customerId != null and tHaveSalaryNosocial.customerId.trim() != ''">
AND a.Customer_id = #{tHaveSalaryNosocial.customerId}
</if>
<if test="tHaveSalaryNosocial.settleDomainId != null and tHaveSalaryNosocial.settleDomainId.trim() != ''">
AND a.settle_domain_id = #{tHaveSalaryNosocial.settleDomainId}
</if>
<if test="tHaveSalaryNosocial.customerName != null and tHaveSalaryNosocial.customerName.trim() != ''">
AND a.CUSTOMER_NAME LIKE CONCAT('%', #{tHaveSalaryNosocial.customerName},'%')
</if>
<if test="tHaveSalaryNosocial.settlementOrganName != null and tHaveSalaryNosocial.settlementOrganName.trim() != ''">
AND a.SETTLEMENT_ORGAN_NAME LIKE CONCAT('%', #{tHaveSalaryNosocial.settlementOrganName},'%')
</if>
<if test="tHaveSalaryNosocial.settlementOrganNo != null and tHaveSalaryNosocial.settlementOrganNo.trim() != ''">
AND a.SETTLEMENT_ORGAN_NO LIKE CONCAT('%', #{tHaveSalaryNosocial.settlementOrganNo},'%')
</if>
<if test="tHaveSalaryNosocial.month != null">
AND a.month like concat('%', #{tHaveSalaryNosocial.month}, '%')
</if>
<if test="tHaveSalaryNosocial.createMonth != null">
AND a.CREATE_MONTH = #{tHaveSalaryNosocial.createMonth}
</if>
<if test="tHaveSalaryNosocial.createName != null">
AND a.CREATE_NAME = #{tHaveSalaryNosocial.createName}
</if>
</if>
</sql>
<!--tHaveSalaryNosocial简单分页查询-->
<select id="getTHaveSalaryNosocialPage" resultMap="tHaveSalaryNosocialMap">
SELECT
a.id,
a.employee_name,
a.employee_id_card,
a.CUSTOMER_NAME,
a.SETTLEMENT_ORGAN_NAME,
a.month,
a.relay_salary,
a.CREATE_NAME,
a.CREATE_BY,
a.feed_back,a.reason_type
FROM t_have_salary_nosocial a
<include refid="querPage"/>
</select>
<select id="getByIdExport" resultType="com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial">
SELECT
<include refid="Base_Column_List"/>
,b.*
FROM t_have_salary_nosocial a left join t_feed_back b on a.ID=b.RELATE_ID
where 1=1 and ((b.IGNORE_FLAG=1 and b.TYPE=1) or (b.id is null))
<if test="array.length > 0">
and a.id in
<foreach collection="array" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if test="array.length == 0">
and 1=2
</if>
</select>
<select id="getExport" resultType="com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial">
SELECT
<include refid="Base_Column_List"/>
,b.*
FROM t_have_salary_nosocial a
<include refid="querPage"/>
</select>
<select id="getByIdHandleExport" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.THaveSalaryNosocialHandleExportVo">
SELECT
<include refid="Base_Column_List"/>
,b.*
FROM t_have_salary_nosocial a left join t_feed_back b on a.ID=b.RELATE_ID
where 1=1 and ((b.IGNORE_FLAG=1 and b.TYPE=1) or (b.id is null))
<if test="array.length > 0">
and a.id in
<foreach collection="array" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if test="array.length == 0">
and a.id in ('')
</if>
</select>
<select id="getHandleExport" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.THaveSalaryNosocialHandleExportVo">
SELECT
<include refid="Base_Column_List"/>
,b.*
FROM t_have_salary_nosocial a
left join t_feed_back b on a.ID=b.RELATE_ID
<where>
1=1 and ((b.IGNORE_FLAG=1 and b.TYPE=1) or (b.id is null))
<if test="tHaveSalaryNosocial.reasonType != null and tHaveSalaryNosocial.reasonType.trim() != ''">
AND b.REASON_TYPE = #{tHaveSalaryNosocial.reasonType}
</if>
<include refid="tHaveSalaryNosocial_where"/>
<if test="tHaveSalaryNosocial.authSql != null and tHaveSalaryNosocial.authSql.trim() != ''">
${tHaveSalaryNosocial.authSql}
</if>
</where>
</select>
<sql id="querPage">
left join t_feed_back b on a.ID=b.RELATE_ID
<where>
1=1 and ((b.IGNORE_FLAG=1 and b.TYPE=1) or (b.id is null))
<include refid="tHaveSalaryNosocial_where"/>
<if test="tHaveSalaryNosocial.authSql != null and tHaveSalaryNosocial.authSql.trim() != ''">
${tHaveSalaryNosocial.authSql}
</if>
<!--数据权限判断-->
<if test="settleDomainVos != null">
<if test="settleDomainVos.size() > 0">
and a.SETTLE_DOMAIN_ID in
<foreach collection="settleDomainVos" item="param" index="index" open="(" close=")" separator=",">
#{param.id}
</foreach>
</if>
<if test="settleDomainVos.size() == 0">
and 1=2
</if>
</if>
<if test="settleDomainVos == null">
and 1=1
</if>
</where>
</sql>
<select id="getTHaveSalaryNosocialHandelPage" resultMap="tHaveSalaryNosocialMap">
SELECT
<include refid="Base_Column_List"/>
,b.*
FROM t_have_salary_nosocial a
left join t_feed_back b on a.ID=b.RELATE_ID
<where>
1=1 and ((b.IGNORE_FLAG=1 and b.TYPE=1) or (b.id is null))
<if test="tHaveSalaryNosocial.reasonType != null ">
AND b.REASON_TYPE = #{tHaveSalaryNosocial.reasonType}
</if>
<include refid="tHaveSalaryNosocial_where"/>
</where>
</select>
<select id="getLastTHaveSalaryNosocial" resultType="com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial">
SELECT
<include refid="Base_Column_List"/>
,b.*
FROM t_have_salary_nosocial a
left join t_feed_back b on a.ID=b.RELATE_ID
where a.CREATE_MONTH in(#{lastOneMonth},#{lastTwoMonth},#{lastThreeMonth}) and b.REASON_TYPE is not null
</select>
<select id="noPageDiy" resultMap="haveSalaryNoSocialExportMap">
SELECT
<include refid="Base_Column_List"/>
,b.*
FROM t_have_salary_nosocial a
left join t_feed_back b on a.ID=b.RELATE_ID
<where>
1=1 and ((b.IGNORE_FLAG=1 and b.TYPE=1) or (b.id is null))
<include refid="export_where"/>
<if test="tHaveSalaryNosocial != null">
<if test="tHaveSalaryNosocial.authSql != null and tHaveSalaryNosocial.authSql.trim() != ''">
${tHaveSalaryNosocial.authSql}
</if>
<if test="tHaveSalaryNosocial.limitStart != null">
limit #{tHaveSalaryNosocial.limitStart},#{tHaveSalaryNosocial.limitEnd}
</if>
</if>
</where>
</select>
<select id="noPageCountDiy" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_have_salary_nosocial a
left join t_feed_back b on a.ID=b.RELATE_ID
<where>
1=1 and ((b.IGNORE_FLAG=1 and b.TYPE=1) or (b.id is null))
<include refid="export_where"/>
<if test="tHaveSalaryNosocial.authSql != null and tHaveSalaryNosocial.authSql.trim() != ''">
${tHaveSalaryNosocial.authSql}
</if>
</where>
</select>
<sql id="export_where">
<include refid="tHaveSalaryNosocial_where"/>
<if test="idsStr != null and idsStr.size > 0">
AND a.ID in
<foreach item="items" index="index" collection="idsStr" open="(" separator="," close=")">
#{items}
</foreach>
</if>
<!--数据权限判断-->
<if test="settleDomainIds != null">
<if test="settleDomainIds.size() > 0">
and a.SETTLE_DOMAIN_ID in
<foreach collection="settleDomainIds" item="param" index="index" open="(" close=")" separator=",">
#{param}
</foreach>
</if>
<if test="settleDomainIds.size() == 0">
and 1=2
</if>
</if>
<if test="settleDomainIds == null">
and 1=1
</if>
<if test='sql != null and sql != ""'>
and <![CDATA[sql]]>
</if>
</sql>
</mapper>