MktMarketingUrlMapper.xml
7.42 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
<?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.yoho.unions.dal.IMktMarketingUrlDAO" >
<resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.MktMarketingUrl" >
<id column="union_type" property="unionType" jdbcType="BIGINT" />
<result column="division_code" property="divisionCode" jdbcType="INTEGER" />
<result column="class_code" property="classCode" jdbcType="INTEGER" />
<result column="channel_code" property="channelCode" jdbcType="INTEGER" />
<result column="device_code" property="deviceCode" jdbcType="INTEGER" />
<result column="dept_id" property="deptId" jdbcType="VARCHAR" />
<result column="create_id" property="createId" jdbcType="VARCHAR" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="src_url" property="srcUrl" jdbcType="VARCHAR" />
<result column="dest_url" property="destUrl" jdbcType="VARCHAR" />
<result column="status" property="status" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="mkt_activity_code" property="mktActivityCode" jdbcType="VARCHAR" />
<result column="landing_page_url" property="landingPageUrl" jdbcType="VARCHAR" />
<result column="channel_type" property="channelType" jdbcType="INTEGER" />
<result column="realtime_show" property="realtimeShow" jdbcType="INTEGER" />
<result column="pay_channel" property="payChannel" jdbcType="INTEGER" />
<result column="marketing_url_type" property="marketingUrlType" jdbcType="INTEGER" />
<result column="business_code" property="businessCode" jdbcType="INTEGER" />
<result column="mkt_desc" property="mktDesc" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
union_type, division_code, class_code, channel_code, device_code, dept_id, create_id, mkt_desc,
name, src_url, dest_url, status, create_time,mkt_activity_code,landing_page_url,channel_type,realtime_show,pay_channel,marketing_url_type,business_code
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
<include refid="Base_Column_List" />
from mkt_marketing_url
where union_type = #{unionType,jdbcType=BIGINT}
</select>
<select id="selectByName" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from mkt_marketing_url
where name = #{name} limit 1
</select>
<select id="selectByNameAndUnionType" resultType="java.lang.Integer" >
select count(1) from mkt_marketing_url
where name = #{name} and union_type = #{unionType,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
delete from mkt_marketing_url
where union_type = #{unionType,jdbcType=BIGINT}
</delete>
<select id="selectUnionTypes" resultType="long">
select union_type from mkt_marketing_url where
1=1
<if test="unionType!=null">
and union_type=#{unionType}
</if>
<if test="name!=null">
and name=#{name}
</if>
<if test="channelType!=null">
and channel_type=#{channelType}
</if>
</select>
<select id="selectUnionTypeByNameAndUnionType" resultType="java.lang.Long">
select union_type from mkt_marketing_url where 1=1
<if test="unionType!=null">
and union_type=#{unionType}
</if>
<if test="name!=null">
and name=#{name}
</if>
limit 1
</select>
<select id="selectByUnionTypes" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List" />
from mkt_marketing_url
where union_type in
<foreach collection="list" open="(" close=")" item="unionType" separator=",">
#{unionType}
</foreach>
</select>
<insert id="insertSelective" useGeneratedKeys="true" keyProperty="unionType" parameterType="com.yoho.unions.dal.model.MktMarketingUrl" >
insert into mkt_marketing_url
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="unionType != null" >
union_type,
</if>
<if test="divisionCode != null" >
division_code,
</if>
<if test="businessCode != null" >
business_code,
</if>
<if test="classCode != null" >
class_code,
</if>
<if test="channelCode != null" >
channel_code,
</if>
<if test="deptId != null" >
dept_id,
</if>
<if test="createId != null" >
create_id,
</if>
<if test="name != null" >
name,
</if>
<if test="srcUrl != null" >
src_url,
</if>
<if test="destUrl != null" >
dest_url,
</if>
<if test="status != null" >
status,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="mktDesc != null" >
mkt_desc,
</if>
<if test="mktActivityCode != null" >
mkt_activity_code,
</if>
<if test="marketingUrlType != null" >
marketing_url_type,
</if>
<if test="landingPageTypeCode != null" >
landing_page_type_code,
</if>
<if test="landingPageUrl != null" >
landing_page_url,
</if>
<if test="channelType != null" >
channel_type,
</if>
<if test="realtimeShow != null" >
realtime_show,
</if>
<if test="payChannel != null" >
pay_channel,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="unionType != null" >
#{unionType,jdbcType=BIGINT},
</if>
<if test="divisionCode != null" >
#{divisionCode,jdbcType=INTEGER},
</if>
<if test="businessCode != null" >
#{businessCode,jdbcType=INTEGER},
</if>
<if test="classCode != null" >
#{classCode,jdbcType=INTEGER},
</if>
<if test="channelCode != null" >
#{channelCode,jdbcType=INTEGER},
</if>
<if test="deptId != null" >
#{deptId,jdbcType=VARCHAR},
</if>
<if test="createId != null" >
#{createId,jdbcType=VARCHAR},
</if>
<if test="name != null" >
#{name,jdbcType=VARCHAR},
</if>
<if test="srcUrl != null" >
#{srcUrl,jdbcType=VARCHAR},
</if>
<if test="destUrl != null" >
#{destUrl,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=INTEGER},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=INTEGER},
</if>
<if test="mktDesc != null" >
#{mktDesc,jdbcType=VARCHAR},
</if>
<if test="mktActivityCode != null" >
#{mktActivityCode,jdbcType=VARCHAR},
</if>
<if test="marketingUrlType != null" >
#{marketingUrlType,jdbcType=INTEGER},
</if>
<if test="landingPageTypeCode != null" >
#{landingPageTypeCode,jdbcType=INTEGER},
</if>
<if test="landingPageUrl != null" >
#{landingPageUrl,jdbcType=VARCHAR},
</if>
<if test="channelType != null" >
#{channelType,jdbcType=INTEGER},
</if>
<if test="realtimeShow != null" >
#{realtimeShow,jdbcType=INTEGER},
</if>
<if test="payChannel != null" >
#{payChannel,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="selectMaxPersonalUnionType" resultType="java.lang.Long">
select max(union_type) from mkt_marketing_url where channel_type=1
</select>
</mapper>