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
<?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.BanLiShopOrderGoodsMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.shop.BanLiShopOrderGoods">
        <id column="og_id" property="id" jdbcType="BIGINT" />
        <result column="og_goods_name" property="goodsName" jdbcType="VARCHAR" />
        <result column="og_set_name" property="setName" jdbcType="VARCHAR" />
        <result column="og_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="og_state" property="state" jdbcType="INTEGER" />
        <result column="og_zk_price" property="zkPrice" jdbcType="DECIMAL" />
        <result column="og_goods_id" property="goodsId" jdbcType="BIGINT" />
        <result column="og_goods_set_id" property="goodsSetId"
            jdbcType="BIGINT" />
        <result column="og_picture" property="picture" jdbcType="VARCHAR" />
    </resultMap>
    <sql id="Base_Column_List">og_id,og_goods_name,og_set_name,og_create_time,og_state,og_zk_price,og_goods_id,og_goods_set_id,og_picture
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_order_goods where og_id = #{id,jdbcType=BIGINT}
    </select>
    <select id="selectByGoodsSetId" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_order_goods where og_goods_set_id = #{0} limit 1
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_shop_order_goods where og_id = #{id,jdbcType=BIGINT}</delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.shop.BanLiShopOrderGoods"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_shop_order_goods
        (og_id,og_goods_name,og_set_name,og_create_time,og_state,og_zk_price,og_goods_id,og_goods_set_id,og_picture)
        values
        (#{id,jdbcType=BIGINT},#{goodsName,jdbcType=VARCHAR},#{setName,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{zkPrice,jdbcType=DECIMAL},#{goodsId,jdbcType=BIGINT},#{goodsSetId,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopOrderGoods"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_shop_order_goods
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">og_id,</if>
            <if test="goodsName != null">og_goods_name,</if>
            <if test="setName != null">og_set_name,</if>
            <if test="createTime != null">og_create_time,</if>
            <if test="state != null">og_state,</if>
            <if test="zkPrice != null">og_zk_price,</if>
            <if test="goodsId != null">og_goods_id,</if>
            <if test="goodsSetId != null">og_goods_set_id,</if>
            <if test="picture != null">og_picture,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="goodsName != null">#{goodsName,jdbcType=VARCHAR},</if>
            <if test="setName != null">#{setName,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="state != null">#{state,jdbcType=INTEGER},</if>
            <if test="zkPrice != null">#{zkPrice,jdbcType=DECIMAL},</if>
            <if test="goodsId != null">#{goodsId,jdbcType=BIGINT},</if>
            <if test="goodsSetId != null">#{goodsSetId,jdbcType=BIGINT},</if>
            <if test="picture != null">#{picture,jdbcType=VARCHAR}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.shop.BanLiShopOrderGoods">update
        yeshi_ec_shop_order_goods set og_goods_name =
        #{goodsName,jdbcType=VARCHAR},og_set_name =
        #{setName,jdbcType=VARCHAR},og_create_time =
        #{createTime,jdbcType=TIMESTAMP},og_state =
        #{state,jdbcType=INTEGER},og_zk_price =
        #{zkPrice,jdbcType=DECIMAL},og_goods_id =
        #{goodsId,jdbcType=BIGINT},og_goods_set_id =
        #{goodsSetId,jdbcType=BIGINT} ,og_picture =#{picture,jdbcType=VARCHAR}
        where og_id = #{id,jdbcType=BIGINT}</update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopOrderGoods">
        update yeshi_ec_shop_order_goods
        <set>
            <if test="goodsName != null">og_goods_name=#{goodsName,jdbcType=VARCHAR},</if>
            <if test="setName != null">og_set_name=#{setName,jdbcType=VARCHAR},</if>
            <if test="createTime != null">og_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="state != null">og_state=#{state,jdbcType=INTEGER},</if>
            <if test="zkPrice != null">og_zk_price=#{zkPrice,jdbcType=DECIMAL},</if>
            <if test="goodsId != null">og_goods_id=#{goodsId,jdbcType=BIGINT},</if>
            <if test="goodsSetId != null">og_goods_set_id=#{goodsSetId,jdbcType=BIGINT},</if>
            <if test="picture !=null">og_picture =#{picture,jdbcType=VARCHAR},</if>
        </set>
        where og_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>