admin
2020-04-13 dd5b15229cb15459fa7c31ccea77dac28cbfafbd
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
<?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.activity.RecommendActivityTaoBaoGoodsMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.bus.activity.RecommendActivityTaoBaoGoods">
        <id column="agt_id" property="id" jdbcType="BIGINT" />
        <result column="agt_orderby" property="orderBy" jdbcType="INTEGER" />
        <result column="agt_picture" property="pictUrl" jdbcType="VARCHAR" />
        <result column="agt_desc" property="desc" jdbcType="VARCHAR" />
        <result column="agt_auctionid" property="auctionId" jdbcType="VARCHAR" />
        <result column="agt_createtime" property="createTime" jdbcType="TIMESTAMP" />
        <result column="agt_state" property="state" jdbcType="INTEGER" />
        <result column="agt_title" property="title" jdbcType="VARCHAR" />
        <result column="agt_coupon_amount" property="couponAmount"
            jdbcType="DECIMAL" />
        <association property="recommendActivity" column="agt_activity_id"
            resultMap="com.yeshi.fanli.dao.mybatis.activity.RecommendActivityMapper.BaseResultMap" />
        <association property="taoBaoGoodsBrief" column="agt_goods_id"
            resultMap="TAOBAOGOODS" />
    </resultMap>
    <resultMap id="TAOBAOGOODS"
        type="com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief">
        <!-- <id column="id" property="id" jdbcType="BIGINT" /> <result column="auctionId" 
            property="auctionId" jdbcType="BIGINT" /> -->
    </resultMap>
    <sql id="Base_Column_List">agt_id,agt_activity_id,agt_goods_id,agt_orderby,agt_picture,agt_desc,agt_auctionid,agt_createtime,agt_state,agt_title,agt_coupon_amount
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_activity_goods_taobao where agt_id =
        #{id,jdbcType=BIGINT}
    </select>
    <select id="selectList" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_activity_goods_taobao limit #{start},#{count}
    </select>
    <select id="selectByActivityId" resultMap="BaseResultMap" parameterType="java.lang.Long">
        SELECT t.* FROM yeshi_ec_activity_goods_taobao t 
        WHERE t.`agt_activity_id`=#{0}
    </select>
 
    <select id="selectByAuctionId" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        SELECT * FROM yeshi_ec_activity_goods_taobao where agt_auctionid=#{0}
    </select>
 
 
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_activity_goods_taobao where agt_id = #{id,jdbcType=BIGINT}
    </delete>
    <delete id="batchDeleteByActivityid" parameterType="int">
        <!-- 批量删除 -->
        delete from yeshi_ec_activity_goods_taobao where agt_activity_id in
        <foreach item="arids" collection="array" open="(" separator=","
            close=")">#{arids}</foreach>
    </delete>
    <insert id="insert"
        parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivityTaoBaoGoods"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_activity_goods_taobao
        (agt_id,agt_activity_id,agt_goods_id,agt_orderby,agt_picture,agt_desc,agt_auctionid,agt_createtime,agt_state,agt_title,agt_coupon_amount)
        values
        (#{id,jdbcType=BIGINT},#{recommendActivity.id,jdbcType=BIGINT},#{taoBaoGoodsBrief.id,jdbcType=BIGINT},#{orderBy,jdbcType=INTEGER},#{pictUrl,jdbcType=VARCHAR},#{desc,jdbcType=VARCHAR},#{auctionId,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{title,jdbcType=VARCHAR},#{couponAmount,jdbcType=DECIMAL})
    </insert>
    <insert id="insertSelective"
        parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivityTaoBaoGoods"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_activity_goods_taobao
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">agt_id,</if>
            <if test="recommendActivity != null">agt_activity_id,</if>
            <if test="taoBaoGoodsBrief != null">agt_goods_id,</if>
            <if test="orderBy != null">agt_orderby,</if>
            <if test="pictUrl != null">agt_picture,</if>
            <if test="desc != null">agt_desc,</if>
            <if test="auctionId != null">agt_auctionid,</if>
            <if test="createTime != null">agt_createtime,</if>
            <if test="state != null">agt_state,</if>
            <if test="title != null">agt_title,</if>
            <if test="couponAmount != null">agt_coupon_amount,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="recommendActivity != null">#{recommendActivity.id,jdbcType=BIGINT},</if>
            <if test="taoBaoGoodsBrief != null">#{taoBaoGoodsBrief.id,jdbcType=BIGINT},</if>
            <if test="orderBy != null">#{orderBy,jdbcType=INTEGER},</if>
            <if test="pictUrl != null">#{pictUrl,jdbcType=VARCHAR},</if>
            <if test="desc != null">#{desc,jdbcType=VARCHAR},</if>
            <if test="auctionId != null">#{auctionId,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="state != null">#{state,jdbcType=INTEGER},</if>
            <if test="title != null">#{title,jdbcType=VARCHAR},</if>
            <if test="couponAmount != null">#{couponAmount,jdbcType=DECIMAL},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
        parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivityTaoBaoGoods">update yeshi_ec_activity_goods_taobao set
        agt_activity_id = #{recommendActivity.id,jdbcType=BIGINT},agt_goods_id
        = #{taoBaoGoodsBrief.id,jdbcType=BIGINT},agt_orderby =
        #{orderBy,jdbcType=INTEGER} ,agt_picture =#{pictUrl,jdbcType=VARCHAR}
        ,agt_desc =#{desc,jdbcType=VARCHAR} ,agt_auctionid
        =#{auctionId,jdbcType=VARCHAR} ,agt_createtime
        =#{createTime,jdbcType=TIMESTAMP} ,agt_state
        =#{state,jdbcType=INTEGER} ,agt_title =#{title,jdbcType=VARCHAR}
        ,agt_coupon_amount =#{couponAmount,jdbcType=DECIMAL} where agt_id =
        #{id,jdbcType=BIGINT}
    </update>
    <update id="updateStateByAuctionId">update yeshi_ec_activity_goods_taobao set agt_state
        =#{state} where agt_goods_id = #{auctionId,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective"
        parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivityTaoBaoGoods">
        update yeshi_ec_activity_goods_taobao
        <set>
            <if test="recommendActivity != null">agt_activity_id=#{recommendActivity.id,jdbcType=BIGINT},
            </if>
            <if test="taoBaoGoodsBrief != null">agt_goods_id=#{taoBaoGoodsBrief.id,jdbcType=BIGINT},</if>
            <if test="orderBy != null">agt_orderby=#{orderBy,jdbcType=INTEGER},</if>
            <if test="id !=null">agt_id =#{id,jdbcType=BIGINT},</if>
            <if test="pictUrl !=null">agt_picture =#{pictUrl,jdbcType=VARCHAR},</if>
            <if test="desc !=null">agt_desc =#{desc,jdbcType=VARCHAR},</if>
            <if test="auctionId !=null">agt_auctionid =#{auctionId,jdbcType=VARCHAR},</if>
            <if test="createTime !=null">agt_createtime =#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="state !=null">agt_state =#{state,jdbcType=INTEGER},</if>
            <if test="title !=null">agt_title =#{title,jdbcType=VARCHAR},</if>
            <if test="couponAmount !=null">agt_coupon_amount =#{couponAmount,jdbcType=DECIMAL},</if>
        </set>
        where agt_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>