<?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.BanLiShopGoodsSetsMapper">
|
<resultMap id="BaseResultMap"
|
type="com.yeshi.fanli.entity.shop.BanLiShopGoodsSets">
|
<id column="sgs_id" property="id" jdbcType="BIGINT" />
|
<result column="sgs_name" property="name" jdbcType="VARCHAR" />
|
<result column="sgs_original_price" property="originalPrice"
|
jdbcType="DECIMAL" />
|
<result column="sgs_zk_price" property="zkPrice" jdbcType="DECIMAL" />
|
<result column="sgs_sales_count" property="salesCount"
|
jdbcType="BIGINT" />
|
<result column="sgs_stock" property="stock" jdbcType="INTEGER" />
|
<result column="sgs_charge_fulu_num" property="chargeFuLuNum"
|
jdbcType="VARCHAR" />
|
<result column="sgs_create_time" property="createTime"
|
jdbcType="TIMESTAMP" />
|
<result column="sgs_update_time" property="updateTime"
|
jdbcType="TIMESTAMP" />
|
<result column="sgs_weight" property="weight" jdbcType="INTEGER" />
|
<result column="sgs_sub_name" property="subName" jdbcType="VARCHAR" />
|
<result column="sgs_state" property="state" jdbcType="INTEGER" />
|
<association property="goods" column="sgs_goods_id"
|
javaType="com.yeshi.fanli.entity.shop.BanLiShopGoods">
|
<id column="sgs_goods_id" property="id" jdbcType="BIGINT" />
|
</association>
|
|
</resultMap>
|
<resultMap id="BaseResultDetailMap"
|
type="com.yeshi.fanli.entity.shop.BanLiShopGoodsSets">
|
<id column="sgs_id" property="id" jdbcType="BIGINT" />
|
<result column="sgs_name" property="name" jdbcType="VARCHAR" />
|
<result column="sgs_original_price" property="originalPrice"
|
jdbcType="DECIMAL" />
|
<result column="sgs_zk_price" property="zkPrice" jdbcType="DECIMAL" />
|
<result column="sgs_sales_count" property="salesCount"
|
jdbcType="BIGINT" />
|
<result column="sgs_stock" property="stock" jdbcType="INTEGER" />
|
<result column="sgs_charge_fulu_num" property="chargeFuLuNum"
|
jdbcType="VARCHAR" />
|
<result column="sgs_create_time" property="createTime"
|
jdbcType="TIMESTAMP" />
|
<result column="sgs_update_time" property="updateTime"
|
jdbcType="TIMESTAMP" />
|
<result column="sgs_weight" property="weight" jdbcType="INTEGER" />
|
<result column="sgs_sub_name" property="subName" jdbcType="VARCHAR" />
|
<result column="sgs_state" property="state" jdbcType="INTEGER" />
|
<association property="goods" column="sgs_goods_id"
|
javaType="com.yeshi.fanli.entity.shop.BanLiShopGoods">
|
<id column="sgs_goods_id" property="id" jdbcType="BIGINT" />
|
</association>
|
<collection property="payList" column="sgs_id"
|
ofType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay"
|
select="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsSetsPayMapper.listByGoodsSetId" />
|
</resultMap>
|
<sql id="Base_Column_List">sgs_id,sgs_name,sgs_goods_id,sgs_original_price,sgs_zk_price,sgs_sales_count,sgs_stock,sgs_charge_fulu_num,sgs_create_time,sgs_update_time,sgs_weight,sgs_sub_name,sgs_state
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_shop_goods_set where sgs_id = #{id,jdbcType=BIGINT}
|
</select>
|
<select id="selectDetailByPrimaryKey" resultMap="BaseResultDetailMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_shop_goods_set where sgs_id = #{0}
|
</select>
|
<select id="listDetailByGoodsId" resultMap="BaseResultDetailMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_shop_goods_set where sgs_goods_id = #{0}
|
</select>
|
<select id="countByGoodsId" resultType="java.lang.Long"
|
parameterType="java.lang.Long">select count(*) from yeshi_ec_shop_goods_set where
|
sgs_goods_id = #{0}
|
</select>
|
<select id="listByGoodsId" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_shop_goods_set where sgs_goods_id = #{0}
|
</select>
|
|
<select id="listQuery" resultMap="BaseResultMap">
|
select <include refid="Base_Column_List" /> from yeshi_ec_shop_goods_set
|
where 1=1 <if test="key != null and key != ''">AND sgs_name like '%${key}%'</if>
|
<if test="goodsId != null">AND sgs_goods_id = #{goodsId}</if>
|
order by sgs_weight desc
|
limit #{start},#{count}
|
</select>
|
|
<select id="countQuery" resultType="java.lang.Long">
|
select count(sgs_id) from yeshi_ec_shop_goods_set
|
where 1=1 <if test="key != null and key != ''">AND sgs_name like '%${key}%'</if>
|
<if test="goodsId != null">AND sgs_goods_id = #{goodsId}</if>
|
</select>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
yeshi_ec_shop_goods_set where sgs_id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSets"
|
useGeneratedKeys="true" keyProperty="id">insert into
|
yeshi_ec_shop_goods_set
|
(sgs_id,sgs_name,sgs_goods_id,sgs_original_price,sgs_zk_price,sgs_sales_count,sgs_stock,sgs_charge_fulu_num,sgs_create_time,sgs_update_time,sgs_weight,sgs_sub_name,sgs_state)
|
values
|
(#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{goods.id,jdbcType=BIGINT},#{originalPrice,jdbcType=DECIMAL},#{zkPrice,jdbcType=DECIMAL},#{salesCount,jdbcType=BIGINT},#{stock,jdbcType=INTEGER},#{chargeFuLuNum,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{weight,jdbcType=INTEGER},#{subName,jdbcType=VARCHAR},#{state,jdbcType=INTEGER})
|
</insert>
|
<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSets"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into yeshi_ec_shop_goods_set
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">sgs_id,</if>
|
<if test="name != null">sgs_name,</if>
|
<if test="goods != null">sgs_goods_id,</if>
|
<if test="originalPrice != null">sgs_original_price,</if>
|
<if test="zkPrice != null">sgs_zk_price,</if>
|
<if test="salesCount != null">sgs_sales_count,</if>
|
<if test="stock != null">sgs_stock,</if>
|
<if test="chargeFuLuNum != null">sgs_charge_fulu_num,</if>
|
<if test="createTime != null">sgs_create_time,</if>
|
<if test="updateTime != null">sgs_update_time,</if>
|
<if test="weight != null">sgs_weight,</if>
|
<if test="subName != null">sgs_sub_name,</if>
|
<if test="state != null">sgs_state,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="name != null">#{name,jdbcType=VARCHAR},</if>
|
<if test="goods != null">#{goods.id,jdbcType=BIGINT},</if>
|
<if test="originalPrice != null">#{originalPrice,jdbcType=DECIMAL},</if>
|
<if test="zkPrice != null">#{zkPrice,jdbcType=DECIMAL},</if>
|
<if test="salesCount != null">#{salesCount,jdbcType=BIGINT},</if>
|
<if test="stock != null">#{stock,jdbcType=INTEGER},</if>
|
<if test="chargeFuLuNum != null">#{chargeFuLuNum,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>
|
<if test="subName != null">#{subName,jdbcType=VARCHAR},</if>
|
<if test="state != null">#{state,jdbcType=INTEGER}</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSets">update
|
yeshi_ec_shop_goods_set set sgs_name =
|
#{name,jdbcType=VARCHAR},sgs_goods_id =
|
#{goods.id,jdbcType=BIGINT},sgs_original_price =
|
#{originalPrice,jdbcType=DECIMAL},sgs_zk_price =
|
#{zkPrice,jdbcType=DECIMAL},sgs_sales_count =
|
#{salesCount,jdbcType=BIGINT},sgs_stock =
|
#{stock,jdbcType=INTEGER},sgs_charge_fulu_num =
|
#{chargeFuLuNum,jdbcType=VARCHAR},sgs_create_time =
|
#{createTime,jdbcType=TIMESTAMP},sgs_update_time =
|
#{updateTime,jdbcType=TIMESTAMP} ,sgs_weight
|
=#{weight,jdbcType=INTEGER} ,sgs_sub_name =#{subName,jdbcType=VARCHAR}
|
,sgs_state =#{state,jdbcType=INTEGER} where sgs_id =
|
#{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSets">
|
update yeshi_ec_shop_goods_set
|
<set>
|
<if test="name != null">sgs_name=#{name,jdbcType=VARCHAR},</if>
|
<if test="goods != null">sgs_goods_id=#{goods.id,jdbcType=BIGINT},</if>
|
<if test="originalPrice != null">sgs_original_price=#{originalPrice,jdbcType=DECIMAL},
|
</if>
|
<if test="zkPrice != null">sgs_zk_price=#{zkPrice,jdbcType=DECIMAL},</if>
|
<if test="salesCount != null">sgs_sales_count=#{salesCount,jdbcType=BIGINT},</if>
|
<if test="stock != null">sgs_stock=#{stock,jdbcType=INTEGER},</if>
|
<if test="chargeFuLuNum != null">sgs_charge_fulu_num=#{chargeFuLuNum,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">sgs_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">sgs_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
<if test="weight !=null">sgs_weight =#{weight,jdbcType=INTEGER},</if>
|
<if test="subName !=null">sgs_sub_name =#{subName,jdbcType=VARCHAR},</if>
|
<if test="state !=null">sgs_state =#{state,jdbcType=INTEGER},</if>
|
</set>
|
where sgs_id = #{id,jdbcType=BIGINT}
|
</update>
|
</mapper>
|