PointsSetMapper.xml
7.61 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
<?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.PointsSetMapper">
<resultMap id="BaseResultMap" type="cn.runsa.crmapp.points.entity.PointsSet">
<!--
WARNING - @mbggenerated
-->
<id column="PNT_ID" jdbcType="BIGINT" property="pntId" />
<result column="ACT_ID" jdbcType="BIGINT" property="actId" />
<result column="PNT_TYPE" jdbcType="VARCHAR" property="pntType" />
<result column="PNT_SET_NAME" jdbcType="VARCHAR" property="pntSetName" />
<result column="PNT_UNIT" jdbcType="VARCHAR" property="pntUnit" />
<result column="PNT_U_V" jdbcType="DECIMAL" property="pntUV" />
<result column="EXCHANGE" jdbcType="BIT" property="exchange" />
<result column="IS_FANS" jdbcType="BIT" property="isFans" />
<result column="ENABLE" jdbcType="BIT" property="enable" />
<result column="REC_TIME" jdbcType="TIMESTAMP" property="recTime" />
<result column="REC_USER" jdbcType="BIGINT" property="recUser" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
-->
`PNT_ID`, `ACT_ID`, `PNT_TYPE`, `PNT_SET_NAME`, `PNT_UNIT`, `PNT_U_V`, `EXCHANGE`,
`IS_FANS`, `ENABLE`, `REC_TIME`, `REC_USER`
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
-->
select
<include refid="Base_Column_List" />
from crm_points_set
where `PNT_ID` = #{pntId,jdbcType=BIGINT}
</select>
<select id="list" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from crm_points_set
where `ACT_ID` = #{actId,jdbcType=BIGINT}
</select>
<select id="selectCompositePrimaryKey" parameterType="cn.runsa.crmapp.points.entity.PointsSet" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from crm_points_set
where `ACT_ID` = #{actId,jdbcType=BIGINT} and `PNT_TYPE` = #{pntType,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--
WARNING - @mbggenerated
-->
delete from crm_points_set
where `PNT_ID` = #{pntId,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="cn.runsa.crmapp.points.entity.PointsSet">
<!--
WARNING - @mbggenerated
-->
insert into crm_points_set (`PNT_ID`, `ACT_ID`, `PNT_TYPE`,
`PNT_SET_NAME`, `PNT_UNIT`, `PNT_U_V`,
`EXCHANGE`, `IS_FANS`, `ENABLE`, `REC_TIME`,
`REC_USER`)
values (#{pntId,jdbcType=BIGINT}, #{actId,jdbcType=BIGINT}, #{pntType,jdbcType=VARCHAR},
#{pntSetName,jdbcType=VARCHAR}, #{pntUnit,jdbcType=VARCHAR}, #{pntUV,jdbcType=DECIMAL},
#{exchange,jdbcType=BIT}, #{isFans,jdbcType=BIT}, #{enable,jdbcType=BIT}, #{recTime,jdbcType=TIMESTAMP},
#{recUser,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="cn.runsa.crmapp.points.entity.PointsSet">
<!--
WARNING - @mbggenerated
-->
<selectKey keyProperty="pntId" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into crm_points_set
<trim prefix="(" suffix=")" suffixOverrides=",">
`PNT_ID`,
<if test="actId != null">
`ACT_ID`,
</if>
<if test="pntType != null">
`PNT_TYPE`,
</if>
<if test="pntSetName != null">
`PNT_SET_NAME`,
</if>
<if test="pntUnit != null">
`PNT_UNIT`,
</if>
<if test="pntUV != null">
`PNT_U_V`,
</if>
<if test="exchange != null">
`EXCHANGE`,
</if>
<if test="isFans != null">
`IS_FANS`,
</if>
<if test="enable != null">
`ENABLE`,
</if>
<if test="recTime != null">
`REC_TIME`,
</if>
<if test="recUser != null">
`REC_USER`,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{pntId,jdbcType=BIGINT},
<if test="actId != null">
#{actId,jdbcType=BIGINT},
</if>
<if test="pntType != null">
#{pntType,jdbcType=VARCHAR},
</if>
<if test="pntSetName != null">
#{pntSetName,jdbcType=VARCHAR},
</if>
<if test="pntUnit != null">
#{pntUnit,jdbcType=VARCHAR},
</if>
<if test="pntUV != null">
#{pntUV,jdbcType=DECIMAL},
</if>
<if test="exchange != null">
#{exchange,jdbcType=BIT},
</if>
<if test="isFans != null">
#{isFans,jdbcType=BIT},
</if>
<if test="enable != null">
#{enable,jdbcType=BIT},
</if>
<if test="recTime != null">
#{recTime,jdbcType=TIMESTAMP},
</if>
<if test="recUser != null">
#{recUser,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="cn.runsa.crmapp.points.entity.PointsSet">
<!--
WARNING - @mbggenerated
-->
update crm_points_set
<set>
<if test="actId != null">
`ACT_ID` = #{actId,jdbcType=BIGINT},
</if>
<if test="pntType != null">
`PNT_TYPE` = #{pntType,jdbcType=VARCHAR},
</if>
<if test="pntSetName != null">
`PNT_SET_NAME` = #{pntSetName,jdbcType=VARCHAR},
</if>
<if test="pntUnit != null">
`PNT_UNIT` = #{pntUnit,jdbcType=VARCHAR},
</if>
<if test="pntUV != null">
`PNT_U_V` = #{pntUV,jdbcType=DECIMAL},
</if>
<if test="exchange != null">
`EXCHANGE` = #{exchange,jdbcType=BIT},
</if>
<if test="isFans != null">
`IS_FANS` = #{isFans,jdbcType=BIT},
</if>
<if test="enable != null">
`ENABLE` = #{enable,jdbcType=BIT},
</if>
<if test="recTime != null">
`REC_TIME` = #{recTime,jdbcType=TIMESTAMP},
</if>
<if test="recUser != null">
`REC_USER` = #{recUser,jdbcType=BIGINT},
</if>
</set>
where `PNT_ID` = #{pntId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="cn.runsa.crmapp.points.entity.PointsSet">
<!--
WARNING - @mbggenerated
-->
update crm_points_set
set `ACT_ID` = #{actId,jdbcType=BIGINT},
`PNT_TYPE` = #{pntType,jdbcType=VARCHAR},
`PNT_SET_NAME` = #{pntSetName,jdbcType=VARCHAR},
`PNT_UNIT` = #{pntUnit,jdbcType=VARCHAR},
`PNT_U_V` = #{pntUV,jdbcType=DECIMAL},
`EXCHANGE` = #{exchange,jdbcType=BIT},
`IS_FANS` = #{isFans,jdbcType=BIT},
`ENABLE` = #{enable,jdbcType=BIT},
`REC_TIME` = #{recTime,jdbcType=TIMESTAMP},
`REC_USER` = #{recUser,jdbcType=BIGINT}
where `PNT_ID` = #{pntId,jdbcType=BIGINT}
</update>
<select id="existsPntId" parameterType="Long" resultType="Integer">
SELECT
COUNT(*)
FROM
`crm_points_change`
WHERE
PNT_ID = #{pntId,jdbcType=BIGINT}
</select>
<select id="findPointsSetAll" parameterType="java.lang.Integer" resultMap="BaseResultMap">
SELECT T1.* FROM CRM_POINTS_SET T1, CRM_ACCOUNT_SET T2 WHERE T1.ACT_ID = T2.ACT_ID AND T1.ENABLE = 1 AND T2.ACT_TYPE > 0 <if test="plId!=1">AND T2.PTF_ID = #{plId,jdbcType=BIGINT}</if>
</select>
<select id="selectByActIdAndPntType" parameterType="cn.runsa.crmapp.points.entity.PointsSet" resultMap="BaseResultMap">
select * from crm_points_set where act_id = #{actId,jdbcType=BIGINT} and pnt_type = #{pntType,jdbcType=VARCHAR}
</select>
<select id="existsPntAccount" parameterType="cn.runsa.crmapp.points.entity.PointsSet" resultType="Integer">
select count(*) from crm_points_account where ACT_ID = #{actId,jdbcType=BIGINT} and PNT_TYPE = #{pntType,jdbcType=VARCHAR};
</select>
</mapper>