admin
2020-05-20 98b1a0affd69bbe63223c21fdd2c404e8bedfccb
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
<?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.order.ShareGoodsActivityOrderMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.order.ShareGoodsActivityOrder">
        <id column="sgao_id" property="id" jdbcType="BIGINT" />
        <result column="sgao_share_rate" property="shareRate" jdbcType="DECIMAL" />
        <result column="sgao_create_time" property="createTime"
            jdbcType="TIMESTAMP" />
        <result column="sgao_update_time" property="updateTime"
            jdbcType="TIMESTAMP" />
        <result column="sgao_order_no" property="orderNo" jdbcType="VARCHAR" />
 
        <result column="sgao_order_source_type" property="orderSourceType"
            jdbcType="INTEGER" />
 
        <association property="user" column="sgao_uid"
            javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
            <id property="id" column="sgao_uid" jdbcType="BIGINT" />
        </association>
    </resultMap>
    <sql id="Base_Column_List">sgao_id,sgao_uid,sgao_order_no,sgao_share_rate,sgao_create_time,sgao_update_time,sgao_order_source_type
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_share_goods_activity_order where sgao_id =
        #{id,jdbcType=BIGINT}
    </select>
 
 
 
    <select id="countShareGoodsActivityOrderByUid" resultType="java.lang.Long"
        parameterType="java.lang.Long">
        select
        count(sgao_id)
        from
        yeshi_ec_share_goods_activity_order where sgao_uid =#{0}
    </select>
 
 
    <select id="listByOrderIdAndUid" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_share_goods_activity_order where sgao_uid =#{uid} and
        sgao_order_no=#{orderId}
    </select>
 
 
    <select id="listByUid" resultMap="BaseResultMap" parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_share_goods_activity_order where sgao_uid =#{uid}
    </select>
 
 
 
 
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_share_goods_activity_order where sgao_id =
        #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert"
        parameterType="com.yeshi.fanli.entity.order.ShareGoodsActivityOrder"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_share_goods_activity_order
        (sgao_id,sgao_uid,sgao_order_no,sgao_share_rate,sgao_create_time,sgao_update_time,sgao_order_source_type)
        values
        (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{orderNo,jdbcType=VARCHAR},#{shareRate,jdbcType=DECIMAL},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{orderSourceType,jdbcType=INTEGER})
    </insert>
    <insert id="insertSelective"
        parameterType="com.yeshi.fanli.entity.order.ShareGoodsActivityOrder"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_share_goods_activity_order
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">sgao_id,</if>
            <if test="user != null">sgao_uid,</if>
            <if test="orderNo !=null">sgao_order_no,</if>
            <if test="shareRate != null">sgao_share_rate,</if>
            <if test="createTime != null">sgao_create_time,</if>
            <if test="updateTime != null">sgao_update_time,</if>
            <if test="orderSourceType != null">sgao_order_source_type,</if>
            
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="user != null">#{user.id,jdbcType=BIGINT},</if>
            <if test="orderNo !=null">#{orderNo,jdbcType=VARCHAR},</if>
            <if test="shareRate != null">#{shareRate,jdbcType=DECIMAL},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="orderSourceType != null">#{orderSourceType,jdbcType=INTEGER}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
        parameterType="com.yeshi.fanli.entity.order.ShareGoodsActivityOrder">update yeshi_ec_share_goods_activity_order set sgao_uid
        = #{user.id,jdbcType=BIGINT},sgao_order_no =
        #{orderNo,jdbcType=VARCHAR},sgao_share_rate =
        #{shareRate,jdbcType=DECIMAL},sgao_create_time =
        #{createTime,jdbcType=TIMESTAMP},sgao_update_time =
        #{updateTime,jdbcType=TIMESTAMP},sgao_order_source_type
        #{orderSourceType,jdbcType=INTEGER}
        where sgao_id =
        #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective"
        parameterType="com.yeshi.fanli.entity.order.ShareGoodsActivityOrder">
        update yeshi_ec_share_goods_activity_order
        <set>
            <if test="user != null">sgao_uid=#{user.id,jdbcType=BIGINT},</if>
            <if test="orderNo !=null">sgao_order_no=#{orderNo,jdbcType=VARCHAR},</if>
            <if test="shareRate != null">sgao_share_rate=#{shareRate,jdbcType=DECIMAL},</if>
            <if test="createTime != null">sgao_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">sgao_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="orderSourceType != null">sgao_order_source_type=#{orderSourceType,jdbcType=INTEGER},</if>
        </set>
        where sgao_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>