admin
2018-12-25 4cb15e222cd7d099d533ccbeb7f9a8cd99bf180c
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
<?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.ThreeSaleGiftMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.ThreeSaleGift">
        <id column="id" property="id" jdbcType="BIGINT" />
        <result column="rank" property="rank" jdbcType="INTEGER" />
        <result column="rate" property="rate" jdbcType="DECIMAL" />
        <result column="money" property="money" jdbcType="DECIMAL" />
        <result column="state" property="state" jdbcType="INTEGER" />
        <result column="createTime" property="createTime" jdbcType="BIGINT" />
        <result column="fanTime" property="fanTime" jdbcType="BIGINT" />
        <association property="userInfo" column="uid"
            resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap" />
        <association property="orderItem" column="orderItemId"
            resultMap="com.yeshi.fanli.dao.mybatis.order.OrderItemMapper.BaseResultMap" />
    </resultMap>
    <sql id="Base_Column_List">id,uid,rank,rate,orderItemId,money,state,createTime,fanTime
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_three_sale_gift where id = #{id,jdbcType=BIGINT}
    </select>
 
    <select id="selectByOrderItem" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_three_sale_gift where orderItemId = #{0}
    </select>
 
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_three_sale_gift where id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.ThreeSaleGift"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_three_sale_gift
        (id,uid,rank,rate,orderItemId,money,state,createTime,fanTime) values
        (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{rank,jdbcType=INTEGER},#{rate,jdbcType=DECIMAL},#{orderItem.id,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{state,jdbcType=INTEGER},#{createTime,jdbcType=BIGINT},#{fanTime,jdbcType=BIGINT})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.ThreeSaleGift"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_three_sale_gift
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="userInfo != null">uid,</if>
            <if test="rank != null">rank,</if>
            <if test="rate != null">rate,</if>
            <if test="orderItem != null">orderItemId,</if>
            <if test="money != null">money,</if>
            <if test="state != null">state,</if>
            <if test="createTime != null">createTime,</if>
            <if test="fanTime != null">fanTime,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="userInfo != null">#{userInfo.id,jdbcType=BIGINT},</if>
            <if test="rank != null">#{rank,jdbcType=INTEGER},</if>
            <if test="rate != null">#{rate,jdbcType=DECIMAL},</if>
            <if test="orderItem != null">#{orderItem.id,jdbcType=BIGINT},</if>
            <if test="money != null">#{money,jdbcType=DECIMAL},</if>
            <if test="state != null">#{state,jdbcType=INTEGER},</if>
            <if test="createTime != null">#{createTime,jdbcType=BIGINT},</if>
            <if test="fanTime != null">#{fanTime,jdbcType=BIGINT},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.ThreeSaleGift">update
        yeshi_ec_three_sale_gift set uid = #{userInfo.id,jdbcType=BIGINT},rank
        = #{rank,jdbcType=INTEGER},rate = #{rate,jdbcType=DECIMAL},orderItemId
        = #{orderItem.id,jdbcType=BIGINT},money =
        #{money,jdbcType=DECIMAL},state = #{state,jdbcType=INTEGER},createTime
        = #{createTime,jdbcType=BIGINT},fanTime = #{fanTime,jdbcType=BIGINT}
        where id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.ThreeSaleGift">
        update yeshi_ec_three_sale_gift
        <set>
            <if test="userInfo != null">uid=#{userInfo.id,jdbcType=BIGINT},</if>
            <if test="rank != null">rank=#{rank,jdbcType=INTEGER},</if>
            <if test="rate != null">rate=#{rate,jdbcType=DECIMAL},</if>
            <if test="orderItem != null">orderItemId=#{orderItem.id,jdbcType=BIGINT},</if>
            <if test="money != null">money=#{money,jdbcType=DECIMAL},</if>
            <if test="state != null">state=#{state,jdbcType=INTEGER},</if>
            <if test="createTime != null">createTime=#{createTime,jdbcType=BIGINT},</if>
            <if test="fanTime != null">fanTime=#{fanTime,jdbcType=BIGINT},</if>
        </set>
        where id = #{id,jdbcType=BIGINT}
    </update>
</mapper>