admin
2019-07-30 573c491b4a1ba60e12a5678a01c1546c0077c1ee
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.CommonOrderGoodsMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.order.CommonOrderGoods">
        <id column="cog_id" property="id" jdbcType="BIGINT" />
        <result column="cog_goods_id" property="goodsId" jdbcType="VARCHAR" />
        <result column="cog_goods_type" property="goodsType" jdbcType="INTEGER" />
        <result column="cog_title" property="title" jdbcType="VARCHAR" />
        <result column="cog_picture" property="picture" jdbcType="VARCHAR" />
        <result column="cog_price" property="price" jdbcType="DECIMAL" />
        <result column="cog_shop_id" property="shopId" jdbcType="BIGINT" />
        <result column="cog_shop_name" property="shopName" jdbcType="VARCHAR" />
        <result column="cog_shop_type" property="shopType" jdbcType="VARCHAR" />
        <result column="cog_state" property="state" jdbcType="INTEGER" />
        <result column="cog_create_time" property="createTime"
            jdbcType="TIMESTAMP" />
        <result column="cog_update_time" property="updateTime"
            jdbcType="TIMESTAMP" />
    </resultMap>
 
    <sql id="Base_Column_List">cog_id,cog_goods_id,cog_goods_type,cog_title,cog_picture,cog_price,cog_shop_id,cog_shop_name,cog_shop_type,cog_state,cog_create_time,cog_update_time
    </sql>
 
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_common_order_goods where cog_id = #{id,jdbcType=BIGINT}
    </select>
 
 
    <select id="listByGoodsIdAndGoodsType" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_common_order_goods where cog_goods_id = #{goodsId} and
        cog_goods_type=#{goodsType}
    </select>
 
 
 
    <select id="listNoTitle" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_common_order_goods where cog_title is null limit #{start},#{count}
    </select>
 
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_common_order_goods where cog_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_common_order_goods
        (cog_id,cog_goods_id,cog_goods_type,cog_title,cog_picture,cog_price,cog_shop_id,cog_shop_name,cog_shop_type,cog_state,cog_create_time,cog_update_time)
        values
        (#{id,jdbcType=BIGINT},#{goodsId,jdbcType=VARCHAR},#{goodsType,jdbcType=INTEGER},#{title,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{price,jdbcType=DECIMAL},#{shopId,jdbcType=BIGINT},#{shopName,jdbcType=VARCHAR},#{shopType,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_common_order_goods
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">cog_id,</if>
            <if test="goodsId != null">cog_goods_id,</if>
            <if test="goodsType != null">cog_goods_type,</if>
            <if test="title != null">cog_title,</if>
            <if test="picture != null">cog_picture,</if>
            <if test="price != null">cog_price,</if>
            <if test="shopId != null">cog_shop_id,</if>
            <if test="shopName != null">cog_shop_name,</if>
            <if test="shopType != null">cog_shop_type,</if>
            <if test="state != null">cog_state,</if>
            <if test="createTime != null">cog_create_time,</if>
            <if test="updateTime != null">cog_update_time,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="goodsId != null">#{goodsId,jdbcType=VARCHAR},</if>
            <if test="goodsType != null">#{goodsType,jdbcType=INTEGER},</if>
            <if test="title != null">#{title,jdbcType=VARCHAR},</if>
            <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
            <if test="price != null">#{price,jdbcType=DECIMAL},</if>
            <if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
            <if test="shopName != null">#{shopName,jdbcType=VARCHAR},</if>
            <if test="shopType != null">#{shopType,jdbcType=VARCHAR},</if>
            <if test="state != null">#{state,jdbcType=INTEGER},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods">update
        yeshi_ec_common_order_goods set cog_goods_id =
        #{goodsId,jdbcType=VARCHAR},cog_goods_type =
        #{goodsType,jdbcType=INTEGER}cog_title =
        #{title,jdbcType=VARCHAR},cog_picture =
        #{picture,jdbcType=VARCHAR},cog_price =
        #{price,jdbcType=DECIMAL},cog_shop_id =
        #{shopId,jdbcType=BIGINT},cog_shop_name =
        #{shopName,jdbcType=VARCHAR},cog_shop_type =
        #{shopType,jdbcType=VARCHAR},cog_state =
        #{state,jdbcType=INTEGER},cog_create_time =
        #{createTime,jdbcType=TIMESTAMP},cog_update_time =
        #{updateTime,jdbcType=TIMESTAMP} where cog_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods">
        update yeshi_ec_common_order_goods
        <set>
            <if test="goodsId != null">cog_goods_id=#{goodsId,jdbcType=VARCHAR},</if>
            <if test="goodsType != null">cog_goods_type=#{goodsType,jdbcType=INTEGER},</if>
            <if test="title != null">cog_title=#{title,jdbcType=VARCHAR},</if>
            <if test="picture != null">cog_picture=#{picture,jdbcType=VARCHAR},</if>
            <if test="price != null">cog_price=#{price,jdbcType=DECIMAL},</if>
            <if test="shopId != null">cog_shop_id=#{shopId,jdbcType=BIGINT},</if>
            <if test="shopName != null">cog_shop_name=#{shopName,jdbcType=VARCHAR},</if>
            <if test="shopType != null">cog_shop_type=#{shopType,jdbcType=VARCHAR},</if>
            <if test="state != null">cog_state=#{state,jdbcType=INTEGER},</if>
            <if test="createTime != null">cog_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">cog_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set>
        where cog_id = #{id,jdbcType=BIGINT}
    </update>
 
</mapper>