<?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.goods.CommonGoodsMapper">
|
<resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.goods.CommonGoods">
|
<id column="cg_id" property="id" jdbcType="BIGINT" />
|
<result column="cg_title" property="title" jdbcType="VARCHAR" />
|
<result column="cg_goods_id" property="goodsId" jdbcType="BIGINT" />
|
<result column="cg_goods_type" property="goodsType" jdbcType="INTEGER" />
|
<result column="cg_shop_type" property="shopType" jdbcType="INTEGER" />
|
<result column="cg_seller_id" property="sellerId" jdbcType="BIGINT" />
|
<result column="cg_seller_name" property="sellerName" jdbcType="VARCHAR" />
|
<result column="cg_sales" property="sales" jdbcType="INTEGER" />
|
<result column="cg_rate" property="rate" jdbcType="DECIMAL" />
|
<result column="cg_picture" property="picture" jdbcType="VARCHAR" />
|
<result column="cg_state" property="state" jdbcType="INTEGER" />
|
<result column="cg_price" property="price" jdbcType="DECIMAL" />
|
<result column="cg_coupon_info" property="couponInfo" jdbcType="VARCHAR" />
|
<result column="cg_coupon_startprice" property="couponStartPrice"
|
jdbcType="DECIMAL" />
|
<result column="cg_coupon_amount" property="couponAmount"
|
jdbcType="DECIMAL" />
|
<result column="cg_coupon_left_count" property="couponLeftCount"
|
jdbcType="INTEGER" />
|
<result column="cg_coupon_total_count" property="couponTotalCount"
|
jdbcType="INTEGER" />
|
<result column="cg_video_cover" property="videoCover" jdbcType="VARCHAR" />
|
<result column="cg_video_url" property="videoUrl" jdbcType="VARCHAR" />
|
<result column="cg_createtime" property="createTime" jdbcType="TIMESTAMP" />
|
<result column="cg_updatetime" property="updateTime" jdbcType="TIMESTAMP" />
|
</resultMap>
|
<sql id="Base_Column_List">cg_id,cg_title,cg_goods_id,cg_goods_type,cg_shop_type,cg_seller_id,cg_seller_name,cg_sales,cg_rate,cg_picture,cg_state,cg_price,cg_coupon_info,cg_coupon_startprice,cg_coupon_amount,cg_coupon_left_count,cg_coupon_total_count,cg_video_cover,cg_video_url,cg_createtime,cg_updatetime
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_common_goods where cg_id = #{id,jdbcType=BIGINT}
|
</select>
|
|
<select id="selectByGoodsIdAndGoodsType" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_common_goods where cg_goods_id = #{goodsId} and
|
cg_goods_type=#{goodsType}
|
</select>
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
yeshi_ec_common_goods where cg_id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert" parameterType="com.yeshi.fanli.entity.goods.CommonGoods"
|
useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_common_goods
|
(cg_id,cg_title,cg_goods_id,cg_goods_type,cg_shop_type,cg_seller_id,cg_seller_name,cg_sales,cg_rate,cg_picture,cg_state,cg_price,cg_coupon_info,cg_coupon_startprice,cg_coupon_amount,cg_coupon_left_count,cg_coupon_total_count,cg_video_cover,cg_video_url,cg_createtime,cg_updatetime)
|
values
|
(#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{goodsId,jdbcType=BIGINT},#{goodsType,jdbcType=INTEGER},#{shopType,jdbcType=INTEGER},#{sellerId,jdbcType=BIGINT},#{sellerName,jdbcType=VARCHAR},#{sales,jdbcType=INTEGER},#{rate,jdbcType=DECIMAL},#{picture,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{price,jdbcType=DECIMAL},#{couponInfo,jdbcType=VARCHAR},#{couponStartPrice,jdbcType=DECIMAL},#{couponAmount,jdbcType=DECIMAL},#{couponLeftCount,jdbcType=INTEGER},#{couponTotalCount,jdbcType=INTEGER},#{videoCover,jdbcType=VARCHAR},#{videoUrl,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
|
</insert>
|
<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.goods.CommonGoods"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into yeshi_ec_common_goods
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">cg_id,</if>
|
<if test="title != null">cg_title,</if>
|
<if test="goodsId != null">cg_goods_id,</if>
|
<if test="goodsType != null">cg_goods_type,</if>
|
<if test="shopType != null">cg_shop_type,</if>
|
<if test="sellerId != null">cg_seller_id,</if>
|
<if test="sellerName != null">cg_seller_name,</if>
|
<if test="sales != null">cg_sales,</if>
|
<if test="rate != null">cg_rate,</if>
|
<if test="picture != null">cg_picture,</if>
|
<if test="state != null">cg_state,</if>
|
<if test="price != null">cg_price,</if>
|
<if test="couponInfo != null">cg_coupon_info,</if>
|
<if test="couponStartPrice != null">cg_coupon_startprice,</if>
|
<if test="couponAmount != null">cg_coupon_amount,</if>
|
<if test="couponLeftCount != null">cg_coupon_left_count,</if>
|
<if test="couponTotalCount != null">cg_coupon_total_count,</if>
|
<if test="videoCover != null">cg_video_cover,</if>
|
<if test="videoUrl != null">cg_video_url,</if>
|
<if test="createTime != null">cg_createtime,</if>
|
<if test="updateTime != null">cg_updatetime,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="title != null">#{title,jdbcType=VARCHAR},</if>
|
<if test="goodsId != null">#{goodsId,jdbcType=BIGINT},</if>
|
<if test="goodsType != null">#{goodsType,jdbcType=INTEGER},</if>
|
<if test="shopType != null">#{shopType,jdbcType=INTEGER},</if>
|
<if test="sellerId != null">#{sellerId,jdbcType=BIGINT},</if>
|
<if test="sellerName != null">#{sellerName,jdbcType=VARCHAR},</if>
|
<if test="sales != null">#{sales,jdbcType=INTEGER},</if>
|
<if test="rate != null">#{rate,jdbcType=DECIMAL},</if>
|
<if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
|
<if test="state != null">#{state,jdbcType=INTEGER},</if>
|
<if test="price != null">#{price,jdbcType=DECIMAL},</if>
|
<if test="couponInfo != null">#{couponInfo,jdbcType=VARCHAR},</if>
|
<if test="couponStartPrice != null">#{couponStartPrice,jdbcType=DECIMAL},</if>
|
<if test="couponAmount != null">#{couponAmount,jdbcType=DECIMAL},</if>
|
<if test="couponLeftCount != null">#{couponLeftCount,jdbcType=INTEGER},</if>
|
<if test="couponTotalCount != null">#{couponTotalCount,jdbcType=INTEGER},</if>
|
<if test="videoCover != null">#{videoCover,jdbcType=VARCHAR},</if>
|
<if test="videoUrl != null">#{videoUrl,jdbcType=VARCHAR},</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.goods.CommonGoods">update
|
yeshi_ec_common_goods set cg_title =
|
#{title,jdbcType=VARCHAR},cg_goods_id =
|
#{goodsId,jdbcType=BIGINT},cg_goods_type =
|
#{goodsType,jdbcType=INTEGER},cg_shop_type =
|
#{shopType,jdbcType=INTEGER},cg_seller_id =
|
#{sellerId,jdbcType=BIGINT},cg_seller_name =
|
#{sellerName,jdbcType=VARCHAR},cg_sales =
|
#{sales,jdbcType=INTEGER},cg_rate =
|
#{rate,jdbcType=DECIMAL},cg_picture =
|
#{picture,jdbcType=VARCHAR},cg_state =
|
#{state,jdbcType=INTEGER},cg_price =
|
#{price,jdbcType=DECIMAL},cg_coupon_info =
|
#{couponInfo,jdbcType=VARCHAR},cg_coupon_startprice =
|
#{couponStartPrice,jdbcType=DECIMAL},cg_coupon_amount =
|
#{couponAmount,jdbcType=DECIMAL},cg_coupon_left_count =
|
#{couponLeftCount,jdbcType=INTEGER},cg_coupon_total_count =
|
#{couponTotalCount,jdbcType=INTEGER},cg_video_cover =
|
#{videoCover,jdbcType=VARCHAR},cg_video_url =
|
#{videoUrl,jdbcType=VARCHAR},cg_createtime =
|
#{createTime,jdbcType=TIMESTAMP},cg_updatetime =
|
#{updateTime,jdbcType=TIMESTAMP} where cg_id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.goods.CommonGoods">
|
update yeshi_ec_common_goods
|
<set>
|
<if test="title != null">cg_title=#{title,jdbcType=VARCHAR},</if>
|
<if test="goodsId != null">cg_goods_id=#{goodsId,jdbcType=BIGINT},</if>
|
<if test="goodsType != null">cg_goods_type=#{goodsType,jdbcType=INTEGER},</if>
|
<if test="shopType != null">cg_shop_type=#{shopType,jdbcType=INTEGER},</if>
|
<if test="sellerId != null">cg_seller_id=#{sellerId,jdbcType=BIGINT},</if>
|
<if test="sellerName != null">cg_seller_name=#{sellerName,jdbcType=VARCHAR},</if>
|
<if test="sales != null">cg_sales=#{sales,jdbcType=INTEGER},</if>
|
<if test="rate != null">cg_rate=#{rate,jdbcType=DECIMAL},</if>
|
<if test="picture != null">cg_picture=#{picture,jdbcType=VARCHAR},</if>
|
<if test="state != null">cg_state=#{state,jdbcType=INTEGER},</if>
|
<if test="price != null">cg_price=#{price,jdbcType=DECIMAL},</if>
|
<if test="couponInfo != null">cg_coupon_info=#{couponInfo,jdbcType=VARCHAR},</if>
|
<if test="couponStartPrice != null">cg_coupon_startprice=#{couponStartPrice,jdbcType=DECIMAL},
|
</if>
|
<if test="couponAmount != null">cg_coupon_amount=#{couponAmount,jdbcType=DECIMAL},</if>
|
<if test="couponLeftCount != null">cg_coupon_left_count=#{couponLeftCount,jdbcType=INTEGER},
|
</if>
|
<if test="couponTotalCount != null">cg_coupon_total_count=#{couponTotalCount,jdbcType=INTEGER},
|
</if>
|
<if test="videoCover != null">cg_video_cover=#{videoCover,jdbcType=VARCHAR},</if>
|
<if test="videoUrl != null">cg_video_url=#{videoUrl,jdbcType=VARCHAR},</if>
|
<if test="createTime != null">cg_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">cg_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
|
</set>
|
where cg_id = #{id,jdbcType=BIGINT}
|
</update>
|
</mapper>
|