CreditCommitmentInfoMapper.xml
20 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
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
<?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.credit.cy.business.mapper.CreditCommitmentInfoMapper">
<resultMap type="com.credit.cy.business.domain.CreditCommitmentInfo" id="CreditCommitmentInfoResult">
<result property="id" column="id" />
<result property="counterpartName" column="counterpart_name" />
<result property="counterpartType" column="counterpart_type" />
<result property="creditCode" column="credit_code" />
<result property="commitmentType" column="commitment_type" />
<result property="commitmentCause" column="commitment_cause" />
<result property="content" column="content" />
<result property="documentNum" column="document_num" />
<result property="pubType" column="pub_type" />
<result property="duty" column="duty" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="execStatus" column="exec_status" />
<result property="violateLevel" column="violate_level" />
<result property="violateContent" column="violate_content" />
<result property="violateTraceContent" column="violate_trace_content" />
<result property="decisionTime" column="decision_time" />
<result property="decisionOrg" column="decision_org" />
<result property="decisionOrgCode" column="decision_org_code" />
<result property="execOrg" column="exec_org" />
<result property="execOrgCode" column="exec_org_code" />
<result property="remark" column="remark" />
<result property="fileKey" column="file_key" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="reportDept" column="report_dept"/>
<result property="reportDate" column="report_date"/>
<result property="itemId" column="item_id"/>
<result property="commitmentEntity" column="commitment_entity"/>
<result property="fulfillDate" column="fulfill_date"/>
</resultMap>
<sql id="selectCreditCommitmentInfoVo">
select id, counterpart_name, counterpart_type, credit_code, commitment_type, document_num,commitment_cause, content,
pub_type, duty, start_time, end_time, exec_status, violate_level, violate_content, violate_trace_content,
decision_time, decision_org, decision_org_code, exec_org, exec_org_code, remark, file_key,
create_time, update_time, create_by, update_by,report_dept,report_date,item_id,commitment_entity,fulfill_date from credit_commitment_info
</sql>
<select id="selectCommitmentInfoList" parameterType="com.credit.cy.business.domain.CreditCommitmentInfo" resultMap="CreditCommitmentInfoResult">
<include refid="selectCreditCommitmentInfoVo"/>
<where>
<if test="counterpartName != null and counterpartName != ''"> and counterpart_name like concat('%', #{counterpartName}, '%')</if>
<if test="itemId != null "> and item_id = #{itemId}</if>
<if test="counterpartType != null and counterpartType != ''"> and counterpart_type = #{counterpartType}</if>
<if test="creditCode != null and creditCode != ''"> and credit_code = #{creditCode}</if>
<if test="commitmentType != null and commitmentType != ''"> and commitment_type = #{commitmentType}</if>
<if test="documentNum != null and documentNum != ''"> and document_num = #{documentNum}</if>
<if test="pubType != null and pubType != ''"> and pub_type = #{pubType}</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="execStatus != null and execStatus != ''"> and exec_status = #{execStatus}</if>
<if test="violateLevel != null and violateLevel != ''"> and violate_level = #{violateLevel}</if>
<if test="violateContent != null and violateContent != ''"> and violate_content = #{violateContent}</if>
<if test="violateTraceContent != null and violateTraceContent != ''"> and violate_trace_content = #{violateTraceContent}</if>
<if test="decisionTime != null "> and decision_time = #{decisionTime}</if>
<if test="decisionOrg != null and decisionOrg != ''"> and decision_org = #{decisionOrg}</if>
<if test="decisionOrgCode != null and decisionOrgCode != ''"> and decision_org_code = #{decisionOrgCode}</if>
<if test="execOrg != null and execOrg != ''"> and exec_org = #{execOrg}</if>
<if test="execOrgCode != null and execOrgCode != ''"> and exec_org_code = #{execOrgCode}</if>
<if test="fileKey != null and fileKey != ''"> and file_key = #{fileKey}</if>
</where>
</select>
<select id="selectCommitmentInfoById" parameterType="Long" resultMap="CreditCommitmentInfoResult">
<include refid="selectCreditCommitmentInfoVo"/>
where id = #{id}
</select>
<select id="queryList" parameterType="com.credit.cy.business.model.query.CreditCommitmentInfoQuery" resultMap="CreditCommitmentInfoResult">
<include refid="selectCreditCommitmentInfoVo"/>
<where>
<if test="null!=createTimeBegin">
AND create_time >= #{createTimeBegin}
</if>
<if test="null!=createTimeEnd">
AND create_time <![CDATA[<=]]> #{createTimeEnd}
</if>
<if test="counterpartName != null and counterpartName != ''">and counterpart_name like concat('%',
#{counterpartName}, '%')
</if>
<if test="itemId != null ">and item_id = #{itemId}</if>
<if test="reportDept != null ">and report_dept = #{reportDept}</if>
<if test="counterpartType != null and counterpartType != ''">and counterpart_type = #{counterpartType}</if>
<if test="creditCode != null and creditCode != ''">and credit_code = #{creditCode}</if>
<if test="commitmentType != null and commitmentType != ''">and commitment_type = #{commitmentType}</if>
<if test="documentNum != null and documentNum != ''">and document_num = #{documentNum}</if>
</where>
</select>
<insert id="insertCommitmentInfo" parameterType="com.credit.cy.business.domain.CreditCommitmentInfo" useGeneratedKeys="true" keyProperty="id">
insert into credit_commitment_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="counterpartName != null and counterpartName != ''">counterpart_name,</if>
<if test="counterpartType != null and counterpartType != ''">counterpart_type,</if>
<if test="creditCode != null and creditCode != ''">credit_code,</if>
<if test="commitmentType != null and commitmentType != ''">commitment_type,</if>
<if test="commitmentCause != null">commitment_cause,</if>
<if test="content != null">content,</if>
<if test="documentNum != null and documentNum != ''">document_num,</if>
<if test="pubType != null and pubType != ''">pub_type,</if>
<if test="duty != null">duty,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="execStatus != null and execStatus != ''">exec_status,</if>
<if test="violateLevel != null">violate_level,</if>
<if test="violateContent != null">violate_content,</if>
<if test="violateTraceContent != null">violate_trace_content,</if>
<if test="decisionTime != null">decision_time,</if>
<if test="decisionOrg != null">decision_org,</if>
<if test="decisionOrgCode != null">decision_org_code,</if>
<if test="execOrg != null">exec_org,</if>
<if test="execOrgCode != null">exec_org_code,</if>
<if test="remark != null">remark,</if>
<if test="fileKey != null">file_key,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="reportDept !=null ">report_dept,</if>
<if test="reportDate !=null ">report_date,</if>
<if test="itemId !=null ">item_id,</if>
<if test="commitmentEntity !=null and commitmentEntity != '' ">commitment_entity,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="counterpartName != null and counterpartName != ''">#{counterpartName},</if>
<if test="counterpartType != null and counterpartType != ''">#{counterpartType},</if>
<if test="creditCode != null and creditCode != ''">#{creditCode},</if>
<if test="commitmentType != null and commitmentType != ''">#{commitmentType},</if>
<if test="commitmentCause != null">#{commitmentCause},</if>
<if test="content != null">#{content},</if>
<if test="documentNum != null and documentNum != ''">#{documentNum},</if>
<if test="pubType != null and pubType != ''">#{pubType},</if>
<if test="duty != null">#{duty},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="execStatus != null and execStatus != ''">#{execStatus},</if>
<if test="violateLevel != null">#{violateLevel},</if>
<if test="violateContent != null">#{violateContent},</if>
<if test="violateTraceContent != null">#{violateTraceContent},</if>
<if test="decisionTime != null">#{decisionTime},</if>
<if test="decisionOrg != null">#{decisionOrg},</if>
<if test="decisionOrgCode != null">#{decisionOrgCode},</if>
<if test="execOrg != null">#{execOrg},</if>
<if test="execOrgCode != null">#{execOrgCode},</if>
<if test="remark != null">#{remark},</if>
<if test="fileKey != null">#{fileKey},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="reportDept != null">#{reportDept},</if>
<if test="reportDate != null">#{reportDate},</if>
<if test="itemId !=null ">#{itemId},</if>
<if test="commitmentEntity !=null and commitmentEntity != '' ">#{commitmentEntity},</if>
</trim>
</insert>
<insert id="batchSave" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
insert into credit_commitment_info
<foreach collection="list" item="item" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="counterpartName != null and counterpartName != ''">counterpart_name,</if>
<if test="counterpartType != null and counterpartType != ''">counterpart_type,</if>
<if test="creditCode != null and creditCode != ''">credit_code,</if>
<if test="commitmentType != null and commitmentType != ''">commitment_type,</if>
<if test="commitmentCause != null">commitment_cause,</if>
<if test="content != null">content,</if>
<if test="documentNum != null and documentNum != ''">document_num,</if>
<if test="pubType != null and pubType != ''">pub_type,</if>
<if test="duty != null">duty,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="execStatus != null and execStatus != ''">exec_status,</if>
<if test="violateLevel != null">violate_level,</if>
<if test="violateContent != null">violate_content,</if>
<if test="violateTraceContent != null">violate_trace_content,</if>
<if test="decisionTime != null">decision_time,</if>
<if test="decisionOrg != null">decision_org,</if>
<if test="decisionOrgCode != null">decision_org_code,</if>
<if test="execOrg != null">exec_org,</if>
<if test="execOrgCode != null">exec_org_code,</if>
<if test="remark != null">remark,</if>
<if test="fileKey != null">file_key,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="reportDept !=null ">report_dept,</if>
<if test="reportDate !=null ">report_date,</if>
<if test="itemId !=null ">item_id,</if>
<if test="commitmentEntity !=null and commitmentEntity != '' ">commitment_entity,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="counterpartName != null and counterpartName != ''">#{counterpartName},</if>
<if test="counterpartType != null and counterpartType != ''">#{counterpartType},</if>
<if test="creditCode != null and creditCode != ''">#{creditCode},</if>
<if test="commitmentType != null and commitmentType != ''">#{commitmentType},</if>
<if test="commitmentCause != null">#{commitmentCause},</if>
<if test="content != null">#{content},</if>
<if test="documentNum != null and documentNum != ''">#{documentNum},</if>
<if test="pubType != null and pubType != ''">#{pubType},</if>
<if test="duty != null">#{duty},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="execStatus != null and execStatus != ''">#{execStatus},</if>
<if test="violateLevel != null">#{violateLevel},</if>
<if test="violateContent != null">#{violateContent},</if>
<if test="violateTraceContent != null">#{violateTraceContent},</if>
<if test="decisionTime != null">#{decisionTime},</if>
<if test="decisionOrg != null">#{decisionOrg},</if>
<if test="decisionOrgCode != null">#{decisionOrgCode},</if>
<if test="execOrg != null">#{execOrg},</if>
<if test="execOrgCode != null">#{execOrgCode},</if>
<if test="remark != null">#{remark},</if>
<if test="fileKey != null">#{fileKey},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="reportDept != null">#{reportDept},</if>
<if test="reportDate != null">#{reportDate},</if>
<if test="itemId !=null ">#{itemId},</if>
<if test="commitmentEntity !=null and commitmentEntity != '' ">#{commitmentEntity},</if>
</trim>
</foreach>
</insert>
<update id="updateCommitmentInfo" parameterType="com.credit.cy.business.domain.CreditCommitmentInfo">
update credit_commitment_info
<trim prefix="SET" suffixOverrides=",">
<if test="counterpartName != null and counterpartName != ''">counterpart_name = #{counterpartName},</if>
<if test="counterpartType != null and counterpartType != ''">counterpart_type = #{counterpartType},</if>
<if test="creditCode != null and creditCode != ''">credit_code = #{creditCode},</if>
<if test="commitmentType != null and commitmentType != ''">commitment_type = #{commitmentType},</if>
<if test="commitmentCause != null">commitment_cause = #{commitmentCause},</if>
<if test="content != null">content = #{content},</if>
<if test="documentNum != null and documentNum != ''">document_num = #{documentNum},</if>
<if test="pubType != null and pubType != ''">pub_type = #{pubType},</if>
<if test="duty != null and duty != ''">duty = #{duty},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="execStatus != null and execStatus != ''">exec_status = #{execStatus},</if>
<if test="violateLevel != null">violate_level = #{violateLevel},</if>
<if test="violateContent != null">violate_content = #{violateContent},</if>
<if test="violateTraceContent != null">violate_trace_content = #{violateTraceContent},</if>
<if test="decisionTime != null">decision_time = #{decisionTime},</if>
<if test="decisionOrg != null">decision_org = #{decisionOrg},</if>
<if test="decisionOrgCode != null">decision_org_code = #{decisionOrgCode},</if>
<if test="execOrg != null">exec_org = #{execOrg},</if>
<if test="execOrgCode != null">exec_org_code = #{execOrgCode},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="fileKey != null">file_key = #{fileKey},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="reportDept != null">report_dept=#{reportDept},</if>
<if test="reportDate != null">report_date=#{reportDate},</if>
<if test="commitmentEntity !=null and commitmentEntity != '' ">#{commitmentEntity},</if>
<if test="fulfillDate != null">fulfill_date=#{fulfillDate},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCommitmentInfoById" parameterType="Long">
delete from credit_commitment_info where id = #{id}
</delete>
<delete id="deleteCommitmentInfoByIds" parameterType="String">
delete from credit_commitment_info where id in
<foreach item="id" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectCount" parameterType="com.credit.cy.business.model.query.WorkCountQuery" resultType="java.lang.Long">
select count(1) from credit_commitment_info
<where>
<if test="reportDept != null and reportDept != ''"> and report_dept = #{reportDept}</if>
<if test="null!=reportStartDate"> and report_date >= #{reportStartDate}</if>
<if test="null!=reportEndDate"> AND report_date <![CDATA[<=]]> #{reportEndDate}</if>
</where>
</select>
<select id="selectDeptCount" parameterType="com.credit.cy.business.model.query.WorkCountQuery" resultType="java.lang.Long">
select count(distinct report_dept) from credit_commitment_info
<where>
<if test="reportDept != null and reportDept != ''"> and report_dept = #{reportDept}</if>
<if test="null!=reportStartDate"> and report_date >= #{reportStartDate}</if>
<if test="null!=reportEndDate"> AND report_date <![CDATA[<=]]> #{reportEndDate}</if>
</where>
</select>
<select id="selectGroupCount" parameterType="com.credit.cy.business.model.query.WorkCountQuery" resultType="com.credit.cy.business.model.GroupNumResult">
select report_dept as dept,count(1) as total from credit_commitment_info
<where>
<if test="reportDept != null and reportDept != ''"> and report_dept = #{reportDept}</if>
<if test="null!=reportStartDate"> and report_date >= #{reportStartDate}</if>
<if test="null!=reportEndDate"> AND report_date <![CDATA[<=]]> #{reportEndDate}</if>
</where>
group by report_dept
</select>
</mapper>