admin
2019-11-23 51a4ff5d777028d52a19c314a99f796334cb7b51
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
<?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.yeshi.fanli.dao.mybatis.taobao.TaoBaoCouponMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.taobao.TaoBaoCoupon">
    <id column="id" property="id" jdbcType="BIGINT"/>
    <result column="auctionId" property="auctionId" jdbcType="VARCHAR"/>
    <result column="title" property="title" jdbcType="VARCHAR"/>
    <result column="pictUrl" property="pictUrl" jdbcType="VARCHAR"/>
    <result column="auctionUrl" property="auctionUrl" jdbcType="VARCHAR"/>
    <result column="classNames" property="classNames" jdbcType="VARCHAR"/>
    <result column="taobaokeUrl" property="taobaokeUrl" jdbcType="VARCHAR"/>
    <result column="zkPrice" property="zkPrice" jdbcType="DECIMAL"/>
    <result column="biz30day" property="biz30day" jdbcType="INTEGER"/>
    <result column="tkRate" property="tkRate" jdbcType="VARCHAR"/>
    <result column="brokerage" property="brokerage" jdbcType="DECIMAL"/>
    <result column="shopWangWang" property="shopWangWang" jdbcType="VARCHAR"/>
    <result column="sellerId" property="sellerId" jdbcType="BIGINT"/>
    <result column="shopTitle" property="shopTitle" jdbcType="VARCHAR"/>
    <result column="shopType" property="shopType" jdbcType="INTEGER"/>
    <result column="couponId" property="couponId" jdbcType="VARCHAR"/>
    <result column="couponSum" property="couponSum" jdbcType="INTEGER"/>
    <result column="couponCount" property="couponCount" jdbcType="INTEGER"/>
    <result column="couponinfo" property="couponinfo" jdbcType="VARCHAR"/>
    <result column="couponStartFee" property="couponStartFee" jdbcType="DECIMAL"/>
    <result column="couponAmount" property="couponAmount" jdbcType="DECIMAL"/>
    <result column="quanPrice" property="quanPrice" jdbcType="DECIMAL"/>
    <result column="couponBegin" property="couponBegin" jdbcType="VARCHAR"/>
    <result column="couponEnd" property="couponEnd" jdbcType="VARCHAR"/>
    <result column="couponLink" property="couponLink" jdbcType="VARCHAR"/>
    <result column="generalizeUrl" property="generalizeUrl" jdbcType="VARCHAR"/>
    <result column="orderby" property="orderby" jdbcType="INTEGER"/>
    <result column="createtime" property="createtime" jdbcType="BIGINT"/>
    <result column="showType" property="showType" jdbcType="INTEGER"/>
  </resultMap>
  <sql id="Base_Column_List">id,auctionId,title,pictUrl,auctionUrl,classNames,taobaokeUrl,zkPrice,biz30day,tkRate,brokerage,shopWangWang,sellerId,shopTitle,shopType,couponId,couponSum,couponCount,couponinfo,couponStartFee,couponAmount,quanPrice,couponBegin,couponEnd,couponLink,generalizeUrl,orderby,createtime,showType</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_taobao_coupon where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_taobao_coupon where id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoCoupon" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_coupon (id,auctionId,title,pictUrl,auctionUrl,classNames,taobaokeUrl,zkPrice,biz30day,tkRate,brokerage,shopWangWang,sellerId,shopTitle,shopType,couponId,couponSum,couponCount,couponinfo,couponStartFee,couponAmount,quanPrice,couponBegin,couponEnd,couponLink,generalizeUrl,orderby,createtime,showType) values (#{id,jdbcType=BIGINT},#{auctionId,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{pictUrl,jdbcType=VARCHAR},#{auctionUrl,jdbcType=VARCHAR},#{classNames,jdbcType=VARCHAR},#{taobaokeUrl,jdbcType=VARCHAR},#{zkPrice,jdbcType=DECIMAL},#{biz30day,jdbcType=INTEGER},#{tkRate,jdbcType=VARCHAR},#{brokerage,jdbcType=DECIMAL},#{shopWangWang,jdbcType=VARCHAR},#{sellerId,jdbcType=BIGINT},#{shopTitle,jdbcType=VARCHAR},#{shopType,jdbcType=INTEGER},#{couponId,jdbcType=VARCHAR},#{couponSum,jdbcType=INTEGER},#{couponCount,jdbcType=INTEGER},#{couponinfo,jdbcType=VARCHAR},#{couponStartFee,jdbcType=DECIMAL},#{couponAmount,jdbcType=DECIMAL},#{quanPrice,jdbcType=DECIMAL},#{couponBegin,jdbcType=VARCHAR},#{couponEnd,jdbcType=VARCHAR},#{couponLink,jdbcType=VARCHAR},#{generalizeUrl,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{createtime,jdbcType=BIGINT},#{showType,jdbcType=INTEGER})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoCoupon" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_coupon
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">id,</if>
      <if test="auctionId != null">auctionId,</if>
      <if test="title != null">title,</if>
      <if test="pictUrl != null">pictUrl,</if>
      <if test="auctionUrl != null">auctionUrl,</if>
      <if test="classNames != null">classNames,</if>
      <if test="taobaokeUrl != null">taobaokeUrl,</if>
      <if test="zkPrice != null">zkPrice,</if>
      <if test="biz30day != null">biz30day,</if>
      <if test="tkRate != null">tkRate,</if>
      <if test="brokerage != null">brokerage,</if>
      <if test="shopWangWang != null">shopWangWang,</if>
      <if test="sellerId != null">sellerId,</if>
      <if test="shopTitle != null">shopTitle,</if>
      <if test="shopType != null">shopType,</if>
      <if test="couponId != null">couponId,</if>
      <if test="couponSum != null">couponSum,</if>
      <if test="couponCount != null">couponCount,</if>
      <if test="couponinfo != null">couponinfo,</if>
      <if test="couponStartFee != null">couponStartFee,</if>
      <if test="couponAmount != null">couponAmount,</if>
      <if test="quanPrice != null">quanPrice,</if>
      <if test="couponBegin != null">couponBegin,</if>
      <if test="couponEnd != null">couponEnd,</if>
      <if test="couponLink != null">couponLink,</if>
      <if test="generalizeUrl != null">generalizeUrl,</if>
      <if test="orderby != null">orderby,</if>
      <if test="createtime != null">createtime,</if>
      <if test="showType != null">showType,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="auctionId != null">#{auctionId,jdbcType=VARCHAR},</if>
      <if test="title != null">#{title,jdbcType=VARCHAR},</if>
      <if test="pictUrl != null">#{pictUrl,jdbcType=VARCHAR},</if>
      <if test="auctionUrl != null">#{auctionUrl,jdbcType=VARCHAR},</if>
      <if test="classNames != null">#{classNames,jdbcType=VARCHAR},</if>
      <if test="taobaokeUrl != null">#{taobaokeUrl,jdbcType=VARCHAR},</if>
      <if test="zkPrice != null">#{zkPrice,jdbcType=DECIMAL},</if>
      <if test="biz30day != null">#{biz30day,jdbcType=INTEGER},</if>
      <if test="tkRate != null">#{tkRate,jdbcType=VARCHAR},</if>
      <if test="brokerage != null">#{brokerage,jdbcType=DECIMAL},</if>
      <if test="shopWangWang != null">#{shopWangWang,jdbcType=VARCHAR},</if>
      <if test="sellerId != null">#{sellerId,jdbcType=BIGINT},</if>
      <if test="shopTitle != null">#{shopTitle,jdbcType=VARCHAR},</if>
      <if test="shopType != null">#{shopType,jdbcType=INTEGER},</if>
      <if test="couponId != null">#{couponId,jdbcType=VARCHAR},</if>
      <if test="couponSum != null">#{couponSum,jdbcType=INTEGER},</if>
      <if test="couponCount != null">#{couponCount,jdbcType=INTEGER},</if>
      <if test="couponinfo != null">#{couponinfo,jdbcType=VARCHAR},</if>
      <if test="couponStartFee != null">#{couponStartFee,jdbcType=DECIMAL},</if>
      <if test="couponAmount != null">#{couponAmount,jdbcType=DECIMAL},</if>
      <if test="quanPrice != null">#{quanPrice,jdbcType=DECIMAL},</if>
      <if test="couponBegin != null">#{couponBegin,jdbcType=VARCHAR},</if>
      <if test="couponEnd != null">#{couponEnd,jdbcType=VARCHAR},</if>
      <if test="couponLink != null">#{couponLink,jdbcType=VARCHAR},</if>
      <if test="generalizeUrl != null">#{generalizeUrl,jdbcType=VARCHAR},</if>
      <if test="orderby != null">#{orderby,jdbcType=INTEGER},</if>
      <if test="createtime != null">#{createtime,jdbcType=BIGINT},</if>
      <if test="showType != null">#{showType,jdbcType=INTEGER},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoCoupon">update yeshi_ec_taobao_coupon set auctionId = #{auctionId,jdbcType=VARCHAR},title = #{title,jdbcType=VARCHAR},pictUrl = #{pictUrl,jdbcType=VARCHAR},auctionUrl = #{auctionUrl,jdbcType=VARCHAR},classNames = #{classNames,jdbcType=VARCHAR},taobaokeUrl = #{taobaokeUrl,jdbcType=VARCHAR},zkPrice = #{zkPrice,jdbcType=DECIMAL},biz30day = #{biz30day,jdbcType=INTEGER},tkRate = #{tkRate,jdbcType=VARCHAR},brokerage = #{brokerage,jdbcType=DECIMAL},shopWangWang = #{shopWangWang,jdbcType=VARCHAR},sellerId = #{sellerId,jdbcType=BIGINT},shopTitle = #{shopTitle,jdbcType=VARCHAR},shopType = #{shopType,jdbcType=INTEGER},couponId = #{couponId,jdbcType=VARCHAR},couponSum = #{couponSum,jdbcType=INTEGER},couponCount = #{couponCount,jdbcType=INTEGER},couponinfo = #{couponinfo,jdbcType=VARCHAR},couponStartFee = #{couponStartFee,jdbcType=DECIMAL},couponAmount = #{couponAmount,jdbcType=DECIMAL},quanPrice = #{quanPrice,jdbcType=DECIMAL},couponBegin = #{couponBegin,jdbcType=VARCHAR},couponEnd = #{couponEnd,jdbcType=VARCHAR},couponLink = #{couponLink,jdbcType=VARCHAR},generalizeUrl = #{generalizeUrl,jdbcType=VARCHAR},orderby = #{orderby,jdbcType=INTEGER},createtime = #{createtime,jdbcType=BIGINT},showType = #{showType,jdbcType=INTEGER} where id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoCoupon">update yeshi_ec_taobao_coupon
    <set>
      <if test="auctionId != null">auctionId=#{auctionId,jdbcType=VARCHAR},</if>
      <if test="title != null">title=#{title,jdbcType=VARCHAR},</if>
      <if test="pictUrl != null">pictUrl=#{pictUrl,jdbcType=VARCHAR},</if>
      <if test="auctionUrl != null">auctionUrl=#{auctionUrl,jdbcType=VARCHAR},</if>
      <if test="classNames != null">classNames=#{classNames,jdbcType=VARCHAR},</if>
      <if test="taobaokeUrl != null">taobaokeUrl=#{taobaokeUrl,jdbcType=VARCHAR},</if>
      <if test="zkPrice != null">zkPrice=#{zkPrice,jdbcType=DECIMAL},</if>
      <if test="biz30day != null">biz30day=#{biz30day,jdbcType=INTEGER},</if>
      <if test="tkRate != null">tkRate=#{tkRate,jdbcType=VARCHAR},</if>
      <if test="brokerage != null">brokerage=#{brokerage,jdbcType=DECIMAL},</if>
      <if test="shopWangWang != null">shopWangWang=#{shopWangWang,jdbcType=VARCHAR},</if>
      <if test="sellerId != null">sellerId=#{sellerId,jdbcType=BIGINT},</if>
      <if test="shopTitle != null">shopTitle=#{shopTitle,jdbcType=VARCHAR},</if>
      <if test="shopType != null">shopType=#{shopType,jdbcType=INTEGER},</if>
      <if test="couponId != null">couponId=#{couponId,jdbcType=VARCHAR},</if>
      <if test="couponSum != null">couponSum=#{couponSum,jdbcType=INTEGER},</if>
      <if test="couponCount != null">couponCount=#{couponCount,jdbcType=INTEGER},</if>
      <if test="couponinfo != null">couponinfo=#{couponinfo,jdbcType=VARCHAR},</if>
      <if test="couponStartFee != null">couponStartFee=#{couponStartFee,jdbcType=DECIMAL},</if>
      <if test="couponAmount != null">couponAmount=#{couponAmount,jdbcType=DECIMAL},</if>
      <if test="quanPrice != null">quanPrice=#{quanPrice,jdbcType=DECIMAL},</if>
      <if test="couponBegin != null">couponBegin=#{couponBegin,jdbcType=VARCHAR},</if>
      <if test="couponEnd != null">couponEnd=#{couponEnd,jdbcType=VARCHAR},</if>
      <if test="couponLink != null">couponLink=#{couponLink,jdbcType=VARCHAR},</if>
      <if test="generalizeUrl != null">generalizeUrl=#{generalizeUrl,jdbcType=VARCHAR},</if>
      <if test="orderby != null">orderby=#{orderby,jdbcType=INTEGER},</if>
      <if test="createtime != null">createtime=#{createtime,jdbcType=BIGINT},</if>
      <if test="showType != null">showType=#{showType,jdbcType=INTEGER},</if>
    </set> where id = #{id,jdbcType=BIGINT}
  </update>
  
  <delete id="deleteBeforeCouponInfo">
          delete from yeshi_ec_taobao_coupon where id <![CDATA[<]]> #{id,jdbcType=BIGINT}
  </delete>
  
  <select id="getTaoBaoCouponList" resultMap="BaseResultMap">
      select * from yeshi_ec_taobao_coupon tbc 
      where tbc.title like '%#{key}%' 
      order by tbc.orderby,tbc.id
      LIMIT ${start},${count}
  </select>
  
  <select id="getCount" resultType="java.lang.Integer">
      select count(*) from yeshi_ec_taobao_coupon tbc 
          <if test="key != null and key !='' ">
              where  tbc.title like '%#{key}%' 
          </if>
  </select>
  
  <select id="getTaoBaoCouponListBykeys" resultMap="BaseResultMap">
      select * from yeshi_ec_taobao_coupon tbc 
      where  tbc.showType = 3  
      <if test="list != null">
          AND 
          <foreach collection="list" index="index" item="item" open="("
                separator="or" close=")">
                  tbc.title LIKE '%${item}%'
          </foreach>
     </if>
      LIMIT ${start},${count}
  </select>
  
  <select id="countTaoBaoCouponListBykeys" resultType="java.lang.Integer">
      select count(tbc.id) from yeshi_ec_taobao_coupon tbc 
      where tbc.showType = 3   
          <if test="list != null">
              AND
              <foreach collection="list" index="index" item="item" open="("
                    separator="or" close=")">
                      tbc.title LIKE '%${item}%'
              </foreach>
          </if>
  </select>
  
  <select id="getTaoBaoCouponByActionId" resultMap="BaseResultMap">
      select * from yeshi_ec_taobao_coupon tbc 
      where tbc.auctionId = #{auctionId}
      LIMIT 1
  </select>
</mapper>