yujian
2019-01-22 88b54772dbcf5ecab1e2316e4e4626ac901b8908
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
<?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.TaoBaoWeiQuanDrawBackMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack">
        <id column="twd_id" property="id" jdbcType="BIGINT" />
        <result column="twd_order_id" property="orderId" jdbcType="VARCHAR" />
        <result column="twd_order_item_id" property="orderItemId"
            jdbcType="VARCHAR" />
        <result column="twd_order_drawback_money" property="drawBackMoney"
            jdbcType="DECIMAL" />
        <result column="twd_createtime" property="createTime" jdbcType="TIMESTAMP" />
        <association property="user" column="twd_uid"
            javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
            <id column="twd_uid" property="id" jdbcType="BIGINT" />
        </association>
 
    </resultMap>
    <sql id="Base_Column_List">twd_id,twd_order_id,twd_order_item_id,twd_uid,twd_order_drawback_money,twd_createtime
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_taobao_weiquan_drawback where twd_id =
        #{id,jdbcType=BIGINT}
    </select>
 
    <select id="selectByOrderItemIdAndUid" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_taobao_weiquan_drawback where twd_order_item_id
        =#{orderItemId} and twd_uid=#{uid}
    </select>
 
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_taobao_weiquan_drawback where twd_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_taobao_weiquan_drawback
        (twd_id,twd_order_id,twd_order_item_id,twd_uid,twd_order_drawback_money,twd_createtime)
        values
        (#{id,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR},#{orderItemId,jdbcType=VARCHAR},#{user.id,jdbcType=BIGINT},#{drawBackMoney,jdbcType=DECIMAL},#{createTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_taobao_weiquan_drawback
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">twd_id,</if>
            <if test="orderId != null">twd_order_id,</if>
            <if test="orderItemId != null">twd_order_item_id,</if>
            <if test="user != null">twd_uid,</if>
            <if test="drawBackMoney != null">twd_order_drawback_money,</if>
            <if test="createTime != null">twd_createtime,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
            <if test="orderItemId != null">#{orderItemId,jdbcType=VARCHAR},</if>
            <if test="user != null">#{user.id,jdbcType=BIGINT},</if>
            <if test="drawBackMoney != null">#{drawBackMoney,jdbcType=DECIMAL},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack">update
        yeshi_ec_taobao_weiquan_drawback set twd_order_id =
        #{orderId,jdbcType=VARCHAR},twd_order_item_id =
        #{orderItemId,jdbcType=VARCHAR},twd_uid =
        #{user.id,jdbcType=BIGINT},twd_order_drawback_money =
        #{drawBackMoney,jdbcType=DECIMAL},twd_createtime =
        #{createTime,jdbcType=TIMESTAMP} where twd_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack">
        update yeshi_ec_taobao_weiquan_drawback
        <set>
            <if test="orderId != null">twd_order_id=#{orderId,jdbcType=VARCHAR},</if>
            <if test="orderItemId != null">twd_order_item_id=#{orderItemId,jdbcType=VARCHAR},</if>
            <if test="user != null">twd_uid=#{user.id,jdbcType=BIGINT},</if>
            <if test="drawBackMoney != null">twd_order_drawback_money=#{drawBackMoney,jdbcType=DECIMAL},
            </if>
            <if test="createTime != null">twd_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
        </set>
        where twd_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>