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
<?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_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_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>
  <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_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},#{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="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="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_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="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>