CreditGrantingInfoMapper.xml
17.7 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
<?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.lhcredit.project.business.creditGrantingInfo.mapper.CreditGrantingInfoMapper">
<resultMap type="CreditGrantingInfo" id="CreditGrantingInfoResult">
<result property="id" column="id" />
<result property="ename" column="ename" />
<result property="basicInfo" column="basicInfo" />
<result property="effectiveDate" column="effectiveDate" />
<result property="deadline" column="deadline" />
<result property="companyType" column="companyType" />
<result property="companyNature" column="CompanyNature" />
<result property="collateralList" column="collateralList" />
<result property="guaranteeContract" column="guaranteeContract" />
<result property="historicalTransactions" column="historicalTransactions" />
<result property="historicalTransactionsAnnex" column="historicalTransactionsAnnex" />
<result property="comprehensiveRate" column="comprehensiveRate" />
<result property="comprehensiveRateSub" column="comprehensiveRateSub" />
<result property="comprehensiveRateSubInfo" column="comprehensiveRateSubInfo" />
<result property="comprehensiveRateImg" column="comprehensiveRateImg" />
<result property="creditAnalysis" column="creditAnalysis" />
<result property="radarImg" column="radarImg" />
<result property="creditLv" column="creditLv" />
<result property="creditRemark" column="creditRemark" />
<result property="creditReport" column="creditReport" />
<result property="creditLimit" column="creditLimit" />
<result property="creditLimitLast" column="creditLimitLast" />
<result property="creditLimitAdd" column="creditLimitAdd" />
<result property="creditLimitAddInfo" column="creditLimitAddInfo" />
<result property="creditLimitAddAnnex" column="creditLimitAddAnnex" />
<result property="userId" column="user_id" />
<result property="orgId" column="org_id" />
<result property="delFlag" column="del_flag" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectCreditGrantingInfoVo">
select id, ename, basicInfo, effectiveDate, deadline, companyType, CompanyNature, collateralList, guaranteeContract, historicalTransactions, historicalTransactionsAnnex, comprehensiveRate, comprehensiveRateSub, comprehensiveRateSubInfo, comprehensiveRateImg, creditAnalysis, radarImg, creditLv, creditRemark, creditReport, creditLimit, creditLimitLast, creditLimitAdd, creditLimitAddInfo, creditLimitAddAnnex, user_id, org_id, del_flag, create_time, update_time, update_by from credit_granting_info
</sql>
<select id="selectCreditGrantingInfoList" parameterType="CreditGrantingInfo" resultMap="CreditGrantingInfoResult">
<include refid="selectCreditGrantingInfoVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="ename != null and ename != '' "> and ename = #{ename}</if>
<if test="basicInfo != null and basicInfo != '' "> and basicInfo = #{basicInfo}</if>
<if test="effectiveDate != null "> and effectiveDate = #{effectiveDate}</if>
<if test="deadline != null "> and deadline = #{deadline}</if>
<if test="companyType != null and companyType != '' "> and companyType = #{companyType}</if>
<if test="companyNature != null and companyNature != '' "> and CompanyNature = #{companyNature}</if>
<if test="collateralList != null and collateralList != '' "> and collateralList = #{collateralList}</if>
<if test="guaranteeContract != null and guaranteeContract != '' "> and guaranteeContract = #{guaranteeContract}</if>
<if test="historicalTransactions != null and historicalTransactions != '' "> and historicalTransactions = #{historicalTransactions}</if>
<if test="historicalTransactionsAnnex != null and historicalTransactionsAnnex != '' "> and historicalTransactionsAnnex = #{historicalTransactionsAnnex}</if>
<if test="comprehensiveRate != null "> and comprehensiveRate = #{comprehensiveRate}</if>
<if test="comprehensiveRateSub != null "> and comprehensiveRateSub = #{comprehensiveRateSub}</if>
<if test="comprehensiveRateSubInfo != null and comprehensiveRateSubInfo != '' "> and comprehensiveRateSubInfo = #{comprehensiveRateSubInfo}</if>
<if test="comprehensiveRateImg != null and comprehensiveRateImg != '' "> and comprehensiveRateImg = #{comprehensiveRateImg}</if>
<if test="creditAnalysis != null and creditAnalysis != '' "> and creditAnalysis = #{creditAnalysis}</if>
<if test="radarImg != null and radarImg != '' "> and radarImg = #{radarImg}</if>
<if test="creditLv != null and creditLv != '' "> and creditLv = #{creditLv}</if>
<if test="creditRemark != null and creditRemark != '' "> and creditRemark = #{creditRemark}</if>
<if test="creditReport != null and creditReport != '' "> and creditReport = #{creditReport}</if>
<if test="creditLimit != null "> and creditLimit = #{creditLimit}</if>
<if test="creditLimitLast != null "> and creditLimitLast = #{creditLimitLast}</if>
<if test="creditLimitAdd != null "> and creditLimitAdd = #{creditLimitAdd}</if>
<if test="creditLimitAddInfo != null and creditLimitAddInfo != '' "> and creditLimitAddInfo = #{creditLimitAddInfo}</if>
<if test="creditLimitAddAnnex != null and creditLimitAddAnnex != '' "> and creditLimitAddAnnex = #{creditLimitAddAnnex}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="orgId != null "> and org_id = #{orgId}</if>
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="updateBy != null and updateBy != '' "> and update_by = #{updateBy}</if>
</where>
</select>
<select id="selectCreditGrantingInfoById" parameterType="Long" resultMap="CreditGrantingInfoResult">
<include refid="selectCreditGrantingInfoVo"/>
where id = #{id}
</select>
<insert id="insertCreditGrantingInfo" parameterType="CreditGrantingInfo" useGeneratedKeys="true" keyProperty="id">
insert into credit_granting_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ename != null and ename != '' ">ename,</if>
<if test="basicInfo != null and basicInfo != '' ">basicInfo,</if>
<if test="effectiveDate != null ">effectiveDate,</if>
<if test="deadline != null ">deadline,</if>
<if test="companyType != null and companyType != '' ">companyType,</if>
<if test="companyNature != null and companyNature != '' ">CompanyNature,</if>
<if test="collateralList != null and collateralList != '' ">collateralList,</if>
<if test="guaranteeContract != null and guaranteeContract != '' ">guaranteeContract,</if>
<if test="historicalTransactions != null and historicalTransactions != '' ">historicalTransactions,</if>
<if test="historicalTransactionsAnnex != null and historicalTransactionsAnnex != '' ">historicalTransactionsAnnex,</if>
<if test="comprehensiveRate != null ">comprehensiveRate,</if>
<if test="comprehensiveRateSub != null ">comprehensiveRateSub,</if>
<if test="comprehensiveRateSubInfo != null and comprehensiveRateSubInfo != '' ">comprehensiveRateSubInfo,</if>
<if test="comprehensiveRateImg != null and comprehensiveRateImg != '' ">comprehensiveRateImg,</if>
<if test="creditAnalysis != null and creditAnalysis != '' ">creditAnalysis,</if>
<if test="radarImg != null and radarImg != '' ">radarImg,</if>
<if test="creditLv != null and creditLv != '' ">creditLv,</if>
<if test="creditRemark != null and creditRemark != '' ">creditRemark,</if>
<if test="creditReport != null and creditReport != '' ">creditReport,</if>
<if test="creditLimit != null ">creditLimit,</if>
<if test="creditLimitLast != null ">creditLimitLast,</if>
<if test="creditLimitAdd != null ">creditLimitAdd,</if>
<if test="creditLimitAddInfo != null and creditLimitAddInfo != '' ">creditLimitAddInfo,</if>
<if test="creditLimitAddAnnex != null and creditLimitAddAnnex != '' ">creditLimitAddAnnex,</if>
<if test="userId != null ">user_id,</if>
<if test="orgId != null ">org_id,</if>
<if test="delFlag != null and delFlag != '' ">del_flag,</if>
<if test="createTime != null ">create_time,</if>
<if test="updateTime != null ">update_time,</if>
<if test="updateBy != null and updateBy != '' ">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ename != null and ename != '' ">#{ename},</if>
<if test="basicInfo != null and basicInfo != '' ">#{basicInfo},</if>
<if test="effectiveDate != null ">#{effectiveDate},</if>
<if test="deadline != null ">#{deadline},</if>
<if test="companyType != null and companyType != '' ">#{companyType},</if>
<if test="companyNature != null and companyNature != '' ">#{companyNature},</if>
<if test="collateralList != null and collateralList != '' ">#{collateralList},</if>
<if test="guaranteeContract != null and guaranteeContract != '' ">#{guaranteeContract},</if>
<if test="historicalTransactions != null and historicalTransactions != '' ">#{historicalTransactions},</if>
<if test="historicalTransactionsAnnex != null and historicalTransactionsAnnex != '' ">#{historicalTransactionsAnnex},</if>
<if test="comprehensiveRate != null ">#{comprehensiveRate},</if>
<if test="comprehensiveRateSub != null ">#{comprehensiveRateSub},</if>
<if test="comprehensiveRateSubInfo != null and comprehensiveRateSubInfo != '' ">#{comprehensiveRateSubInfo},</if>
<if test="comprehensiveRateImg != null and comprehensiveRateImg != '' ">#{comprehensiveRateImg},</if>
<if test="creditAnalysis != null and creditAnalysis != '' ">#{creditAnalysis},</if>
<if test="radarImg != null and radarImg != '' ">#{radarImg},</if>
<if test="creditLv != null and creditLv != '' ">#{creditLv},</if>
<if test="creditRemark != null and creditRemark != '' ">#{creditRemark},</if>
<if test="creditReport != null and creditReport != '' ">#{creditReport},</if>
<if test="creditLimit != null ">#{creditLimit},</if>
<if test="creditLimitLast != null ">#{creditLimitLast},</if>
<if test="creditLimitAdd != null ">#{creditLimitAdd},</if>
<if test="creditLimitAddInfo != null and creditLimitAddInfo != '' ">#{creditLimitAddInfo},</if>
<if test="creditLimitAddAnnex != null and creditLimitAddAnnex != '' ">#{creditLimitAddAnnex},</if>
<if test="userId != null ">#{userId},</if>
<if test="orgId != null ">#{orgId},</if>
<if test="delFlag != null and delFlag != '' ">#{delFlag},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="updateTime != null ">#{updateTime},</if>
<if test="updateBy != null and updateBy != '' ">#{updateBy},</if>
</trim>
</insert>
<update id="updateCreditGrantingInfo" parameterType="CreditGrantingInfo">
update credit_granting_info
<trim prefix="SET" suffixOverrides=",">
<if test="ename != null and ename != '' ">ename = #{ename},</if>
<if test="basicInfo != null and basicInfo != '' ">basicInfo = #{basicInfo},</if>
<if test="effectiveDate != null ">effectiveDate = #{effectiveDate},</if>
<if test="deadline != null ">deadline = #{deadline},</if>
<if test="companyType != null and companyType != '' ">companyType = #{companyType},</if>
<if test="companyNature != null and companyNature != '' ">CompanyNature = #{companyNature},</if>
<if test="collateralList != null and collateralList != '' ">collateralList = #{collateralList},</if>
<if test="guaranteeContract != null and guaranteeContract != '' ">guaranteeContract = #{guaranteeContract},</if>
<if test="historicalTransactions != null and historicalTransactions != '' ">historicalTransactions = #{historicalTransactions},</if>
<if test="historicalTransactionsAnnex != null and historicalTransactionsAnnex != '' ">historicalTransactionsAnnex = #{historicalTransactionsAnnex},</if>
<if test="comprehensiveRate != null ">comprehensiveRate = #{comprehensiveRate},</if>
<if test="comprehensiveRateSub != null ">comprehensiveRateSub = #{comprehensiveRateSub},</if>
<if test="comprehensiveRateSubInfo != null and comprehensiveRateSubInfo != '' ">comprehensiveRateSubInfo = #{comprehensiveRateSubInfo},</if>
<if test="comprehensiveRateImg != null and comprehensiveRateImg != '' ">comprehensiveRateImg = #{comprehensiveRateImg},</if>
<if test="creditAnalysis != null and creditAnalysis != '' ">creditAnalysis = #{creditAnalysis},</if>
<if test="radarImg != null and radarImg != '' ">radarImg = #{radarImg},</if>
<if test="creditLv != null and creditLv != '' ">creditLv = #{creditLv},</if>
<if test="creditRemark != null and creditRemark != '' ">creditRemark = #{creditRemark},</if>
<if test="creditReport != null and creditReport != '' ">creditReport = #{creditReport},</if>
<if test="creditLimit != null ">creditLimit = #{creditLimit},</if>
<if test="creditLimitLast != null ">creditLimitLast = #{creditLimitLast},</if>
<if test="creditLimitAdd != null ">creditLimitAdd = #{creditLimitAdd},</if>
<if test="creditLimitAddInfo != null and creditLimitAddInfo != '' ">creditLimitAddInfo = #{creditLimitAddInfo},</if>
<if test="creditLimitAddAnnex != null and creditLimitAddAnnex != '' ">creditLimitAddAnnex = #{creditLimitAddAnnex},</if>
<if test="userId != null ">user_id = #{userId},</if>
<if test="orgId != null ">org_id = #{orgId},</if>
<if test="delFlag != null and delFlag != '' ">del_flag = #{delFlag},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="updateTime != null ">update_time = #{updateTime},</if>
<if test="updateBy != null and updateBy != '' ">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCreditGrantingInfoById" parameterType="Long">
delete from credit_granting_info where id = #{id}
</delete>
<delete id="deleteCreditGrantingInfoByIds" parameterType="String">
delete from credit_granting_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectPageList"
resultMap="CreditGrantingInfoResult">
<include refid="selectCreditGrantingInfoVo"/>
<where>
<if test="orgId!= null">
and org_id in (SELECT dept_id FROM`org_dept` WHERE org_id=#{orgId})
</if>
<if test="ename != null and ename != '' "> and ename like concat("%",#{ename},"%")</if>
<if test="creditLimitSt != null "> and creditLimitLast <![CDATA[ >= ]]> #{creditLimitSt}</if>
<if test="creditLimitEd != null "> and creditLimitLast <![CDATA[ <= ]]> #{creditLimitEd}</if>
<if test="creditLv != null and creditLv != '' "> and creditLv = #{creditLv}</if>
<if test="creditStatus != null and creditStatus != '' ">
<if test="creditStatus == '待生效'">and effectiveDate <![CDATA[ > ]]> NOW() </if>
<if test="creditStatus == '已失效'">and deadline <![CDATA[ < ]]> NOW() </if>
<if test="creditStatus == '生效中'">and effectiveDate <![CDATA[ <= ]]> NOW() AND deadline <![CDATA[ >= ]]> NOW() </if>
</if>
<if test="creditTimeSt != null "> and effectiveDate <![CDATA[ >= ]]> #{creditTimeSt}</if>
<if test="creditTimeEd != null "> and deadline <![CDATA[ <= ]]> #{creditTimeEd}</if>
</where>
<if test="sort !=null">
<if test="sort == 1">order by effectiveDate desc</if>
<if test="sort == 2">order by creditLimitLast desc</if>
<if test="sort == 3">order by creditLimitLast asc</if>
<if test="sort == 4">order by comprehensiveRate desc</if>
<if test="sort == 5">order by comprehensiveRate asc</if>
</if>
</select>
<select id="selectCreditGrantingInfoListApplication"
resultMap="CreditGrantingInfoResult">
<include refid="selectCreditGrantingInfoVo"/>
where creditLimitAdd is not null
<if test="ename != null and ename != '' "> and ename like concat("%",#{ename},"%")</if>
order by create_time desc
</select>
</mapper>