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
<?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.TaoBaoTokenMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.taobao.TaoBaoToken">
        <id column="tt_id" property="id" jdbcType="BIGINT" />
        <result column="tt_pid" property="pid" jdbcType="VARCHAR" />
        <result column="tt_token" property="token" jdbcType="VARCHAR" />
        <result column="tt_auction_id" property="auctionId" jdbcType="BIGINT" />
        <result column="tt_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="tt_expire_time" property="expireTime" jdbcType="TIMESTAMP" />
    </resultMap>
    <sql id="Base_Column_List">tt_id,tt_pid,tt_token,tt_auction_id,tt_create_time,tt_expire_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_taobao_token where tt_id = #{id,jdbcType=BIGINT}
    </select>
 
    <select id="selectByAuctionId" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_taobao_token where tt_auction_id = #{auctionId} and
        tt_pid=#{pid}
    </select>
 
 
 
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_taobao_token where tt_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoToken"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_token
        (tt_id,tt_pid,tt_token,tt_auction_id,tt_create_time,tt_expire_time)
        values
        (#{id,jdbcType=BIGINT},#{pid,jdbcType=VARCHAR},#{token,jdbcType=VARCHAR},#{auctionId,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP},#{expireTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoToken"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_taobao_token
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">tt_id,</if>
            <if test="pid != null">tt_pid,</if>
            <if test="token != null">tt_token,</if>
            <if test="auctionId != null">tt_auction_id,</if>
            <if test="createTime != null">tt_create_time,</if>
            <if test="expireTime != null">tt_expire_time,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="pid != null">#{pid,jdbcType=VARCHAR},</if>
            <if test="token != null">#{token,jdbcType=VARCHAR},</if>
            <if test="auctionId != null">#{auctionId,jdbcType=BIGINT},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="expireTime != null">#{expireTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoToken">update
        yeshi_ec_taobao_token set tt_pid = #{pid,jdbcType=VARCHAR},tt_token =
        #{token,jdbcType=VARCHAR},tt_auction_id =
        #{auctionId,jdbcType=BIGINT},tt_create_time =
        #{createTime,jdbcType=TIMESTAMP},tt_expire_time =
        #{expireTime,jdbcType=TIMESTAMP} where tt_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoToken">
        update yeshi_ec_taobao_token
        <set>
            <if test="pid != null">tt_pid=#{pid,jdbcType=VARCHAR},</if>
            <if test="token != null">tt_token=#{token,jdbcType=VARCHAR},</if>
            <if test="auctionId != null">tt_auction_id=#{auctionId,jdbcType=BIGINT},</if>
            <if test="createTime != null">tt_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="expireTime != null">tt_expire_time=#{expireTime,jdbcType=TIMESTAMP},</if>
        </set>
        where tt_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>