CreditCommitmentItemMapper.xml
8.71 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
<?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.CreditCommitmentItemMapper">
<resultMap type="com.credit.cy.business.domain.CreditCommitmentItem" id="CreditCommitmentItemResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="abbreviation" column="abbreviation" />
<result property="counterpartType" column="counterpart_type" />
<result property="type" column="type" />
<result property="cause" column="cause" />
<result property="content" column="content" />
<result property="pubType" column="pub_type" />
<result property="duty" column="duty" />
<result property="execOrg" column="exec_org" />
<result property="execOrgCode" column="exec_org_code" />
<result property="remark" column="remark" />
<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="applyStatus" column="apply_status" />
<result property="auditBy" column="audit_by" />
<result property="createDept" column="create_dept" />
<result property="checkMsg" column="check_msg" />
</resultMap>
<sql id="selectCreditCommitmentItemVo">
select id, name, abbreviation, counterpart_type, type, cause, content, pub_type, duty, exec_org, exec_org_code, remark, create_time,
update_time, create_by, update_by, apply_status, audit_by,create_dept,check_msg from credit_commitment_item
</sql>
<sql id="selectSimpleCommitmentItemVo">
select id, name, abbreviation, counterpart_type, type, cause, content, pub_type, duty, exec_org, exec_org_code from credit_commitment_item
</sql>
<select id="selectCreditCommitmentItemList" parameterType="com.credit.cy.business.domain.CreditCommitmentItem" resultMap="CreditCommitmentItemResult">
<include refid="selectCreditCommitmentItemVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%',#{name}, '%')</if>
<if test="abbreviation != null and abbreviation != ''"> and abbreviation like concat('%',#{abbreviation}, '%')</if>
<if test="counterpartType != null and counterpartType != ''"> and counterpart_type = #{counterpartType}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="cause != null and cause != ''"> and cause = #{cause}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="pubType != null and pubType != ''"> and pub_type = #{pubType}</if>
<if test="duty != null and duty != ''"> and duty = #{duty}</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="applyStatus != null and applyStatus != ''"> and apply_status = #{applyStatus}</if>
<if test="auditBy != null "> and audit_by = #{auditBy}</if>
<if test="createDept != null "> and create_dept = #{createDept}</if>
</where>
</select>
<select id="selectCreditCommitmentItemById" parameterType="Long" resultMap="CreditCommitmentItemResult">
<include refid="selectCreditCommitmentItemVo"/>
where id = #{id}
</select>
<insert id="insertCreditCommitmentItem" parameterType="com.credit.cy.business.domain.CreditCommitmentItem" useGeneratedKeys="true" keyProperty="id">
insert into credit_commitment_item
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">name,</if>
<if test="abbreviation != null and abbreviation != ''">abbreviation,</if>
<if test="counterpartType != null and counterpartType != ''">counterpart_type,</if>
<if test="type != null and type != ''">type,</if>
<if test="cause != null and cause != ''">cause,</if>
<if test="content != null and content != ''">content,</if>
<if test="pubType != null and pubType != ''">pub_type,</if>
<if test="duty != null and duty != ''">duty,</if>
<if test="execOrg != null">exec_org,</if>
<if test="execOrgCode != null">exec_org_code,</if>
<if test="remark != null">remark,</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="applyStatus != null">apply_status,</if>
<if test="auditBy != null">audit_by,</if>
<if test="createDept != null">create_dept,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if>
<if test="abbreviation != null and abbreviation != ''">#{abbreviation},</if>
<if test="counterpartType != null and counterpartType != ''">#{counterpartType},</if>
<if test="type != null and type != ''">#{type},</if>
<if test="cause != null and cause != ''">#{cause},</if>
<if test="content != null and content != ''">#{content},</if>
<if test="pubType != null and pubType != ''">#{pubType},</if>
<if test="duty != null and duty != ''">#{duty},</if>
<if test="execOrg != null">#{execOrg},</if>
<if test="execOrgCode != null">#{execOrgCode},</if>
<if test="remark != null">#{remark},</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="applyStatus != null">#{applyStatus},</if>
<if test="auditBy != null">#{auditBy},</if>
<if test="createDept != null">#{createDept},</if>
</trim>
</insert>
<update id="updateCreditCommitmentItem" parameterType="com.credit.cy.business.domain.CreditCommitmentItem">
update credit_commitment_item
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="abbreviation != null and abbreviation != ''">abbreviation = #{abbreviation},</if>
<if test="counterpartType != null and counterpartType != ''">counterpart_type = #{counterpartType},</if>
<if test="type != null and type != ''">type = #{type},</if>
<if test="cause != null and cause != ''">cause = #{cause},</if>
<if test="content != null and content != ''">content = #{content},</if>
<if test="pubType != null and pubType != ''">pub_type = #{pubType},</if>
<if test="duty != null and duty != ''">duty = #{duty},</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="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="applyStatus != null">apply_status = #{applyStatus},</if>
<if test="auditBy != null">audit_by = #{auditBy},</if>
<if test="checkMsg != null">check_msg = #{checkMsg},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCreditCommitmentItemById" parameterType="Long">
delete from credit_commitment_item where id = #{id}
</delete>
<delete id="deleteCreditCommitmentItemByIds" parameterType="String">
delete from credit_commitment_item where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectCommitmentItemByIdList" parameterType="Long" resultMap="CreditCommitmentItemResult">
<include refid="selectSimpleCommitmentItemVo"/>
where id in
<foreach item="id" collection="list" open="(" separator="," close=")">
#{id}
</foreach>
</select>
</mapper>