修改库存
This commit is contained in:
110
src/main/resources/mapper/TbProskuConMapper.xml
Normal file
110
src/main/resources/mapper/TbProskuConMapper.xml
Normal file
@@ -0,0 +1,110 @@
|
||||
<?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.chaozhanggui.system.cashierservice.dao.TbProskuConMapper">
|
||||
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbProskuCon">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="shop_id" jdbcType="INTEGER" property="shopId" />
|
||||
<result column="product_sku_id" jdbcType="INTEGER" property="productSkuId" />
|
||||
<result column="con_info_id" jdbcType="INTEGER" property="conInfoId" />
|
||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, shop_id, product_sku_id, con_info_id, status, create_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from tb_prosku_con
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from tb_prosku_con
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbProskuCon">
|
||||
insert into tb_prosku_con (id, shop_id, product_sku_id,
|
||||
con_info_id, status, create_time
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER}, #{productSkuId,jdbcType=INTEGER},
|
||||
#{conInfoId,jdbcType=INTEGER}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbProskuCon">
|
||||
insert into tb_prosku_con
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="shopId != null">
|
||||
shop_id,
|
||||
</if>
|
||||
<if test="productSkuId != null">
|
||||
product_sku_id,
|
||||
</if>
|
||||
<if test="conInfoId != null">
|
||||
con_info_id,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="shopId != null">
|
||||
#{shopId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="productSkuId != null">
|
||||
#{productSkuId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="conInfoId != null">
|
||||
#{conInfoId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbProskuCon">
|
||||
update tb_prosku_con
|
||||
<set>
|
||||
<if test="shopId != null">
|
||||
shop_id = #{shopId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="productSkuId != null">
|
||||
product_sku_id = #{productSkuId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="conInfoId != null">
|
||||
con_info_id = #{conInfoId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbProskuCon">
|
||||
update tb_prosku_con
|
||||
set shop_id = #{shopId,jdbcType=INTEGER},
|
||||
product_sku_id = #{productSkuId,jdbcType=INTEGER},
|
||||
con_info_id = #{conInfoId,jdbcType=INTEGER},
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<select id="selectBySkuIdAndShopId" resultMap="BaseResultMap">
|
||||
select * from tb_prosku_con where product_sku_id=#{shopId} and shop_id=#{shopId} and status=1
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user