FundDetailMapper.xml
8.23 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
<?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.chinagas.modules.zjwjsb.mapper.FundDetailMapper">
<resultMap id="fundDetailResult" type="FundDetail">
<id property="id" column="id"/>
<result property="mainId" column="main_id"/>
<result property="bizId" column="biz_id"/>
<result property="payNo" column="pay_no"/>
<result property="title" column="title"/>
<result property="approval" column="approval"/>
<result property="hasPay" column="has_pay"/>
<result property="waitForPay" column="wait_for_pay"/>
<result property="approvalForPay" column="approval_for_pay"/>
<result property="itemClass" column="item_class"/>
<result property="itemClassName" column="item_class_name"/>
<result property="applyDate" column="apply_date"/>
<result property="status" column="status"/>
<result property="statusName" column="status_name"/>
<result property="delFlag" column="del_flag"/>
<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="selectFundDetailVo" >
select
d.id,
d.main_id,
d.biz_id,
d.pay_no,
d.title,
d.approval,
d.has_pay,
d.wait_for_pay,
d.approval_for_pay,
d.item_class,
d.item_class_name,
d.apply_date,
d.status,
d.status_name,
d.del_flag,
d.create_time,
d.create_by,
d.update_time,
d.update_by
from ta_fund_detail d
</sql>
<select id="selectFundDetailById" parameterType="Long" resultMap="fundDetailResult">
<include refid="selectFundDetailVo"/> where d.id = #{id}
</select>
<insert id="insertFundDetail" parameterType="FundDetail">
insert into ta_fund_detail(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id,</if>
<if test="mainId != null and mainId != ''">main_id,</if>
<if test="bizId != null and bizId!= ''">biz_id,</if>
<if test="payNo != null and payNo != ''">pay_no, </if>
<if test="title != null and title != ''">title, </if>
<if test="approval != null">approval, </if>
<if test="hasPay != null">has_pay, </if>
<if test="waitForPay != null">wait_for_pay,</if>
<if test="approvalForPay != null">approval_for_pay,</if>
<if test="itemClass != null">item_class,</if>
<if test="itemClassName != null and itemClassName != ''">item_class_name,</if>
<if test="applyDate != null">apply_date, </if>
<if test="status != null">status, </if>
<if test="statusName != null and statusName != ''">status_name, </if>
<if test="delFlag != null">del_flag, </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>
create_time
</trim>
) values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if>
<if test="mainId != null and mainId != ''">#{mainId},</if>
<if test="bizId != null and bizId!= ''">#{bizId},</if>
<if test="payNo != null and payNo != ''">#{payNo}, </if>
<if test="title != null and title != ''">#{title}, </if>
<if test="approval != null">#{approval}, </if>
<if test="hasPay != null">#{hasPay}, </if>
<if test="waitForPay != null">#{waitForPay},</if>
<if test="approvalForPay != null">#{approvalForPay},</if>
<if test="itemClass != null">#{itemClass},</if>
<if test="itemClassName != null and itemClassName != ''">#{itemClassName},</if>
<if test="applyDate != null">#{applyDate, jdbcType=TIMESTAMP}, </if>
<if test="status != null">#{status}, </if>
<if test="statusName != null and statusName != ''">#{statusName}, </if>
<if test="delFlag != null">#{delFlag}, </if>
<if test="createBy != null and createBy != ''">#{createBy}, </if>
<if test="updateTime != null">#{updateTime, jdbcType=TIMESTAMP}, </if>
<if test="updateBy != null and updateBy != ''">#{updateBy}, </if>
sysdate()
</trim>
)
</insert>
<update id="updateFundDetail" parameterType="FundDetail">
update ta_fund_detail
<trim prefix="SET" suffixOverrides=",">
<if test="mainId != null and mainId != ''">main_id = #{mainId},</if>
<if test="bizId != null and bizId != ''">biz_id = #{bizId},</if>
<if test="payNo != null and payNo != ''">pay_no = #{payNo},</if>
<if test="title != null and title != ''">title = #{title},</if>
<if test="approval != null">approval = #{approval},</if>
<if test="hasPay != null">has_pay = #{hasPay},</if>
<if test="waitForPay != null">wait_for_pay = #{waitForPay},</if>
<if test="approvalForPay != null">approval_for_pay = #{approvalForPay},</if>
<if test="itemClass != null">item_class = #{itemClass},</if>
<if test="itemClassName != null and itemClassName != ''">item_class_name = #{itemClassName},</if>
<if test="applyDate != null">apply_date = #{applyDate, jdbcType=TIMESTAMP},</if>
<if test="status != null">status = #{status},</if>
<if test="statusName != null and statusName != ''">status_name = #{statusName},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createTime != null">create_time = #{createTime, jdbcType=TIMESTAMP},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</trim>
where id = #{id}
</update>
<update id="updateFundDetailByBizId" parameterType="FundDetail">
update ta_fund_detail
<trim prefix="SET" suffixOverrides=",">
<if test="mainId != null and mainId != ''">main_id = #{mainId},</if>
<if test="payNo != null and payNo != ''">pay_no = #{payNo},</if>
<if test="title != null and title != ''">title = #{title},</if>
<if test="approval != null">approval = #{approval},</if>
<if test="hasPay != null">has_pay = #{hasPay},</if>
<if test="waitForPay != null">wait_for_pay = #{waitForPay},</if>
<if test="approvalForPay != null">approval_for_pay = #{approvalForPay},</if>
<if test="itemClass != null">item_class = #{itemClass},</if>
<if test="itemClassName != null and itemClassName != ''">item_class_name = #{itemClassName},</if>
<if test="applyDate != null">apply_date = #{applyDate, jdbcType=TIMESTAMP},</if>
<if test="status != null">status = #{status},</if>
<if test="statusName != null and statusName != ''">status_name = #{statusName},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createTime != null">create_time = #{createTime, jdbcType=TIMESTAMP},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</trim>
where biz_id = #{bizId}
</update>
<update id="deleteFundDetailById" parameterType="Long">
update ta_fund_detail set del_flag = '1' where id = #{id}
</update>
<delete id="deleteFundDetailByMainId" parameterType="String">
delete from ta_fund_detail where main_id = #{mainId}
</delete>
</mapper>