TemplateConfigurationParametersMapper.xml
13.6 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
<?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.templateConfigurationParameters.mapper.TemplateConfigurationParametersMapper">
<resultMap type="TemplateConfigurationParameters" id="TemplateConfigurationParametersResult">
<result property="id" column="id" />
<result property="templateId" column="template_id" />
<result property="orgId" column="org_id" />
<result property="typeId" column="type_id" />
<result property="typeName" column="type_name" />
<result property="clientType" column="client_type" />
<result property="typePrice" column="type_price" />
<result property="reportPrice" column="report_price" />
<result property="deliveryDays" column="delivery_days" />
<result property="reportTranslationType" column="report_translation_type" />
<result property="price" column="price" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="clientId" column="client_id" />
<result property="checked" column="checked" />
<result property="status" column="status" />
</resultMap>
<sql id="selectTemplateConfigurationParametersVo">
select id, template_id, type_id, type_name, client_type,client_id,checked, type_price, report_price, delivery_days, report_translation_type, price, create_time, create_by, update_time, update_by ,status from template_configuration_parameters
</sql>
<select id="selectTemplateConfigurationParametersList" parameterType="TemplateConfigurationParameters" resultMap="TemplateConfigurationParametersResult">
<include refid="selectTemplateConfigurationParametersVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="templateId != null "> and template_id = #{templateId}</if>
<if test="orgId != null "> and org_id = #{orgId}</if>
<if test="typeId != null "> and type_id = #{typeId}</if>
<if test="typeName != null and typeName != '' "> and type_name = #{typeName}</if>
<if test="clientType != null and clientType != '' "> and client_type = #{clientType}</if>
<if test="typePrice != null "> and type_price = #{typePrice}</if>
<if test="clientId != null "> and client_id = #{clientId}</if>
<if test="checked != null "> and checked = #{checked}</if>
<if test="reportPrice != null "> and report_price = #{reportPrice}</if>
<if test="deliveryDays != null "> and delivery_days = #{deliveryDays}</if>
<if test="reportTranslationType != null and reportTranslationType != '' "> and report_translation_type = #{reportTranslationType}</if>
<if test="price != null "> and price = #{price}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="createBy != null and createBy != '' "> and create_by = #{createBy}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="updateBy != null and updateBy != '' "> and update_by = #{updateBy}</if>
and status = 0
</where>
ORDER BY
type_id ASC,
client_id ASC,
CASE client_type
WHEN 3 THEN 1
WHEN 0 THEN 2
WHEN 1 THEN 3
WHEN 2 THEN 4
WHEN 4 THEN 5
ELSE 6
END
;
</select>
<select id="selectTemplateConfigurationParametersById" parameterType="String" resultMap="TemplateConfigurationParametersResult">
<include refid="selectTemplateConfigurationParametersVo"/>
where id = #{id}
</select>
<select id="selectTemplateConfigurationParametersClientIds"
resultType="com.lhcredit.project.business.templateConfigurationParameters.domain.TemplateConfigurationParameters"
parameterType="String">
<include refid="selectTemplateConfigurationParametersVo"/>
where client_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<insert id="insertTemplateConfigurationParameters" parameterType="TemplateConfigurationParameters" useGeneratedKeys="true" keyProperty="id">
insert into template_configuration_parameters
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null and id != '' ">id,</if>
<if test="templateId != null ">template_id,</if>
<if test="orgId != null ">org_id,</if>
<if test="typeId != null ">type_id,</if>
<if test="typeName != null and typeName != '' ">type_name,</if>
<if test="clientType != null and clientType != '' ">client_type,</if>
<if test="typePrice != null ">type_price,</if>
<if test="reportPrice != null ">report_price,</if>
<if test="clientId != null ">client_id,</if>
<if test="checked != null ">checked,</if>
<if test="deliveryDays != null ">delivery_days,</if>
<if test="reportTranslationType != null and reportTranslationType != '' ">report_translation_type,</if>
<if test="price != null ">price,</if>
<if test="createTime != null ">create_time,</if>
<if test="createBy != null and createBy != '' ">create_by,</if>
<if test="updateTime != null ">update_time,</if>
<if test="updateBy != null and updateBy != '' ">update_by,</if>
<if test="status != null and status != '' ">status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != '' ">#{id},</if>
<if test="templateId != null ">#{templateId},</if>
<if test="orgId != null ">#{orgId},</if>
<if test="typeId != null ">#{typeId},</if>
<if test="typeName != null and typeName != '' ">#{typeName},</if>
<if test="clientType != null and clientType != '' ">#{clientType},</if>
<if test="typePrice != null ">#{typePrice},</if>
<if test="reportPrice != null ">#{reportPrice},</if>
<if test="clientId != null ">#{clientId},</if>
<if test="checked != null ">#{checked},</if>
<if test="deliveryDays != null ">#{deliveryDays},</if>
<if test="reportTranslationType != null and reportTranslationType != '' ">#{reportTranslationType},</if>
<if test="price != null ">#{price},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="createBy != null and createBy != '' ">#{createBy},</if>
<if test="updateTime != null ">#{updateTime},</if>
<if test="updateBy != null and updateBy != '' ">#{updateBy},</if>
<if test="status != null and status != '' ">#{status},</if>
</trim>
</insert>
<insert id="batchInsertTemplateConfigurationParameters" parameterType="java.util.List">
INSERT INTO template_configuration_parameters
<foreach collection="list" item="item" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="item.templateId != null">template_id,</if>
<if test="item.typeId != null">type_id,</if>
<if test="item.typeName != null and item.typeName != ''">type_name,</if>
<if test="item.clientType != null and item.clientType != ''">client_type,</if>
<if test="item.typePrice != null">type_price,</if>
<if test="item.clientId != null">client_id,</if>
<if test="item.checked != null">checked,</if>
<if test="item.deliveryDays != null">delivery_days,</if>
<if test="item.reportTranslationType != null and item.reportTranslationType != ''">report_translation_type,</if>
<if test="item.price != null">price,</if>
<if test="item.createTime != null">create_time,</if>
<if test="item.createBy != null and item.createBy != ''">create_by,</if>
<if test="item.updateTime != null">update_time,</if>
<if test="item.updateBy != null and item.updateBy != ''">update_by,</if>
<if test="item.status != null and item.status != ''">status,</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="item.templateId != null">#{item.templateId},</if>
<if test="item.typeId != null">#{item.typeId},</if>
<if test="item.typeName != null and item.typeName != ''">#{item.typeName},</if>
<if test="item.clientType != null and item.clientType != ''">#{item.clientType},</if>
<if test="item.typePrice != null">#{item.typePrice},</if>
<if test="item.clientId != null">#{item.clientId},</if>
<if test="item.checked != null">#{item.checked},</if>
<if test="item.deliveryDays != null">#{item.deliveryDays},</if>
<if test="item.reportTranslationType != null and item.reportTranslationType != ''">#{item.reportTranslationType},</if>
<if test="item.price != null">#{item.price},</if>
<if test="item.createTime != null">#{item.createTime},</if>
<if test="item.createBy != null and item.createBy != ''">#{item.createBy},</if>
<if test="item.updateTime != null">#{item.updateTime},</if>
<if test="item.updateBy != null and item.updateBy != ''">#{item.updateBy},</if>
<if test="item.status != null and item.status != ''">#{item.status},</if>
</trim>
</foreach>
</insert>
<update id="updateTemplateConfigurationParameters" parameterType="TemplateConfigurationParameters">
update template_configuration_parameters
<trim prefix="SET" suffixOverrides=",">
<if test="templateId != null ">template_id = #{templateId},</if>
<if test="orgId != null ">org_id = #{orgId},</if>
<if test="typeId != null ">type_id = #{typeId},</if>
<if test="typeName != null and typeName != '' ">type_name = #{typeName},</if>
<if test="clientType != null and clientType != '' ">client_type = #{clientType},</if>
<if test="typePrice != null ">type_price = #{typePrice},</if>
<if test="clientId != null ">client_id = #{clientId},</if>
<if test="checked != null ">checked = #{checked},</if>
<if test="reportPrice != null ">report_price = #{reportPrice},</if>
<if test="deliveryDays != null ">delivery_days = #{deliveryDays},</if>
<if test="reportTranslationType != null and reportTranslationType != '' ">report_translation_type = #{reportTranslationType},</if>
<if test="price != null ">price = #{price},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="createBy != null and createBy != '' ">create_by = #{createBy},</if>
<if test="updateTime != null ">update_time = #{updateTime},</if>
<if test="updateBy != null and updateBy != '' ">update_by = #{updateBy},</if>
<if test="status != null and status != '' ">status = #{status},</if>
</trim>
where id = #{id}
</update>
<update id="updateTemplateConfigurationParametersNameAndStatus" parameterType="TemplateConfigurationParameters">
update template_configuration_parameters
<trim prefix="SET" suffixOverrides=",">
<if test="templateId != null ">template_id = #{templateId},</if>
<if test="orgId != null ">org_id = #{orgId},</if>
<if test="typeId != null ">type_id = #{typeId},</if>
<if test="typeName != null and typeName != '' ">type_name = #{typeName},</if>
<if test="clientType != null and clientType != '' ">client_type = #{clientType},</if>
<if test="typePrice != null ">type_price = #{typePrice},</if>
<if test="clientId != null ">client_id = #{clientId},</if>
<if test="checked != null ">checked = #{checked},</if>
<if test="reportPrice != null ">report_price = #{reportPrice},</if>
<if test="deliveryDays != null ">delivery_days = #{deliveryDays},</if>
<if test="reportTranslationType != null and reportTranslationType != '' ">report_translation_type = #{reportTranslationType},</if>
<if test="price != null ">price = #{price},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="createBy != null and createBy != '' ">create_by = #{createBy},</if>
<if test="updateTime != null ">update_time = #{updateTime},</if>
<if test="updateBy != null and updateBy != '' ">update_by = #{updateBy},</if>
<if test="status != null and status != '' ">status = #{status},</if>
</trim>
where client_id = #{clientId}
</update>
<delete id="deleteTemplateConfigurationParametersById" parameterType="Long">
delete from template_configuration_parameters where id = #{id}
</delete>
<delete id="deleteTemplateConfigurationParametersByOrgId" parameterType="Long">
delete from template_configuration_parameters where org_id = #{OrgId}
</delete>
<delete id="deleteTemplateConfigurationParametersByIds" parameterType="String">
delete from template_configuration_parameters where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>