PointAdjustItemMapper.xml
7.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
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
<?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="cn.runsa.crmapp.points.mapper.PointAdjustItemMapper">
<resultMap id="BaseResultMap" type="cn.runsa.crmapp.points.entity.PointAdjustItem">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="ID" jdbcType="BIGINT" property="id" />
<result column="ADJ_ID" jdbcType="VARCHAR" property="adjId" />
<result column="CST_ID" jdbcType="BIGINT" property="cstId" />
<result column="POINTS" jdbcType="DOUBLE" property="points" />
<result column="ORDER_ID" jdbcType="VARCHAR" property="orderId" />
<result column="ORDER_SRC" jdbcType="VARCHAR" property="orderSrc" />
<result column="S_TIME" jdbcType="TIMESTAMP" property="sTime" />
<result column="E_TIME" jdbcType="TIMESTAMP" property="eTime" />
<result column="STATUS" jdbcType="TINYINT" property="status" />
<result column="RESULT_MEMO" jdbcType="VARCHAR" property="resultMemo" />
<result column="REMARK" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
`ID`, `ADJ_ID`, `CST_ID`, `POINTS`, `ORDER_ID`, `ORDER_SRC`, `S_TIME`, `E_TIME`,
`STATUS`, `RESULT_MEMO`, `REMARK`
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from crm_point_adjust_detail
where `ID` = #{id,jdbcType=BIGINT}
</select>
<select id="findByAdjId" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
FROM
crm_point_adjust_detail
WHERE
ADJ_ID = #{adjId,jdbcType=VARCHAR}
</select>
<select id="existCustId" parameterType="cn.runsa.crmapp.points.entity.PointAdjustItem" resultType="java.lang.Integer">
select
COUNT(*)
FROM
crm_point_adjust_detail
WHERE
ADJ_ID = #{adjId,jdbcType=VARCHAR} AND CST_ID = #{cstId,jdbcType=BIGINT}
</select>
<select id="validatedPoint" parameterType="cn.runsa.crmapp.points.entity.PointAdjustItem" resultType="java.lang.Double">
SELECT t1.PNT_VAL FROM `crm_points_account` t1 WHERE t1.CST_ID = #{cstId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from crm_point_adjust_detail
where `ID` = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByAdjId" parameterType="java.lang.String">
delete from crm_point_adjust_detail
where `ADJ_ID` = #{adjId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="cn.runsa.crmapp.points.entity.PointAdjustItem">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into crm_point_adjust_detail (`ADJ_ID`, `CST_ID`, `POINTS`,
`ORDER_ID`, `ORDER_SRC`, `S_TIME`,
`E_TIME`, `STATUS`, `RESULT_MEMO`,
`REMARK`)
values (#{adjId,jdbcType=VARCHAR}, #{cstId,jdbcType=BIGINT}, #{points,jdbcType=DOUBLE},
#{orderId,jdbcType=VARCHAR}, #{orderSrc,jdbcType=VARCHAR}, SYSDATE(),
#{eTime,jdbcType=TIMESTAMP}, 0, #{resultMemo,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="cn.runsa.crmapp.points.entity.PointAdjustItem">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into crm_point_adjust_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="adjId != null">
`ADJ_ID`,
</if>
<if test="cstId != null">
`CST_ID`,
</if>
<if test="points != null">
`POINTS`,
</if>
<if test="orderId != null">
`ORDER_ID`,
</if>
<if test="orderSrc != null">
`ORDER_SRC`,
</if>
<if test="sTime != null">
`S_TIME`,
</if>
<if test="eTime != null">
`E_TIME`,
</if>
<if test="status != null">
`STATUS`,
</if>
<if test="resultMemo != null">
`RESULT_MEMO`,
</if>
<if test="remark != null">
`REMARK`,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="adjId != null">
#{adjId,jdbcType=VARCHAR},
</if>
<if test="cstId != null">
#{cstId,jdbcType=BIGINT},
</if>
<if test="points != null">
#{points,jdbcType=DOUBLE},
</if>
<if test="orderId != null">
#{orderId,jdbcType=VARCHAR},
</if>
<if test="orderSrc != null">
#{orderSrc,jdbcType=VARCHAR},
</if>
<if test="sTime != null">
#{sTime,jdbcType=TIMESTAMP},
</if>
<if test="eTime != null">
#{eTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
</if>
<if test="resultMemo != null">
#{resultMemo,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="cn.runsa.crmapp.points.entity.PointAdjustItem">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update crm_point_adjust_detail
<set>
<if test="adjId != null">
`ADJ_ID` = #{adjId,jdbcType=VARCHAR},
</if>
<if test="cstId != null">
`CST_ID` = #{cstId,jdbcType=BIGINT},
</if>
<if test="points != null">
`POINTS` = #{points,jdbcType=DOUBLE},
</if>
<if test="orderId != null">
`ORDER_ID` = #{orderId,jdbcType=VARCHAR},
</if>
<if test="orderSrc != null">
`ORDER_SRC` = #{orderSrc,jdbcType=VARCHAR},
</if>
<if test="sTime != null">
`S_TIME` = #{sTime,jdbcType=TIMESTAMP},
</if>
<if test="eTime != null">
`E_TIME` = #{eTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
`STATUS` = #{status,jdbcType=TINYINT},
</if>
<if test="resultMemo != null">
`RESULT_MEMO` = #{resultMemo,jdbcType=VARCHAR},
</if>
<if test="remark != null">
`REMARK` = #{remark,jdbcType=VARCHAR},
</if>
</set>
where `ID` = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="cn.runsa.crmapp.points.entity.PointAdjustItem">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update crm_point_adjust_detail
set `ADJ_ID` = #{adjId,jdbcType=VARCHAR},
`CST_ID` = #{cstId,jdbcType=BIGINT},
`POINTS` = #{points,jdbcType=DOUBLE},
`ORDER_ID` = #{orderId,jdbcType=VARCHAR},
`ORDER_SRC` = #{orderSrc,jdbcType=VARCHAR},
`S_TIME` = #{sTime,jdbcType=TIMESTAMP},
`E_TIME` = #{eTime,jdbcType=TIMESTAMP},
`STATUS` = #{status,jdbcType=TINYINT},
`RESULT_MEMO` = #{resultMemo,jdbcType=VARCHAR},
`REMARK` = #{remark,jdbcType=VARCHAR}
where `ID` = #{id,jdbcType=BIGINT}
</update>
</mapper>