admin
2019-11-23 51a4ff5d777028d52a19c314a99f796334cb7b51
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?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.shop.BanLiShopGoodsSetsPayMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay">
        <id column="sp_id" property="id" jdbcType="BIGINT" />
        <result column="sp_discount" property="disCount" jdbcType="DECIMAL" />
        <result column="sp_price_hongbao" property="hongBaoPrice"
            jdbcType="DECIMAL" />
        <result column="sp_price_balance" property="balancePrice"
            jdbcType="DECIMAL" />
        <result column="sp_price_money" property="moneyPrice" jdbcType="DECIMAL" />
        <result column="sp_pay_type" property="payType" jdbcType="VARCHAR" />
        <result column="sp_tag" property="tag" jdbcType="VARCHAR" />
        <result column="sp_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="sp_update_time" property="updateTime" jdbcType="TIMESTAMP" />
        <result column="sp_weight" property="weight" jdbcType="INTEGER" />
        <association property="goodsSet" column="sp_goods_set_id"
            javaType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSets">
            <id column="sp_goods_set_id" property="id" jdbcType="BIGINT" />
        </association>
    </resultMap>
    <sql id="Base_Column_List">sp_id,sp_goods_set_id,sp_discount,sp_price_hongbao,sp_price_balance,sp_price_money,sp_pay_type,sp_tag,sp_create_time,sp_update_time,sp_weight
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods_set_pay where sp_id = #{id,jdbcType=BIGINT}
    </select>
    <select id="listByGoodsSetId" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods_set_pay where sp_goods_set_id = #{0}
    </select>
    
    <select id="countByGoodsSetId" resultType="java.lang.Long"
        parameterType="java.lang.Long">
        select
        count(*)
        from yeshi_ec_shop_goods_set_pay where sp_goods_set_id = #{0}
    </select>
    
    <select id="listQuery" resultMap="BaseResultMap">
        select    <include refid="Base_Column_List" /> from yeshi_ec_shop_goods_set_pay 
        where 1=1
        <if test="payType != null">
            and sp_pay_type=#{payType}
        </if>
        <if test="setId != null">
            and sp_goods_set_id = #{setId}
        </if>
        order by sp_weight desc 
        limit #{start},#{count}
    </select>
 
    <select id="countQuery" resultType="java.lang.Long">
        select count(sp_id) from yeshi_ec_shop_goods_set_pay 
        where 1=1
        <if test="payType != null">
            and sp_pay_type=#{payType}
        </if>
        <if test="setId != null">
            and sp_goods_set_id = #{setId}
        </if>
    </select>
    
    
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_shop_goods_set_pay where sp_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_shop_goods_set_pay
        (sp_id,sp_goods_set_id,sp_discount,sp_price_hongbao,sp_price_balance,sp_price_money,sp_pay_type,sp_tag,sp_create_time,sp_update_time,sp_weight)
        values
        (#{id,jdbcType=BIGINT},#{goodsSet.id,jdbcType=BIGINT},#{disCount,jdbcType=DECIMAL},#{hongBaoPrice,jdbcType=DECIMAL},#{balancePrice,jdbcType=DECIMAL},#{moneyPrice,jdbcType=DECIMAL},#{payType,jdbcType=VARCHAR},#{tag,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{weight,jdbcType=INTEGER})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_shop_goods_set_pay
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">sp_id,</if>
            <if test="goodsSet != null">sp_goods_set_id,</if>
            <if test="disCount != null">sp_discount,</if>
            <if test="hongBaoPrice != null">sp_price_hongbao,</if>
            <if test="balancePrice != null">sp_price_balance,</if>
            <if test="moneyPrice != null">sp_price_money,</if>
            <if test="payType != null">sp_pay_type,</if>
            <if test="tag != null">sp_tag,</if>
            <if test="createTime != null">sp_create_time,</if>
            <if test="updateTime != null">sp_update_time,</if>
            <if test="weight != null">sp_weight,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="goodsSet != null">#{goodsSet.id,jdbcType=BIGINT},</if>
            <if test="disCount != null">#{disCount,jdbcType=DECIMAL},</if>
            <if test="hongBaoPrice != null">#{hongBaoPrice,jdbcType=DECIMAL},</if>
            <if test="balancePrice != null">#{balancePrice,jdbcType=DECIMAL},</if>
            <if test="moneyPrice != null">#{moneyPrice,jdbcType=DECIMAL},</if>
            <if test="payType != null">#{payType,jdbcType=VARCHAR},</if>
            <if test="tag != null">#{tag,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="weight != null">#{weight,jdbcType=INTEGER}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay">update
        yeshi_ec_shop_goods_set_pay set sp_goods_set_id =
        #{goodsSet.id,jdbcType=BIGINT},sp_discount =
        #{disCount,jdbcType=DECIMAL},sp_price_hongbao =
        #{hongBaoPrice,jdbcType=DECIMAL},sp_price_balance =
        #{balancePrice,jdbcType=DECIMAL},sp_price_money =
        #{moneyPrice,jdbcType=DECIMAL},sp_pay_type =
        #{payType,jdbcType=VARCHAR},sp_tag =
        #{tag,jdbcType=VARCHAR},sp_create_time =
        #{createTime,jdbcType=TIMESTAMP},sp_update_time =
        #{updateTime,jdbcType=TIMESTAMP} ,sp_weight
        =#{weight,jdbcType=INTEGER} where sp_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay">
        update yeshi_ec_shop_goods_set_pay
        <set>
            <if test="goodsSet != null">sp_goods_set_id=#{goodsSet.id,jdbcType=BIGINT},</if>
            <if test="disCount != null">sp_discount=#{disCount,jdbcType=DECIMAL},</if>
            <if test="hongBaoPrice != null">sp_price_hongbao=#{hongBaoPrice,jdbcType=DECIMAL},</if>
            <if test="balancePrice != null">sp_price_balance=#{balancePrice,jdbcType=DECIMAL},</if>
            <if test="moneyPrice != null">sp_price_money=#{moneyPrice,jdbcType=DECIMAL},</if>
            <if test="payType != null">sp_pay_type=#{payType,jdbcType=VARCHAR},</if>
            <if test="tag != null">sp_tag=#{tag,jdbcType=VARCHAR},</if>
            <if test="createTime != null">sp_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">sp_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="weight !=null">sp_weight =#{weight,jdbcType=INTEGER},</if>
        </set>
        where sp_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>