TemplateConfigurationMapper.xml
7.29 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
<?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.templateConfiguration.mapper.TemplateConfigurationMapper">
<resultMap type="TemplateConfiguration" id="TemplateConfigurationResult">
<result property="id" column="id" />
<result property="orgId" column="org_id" />
<result property="contractId" column="contract_id" />
<result property="owner" column="owner" />
<result property="typeId" column="type_id" />
<result property="serviceRemark" column="service_remark" />
<result property="contractRemark" column="contract_remark" />
<result property="contractName" column="contract_name" />
<result property="reportForm" column="report_form" />
<result property="clientId" column="client_id" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectTemplateConfigurationVo">
select id, org_id, contract_id, owner, contract_name,contract_remark,service_remark,type_id, report_form, client_id, create_time, create_by, update_time, update_by from template_configuration
</sql>
<select id="selectTemplateConfigurationList" parameterType="TemplateConfiguration" resultMap="TemplateConfigurationResult">
<include refid="selectTemplateConfigurationVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="orgId != null "> and org_id = #{orgId}</if>
<if test="contractId != null "> and contract_id = #{contractId}</if>
<if test="owner != null and owner != '' "> and owner = #{owner}</if>
<if test="serviceRemark != null and serviceRemark != '' "> and service_remark = #{serviceRemark}</if>
<if test="contractRemark != null and contractRemark != '' "> and contract_remark = #{contractRemark}</if>
<if test="contractName != null and contractName != '' "> and contract_name = #{contractName}</if>
<if test="typeId != null and typeId != '' "> and type_id = #{typeId}</if>
<if test="reportForm != null and reportForm != '' "> and report_form = #{reportForm}</if>
<if test="clientId != null and clientId != '' "> and client_id = #{clientId}</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>
</where>
</select>
<select id="selectTemplateConfigurationById" parameterType="Long" resultMap="TemplateConfigurationResult">
<include refid="selectTemplateConfigurationVo"/>
where id = #{id}
</select>
<select id="getTemppConfByOrg" parameterType="Long" resultMap="TemplateConfigurationResult">
<include refid="selectTemplateConfigurationVo"/>
<where>
<if test="orgId != null "> and org_id = #{orgId}</if>
</where>
</select>
<insert id="insertTemplateConfiguration" parameterType="TemplateConfiguration" useGeneratedKeys="true" keyProperty="id">
insert into template_configuration
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orgId != null ">org_id,</if>
<if test="contractId != null ">contract_id,</if>
<if test="owner != null and owner != '' ">owner,</if>
<if test="typeId != null and typeId != '' ">type_id,</if>
<if test="serviceRemark != null and serviceRemark != '' "> service_remark ,</if>
<if test="contractRemark != null and contractRemark != '' "> contract_remark ,</if>
<if test="contractName != null and contractName != '' "> contract_name ,</if>
<if test="reportForm != null and reportForm != '' ">report_form,</if>
<if test="clientId != null and clientId != '' ">client_id,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orgId != null ">#{orgId},</if>
<if test="contractId != null ">#{contractId},</if>
<if test="owner != null and owner != '' ">#{owner},</if>
<if test="typeId != null and typeId != '' ">#{typeId},</if>
<if test="serviceRemark != null and serviceRemark != '' "> #{serviceRemark},</if>
<if test="contractRemark != null and contractRemark != '' "> #{contractRemark}, </if>
<if test="contractName != null and contractName != '' "> #{contractName},</if>
<if test="reportForm != null and reportForm != '' ">#{reportForm},</if>
<if test="clientId != null and clientId != '' ">#{clientId},</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>
</trim>
</insert>
<update id="updateTemplateConfiguration" parameterType="TemplateConfiguration">
update template_configuration
<trim prefix="SET" suffixOverrides=",">
<if test="orgId != null ">org_id = #{orgId},</if>
<if test="contractId != null ">contract_id = #{contractId},</if>
<if test="owner != null ">owner = #{owner},</if>
<if test="serviceRemark != null "> service_remark = #{serviceRemark},</if>
<if test="contractRemark != null "> contract_remark = #{contractRemark}, </if>
<if test="contractName != null "> contract_name = #{contractName},</if>
type_id = #{typeId},
<if test="reportForm != null and reportForm != '' ">report_form = #{reportForm},</if>
<if test="clientId != null ">client_id = #{clientId},</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>
</trim>
where id = #{id}
</update>
<delete id="deleteTemplateConfigurationById" parameterType="Long">
delete from template_configuration where id = #{id}
</delete>
<delete id="deleteTemplateConfigurationByIds" parameterType="String">
delete from template_configuration where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>