yujian
2020-06-09 554de444b87aab5f93cb1593a8095612cf9479a7
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
<?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.TaoBaoOrderGoodsMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.taobao.TaoBaoOrderGoods">
        <id column="tog_id" property="id" jdbcType="BIGINT" />
        <result column="tog_trade_id" property="tradeId" jdbcType="VARCHAR" />
        <result column="tog_category_name" property="categoryName"
            jdbcType="VARCHAR" />
        <result column="tog_img" property="img" jdbcType="VARCHAR" />
        <result column="tog_title" property="title" jdbcType="VARCHAR" />
        <result column="tog_price" property="price" jdbcType="VARCHAR" />
        <result column="tog_goods_id" property="goodsId" jdbcType="VARCHAR" />
        <result column="tog_link" property="link" jdbcType="VARCHAR" />
        <result column="tog_create_time" property="createTime"
            jdbcType="TIMESTAMP" />
    </resultMap>
    <sql id="Base_Column_List">tog_id,tog_trade_id,tog_category_name,tog_img,tog_title,tog_price,tog_goods_id,tog_link,tog_create_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_taobao_order_goods where tog_id = #{id,jdbcType=BIGINT}
    </select>
 
 
    <select id="selectByTradeId" resultMap="BaseResultMap"
        parameterType="java.lang.String">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_taobao_order_goods where tog_trade_id = #{0}
    </select>
 
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_taobao_order_goods where tog_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrderGoods"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_taobao_order_goods
        (tog_id,tog_trade_id,tog_category_name,tog_img,tog_title,tog_price,tog_goods_id,tog_link,tog_create_time)
        values
        (#{id,jdbcType=BIGINT},#{tradeId,jdbcType=VARCHAR},#{categoryName,jdbcType=VARCHAR},#{img,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{price,jdbcType=VARCHAR},#{goodsId,jdbcType=VARCHAR},#{link,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrderGoods"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_taobao_order_goods
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">tog_id,</if>
            <if test="tradeId != null">tog_trade_id,</if>
            <if test="categoryName != null">tog_category_name,</if>
            <if test="img != null">tog_img,</if>
            <if test="title != null">tog_title,</if>
            <if test="price != null">tog_price,</if>
            <if test="goodsId != null">tog_goods_id,</if>
            <if test="link != null">tog_link,</if>
            <if test="createTime != null">tog_create_time,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="tradeId != null">#{tradeId,jdbcType=VARCHAR},</if>
            <if test="categoryName != null">#{categoryName,jdbcType=VARCHAR},</if>
            <if test="img != null">#{img,jdbcType=VARCHAR},</if>
            <if test="title != null">#{title,jdbcType=VARCHAR},</if>
            <if test="price != null">#{price,jdbcType=VARCHAR},</if>
            <if test="goodsId != null">#{goodsId,jdbcType=VARCHAR},</if>
            <if test="link != null">#{link,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrderGoods">update
        yeshi_ec_taobao_order_goods set tog_trade_id =
        #{tradeId,jdbcType=VARCHAR},tog_category_name =
        #{categoryName,jdbcType=VARCHAR},tog_img =
        #{img,jdbcType=VARCHAR},tog_title =
        #{title,jdbcType=VARCHAR},tog_price =
        #{price,jdbcType=VARCHAR},tog_goods_id =
        #{goodsId,jdbcType=VARCHAR},tog_link =
        #{link,jdbcType=VARCHAR},tog_create_time =
        #{createTime,jdbcType=TIMESTAMP} where tog_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrderGoods">
        update yeshi_ec_taobao_order_goods
        <set>
            <if test="tradeId != null">tog_trade_id=#{tradeId,jdbcType=VARCHAR},</if>
            <if test="categoryName != null">tog_category_name=#{categoryName,jdbcType=VARCHAR},</if>
            <if test="img != null">tog_img=#{img,jdbcType=VARCHAR},</if>
            <if test="title != null">tog_title=#{title,jdbcType=VARCHAR},</if>
            <if test="price != null">tog_price=#{price,jdbcType=VARCHAR},</if>
            <if test="goodsId != null">tog_goods_id=#{goodsId,jdbcType=VARCHAR},</if>
            <if test="link != null">tog_link=#{link,jdbcType=VARCHAR},</if>
            <if test="createTime != null">tog_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
        </set>
        where tog_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>