修改库存

This commit is contained in:
韩鹏辉
2024-06-25 09:58:47 +08:00
parent 86bdcbe3c5
commit 8fc41c1b07
12 changed files with 1036 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbConsInfoFlow;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbConsInfoFlowMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbConsInfoFlow record);
int insertSelective(TbConsInfoFlow record);
TbConsInfoFlow selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbConsInfoFlow record);
int updateByPrimaryKey(TbConsInfoFlow record);
void insertBatch(@Param("list")List<TbConsInfoFlow> list);
}

View File

@@ -0,0 +1,25 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbConsInfo;
import com.chaozhanggui.system.cashierservice.entity.po.ConsInfoPO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public interface TbConsInfoMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbConsInfo record);
int insertSelective(TbConsInfo record);
TbConsInfo selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbConsInfo record);
int updateByPrimaryKey(TbConsInfo record);
void batchStock(@Param("list")List<ConsInfoPO> list);
}

View File

@@ -0,0 +1,17 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbCouponCategory;
public interface TbCouponCategoryMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbCouponCategory record);
int insertSelective(TbCouponCategory record);
TbCouponCategory selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbCouponCategory record);
int updateByPrimaryKey(TbCouponCategory record);
}

View File

@@ -0,0 +1,26 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbProskuCon;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbProskuConMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbProskuCon record);
int insertSelective(TbProskuCon record);
TbProskuCon selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbProskuCon record);
int updateByPrimaryKey(TbProskuCon record);
List<TbProskuCon> selectBySkuIdAndShopId(@Param("skuId") Integer skuId, @Param("shopId") Integer shopId);
}

View File

@@ -0,0 +1,129 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class TbConsInfo implements Serializable {
private Integer id;
private Integer shopId;
private Integer conTypeId;
private String conTypeName;
private String conCode;
private String conName;
private BigDecimal stockNumber;
private String conUnit;
private BigDecimal surplusStock;
private BigDecimal lasterInStock;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getShopId() {
return shopId;
}
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
public Integer getConTypeId() {
return conTypeId;
}
public void setConTypeId(Integer conTypeId) {
this.conTypeId = conTypeId;
}
public String getConTypeName() {
return conTypeName;
}
public void setConTypeName(String conTypeName) {
this.conTypeName = conTypeName == null ? null : conTypeName.trim();
}
public String getConCode() {
return conCode;
}
public void setConCode(String conCode) {
this.conCode = conCode == null ? null : conCode.trim();
}
public String getConName() {
return conName;
}
public void setConName(String conName) {
this.conName = conName == null ? null : conName.trim();
}
public BigDecimal getStockNumber() {
return stockNumber;
}
public void setStockNumber(BigDecimal stockNumber) {
this.stockNumber = stockNumber;
}
public String getConUnit() {
return conUnit;
}
public void setConUnit(String conUnit) {
this.conUnit = conUnit == null ? null : conUnit.trim();
}
public BigDecimal getSurplusStock() {
return surplusStock;
}
public void setSurplusStock(BigDecimal surplusStock) {
this.surplusStock = surplusStock;
}
public BigDecimal getLasterInStock() {
return lasterInStock;
}
public void setLasterInStock(BigDecimal lasterInStock) {
this.lasterInStock = lasterInStock;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

View File

@@ -0,0 +1,119 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class TbConsInfoFlow implements Serializable {
private Integer id;
private Integer shopId;
private Integer consId;
private String conName;
private BigDecimal amount;
private BigDecimal balance;
private String bizCode;
private String bizName;
private String bizType;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getShopId() {
return shopId;
}
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
public Integer getConsId() {
return consId;
}
public void setConsId(Integer consId) {
this.consId = consId;
}
public String getConName() {
return conName;
}
public void setConName(String conName) {
this.conName = conName == null ? null : conName.trim();
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public BigDecimal getBalance() {
return balance;
}
public void setBalance(BigDecimal balance) {
this.balance = balance;
}
public String getBizCode() {
return bizCode;
}
public void setBizCode(String bizCode) {
this.bizCode = bizCode == null ? null : bizCode.trim();
}
public String getBizName() {
return bizName;
}
public void setBizName(String bizName) {
this.bizName = bizName == null ? null : bizName.trim();
}
public String getBizType() {
return bizType;
}
public void setBizType(String bizType) {
this.bizType = bizType == null ? null : bizType.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

View File

@@ -0,0 +1,58 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.util.Date;
public class TbCouponCategory implements Serializable {
private Integer id;
private String name;
private Date createTime;
private Date updateTime;
private Integer status;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}

View File

@@ -0,0 +1,68 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.util.Date;
public class TbProskuCon implements Serializable {
private Integer id;
private Integer shopId;
private Integer productSkuId;
private Integer conInfoId;
private String status;
private Date createTime;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getShopId() {
return shopId;
}
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
public Integer getProductSkuId() {
return productSkuId;
}
public void setProductSkuId(Integer productSkuId) {
this.productSkuId = productSkuId;
}
public Integer getConInfoId() {
return conInfoId;
}
public void setConInfoId(Integer conInfoId) {
this.conInfoId = conInfoId;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@@ -0,0 +1,178 @@
<?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.TbConsInfoFlowMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbConsInfoFlow">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="shop_id" jdbcType="INTEGER" property="shopId" />
<result column="cons_id" jdbcType="INTEGER" property="consId" />
<result column="con_name" jdbcType="VARCHAR" property="conName" />
<result column="amount" jdbcType="DECIMAL" property="amount" />
<result column="balance" jdbcType="DECIMAL" property="balance" />
<result column="biz_code" jdbcType="VARCHAR" property="bizCode" />
<result column="biz_name" jdbcType="VARCHAR" property="bizName" />
<result column="biz_type" jdbcType="VARCHAR" property="bizType" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id, shop_id, cons_id, con_name, amount, balance, biz_code, biz_name, biz_type, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tb_cons_info_flow
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_cons_info_flow
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbConsInfoFlow">
insert into tb_cons_info_flow (id, shop_id, cons_id,
con_name, amount, balance,
biz_code, biz_name, biz_type,
create_time, update_time)
values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER}, #{consId,jdbcType=INTEGER},
#{conName,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{balance,jdbcType=DECIMAL},
#{bizCode,jdbcType=VARCHAR}, #{bizName,jdbcType=VARCHAR}, #{bizType,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbConsInfoFlow">
insert into tb_cons_info_flow
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="shopId != null">
shop_id,
</if>
<if test="consId != null">
cons_id,
</if>
<if test="conName != null">
con_name,
</if>
<if test="amount != null">
amount,
</if>
<if test="balance != null">
balance,
</if>
<if test="bizCode != null">
biz_code,
</if>
<if test="bizName != null">
biz_name,
</if>
<if test="bizType != null">
biz_type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_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="consId != null">
#{consId,jdbcType=INTEGER},
</if>
<if test="conName != null">
#{conName,jdbcType=VARCHAR},
</if>
<if test="amount != null">
#{amount,jdbcType=DECIMAL},
</if>
<if test="balance != null">
#{balance,jdbcType=DECIMAL},
</if>
<if test="bizCode != null">
#{bizCode,jdbcType=VARCHAR},
</if>
<if test="bizName != null">
#{bizName,jdbcType=VARCHAR},
</if>
<if test="bizType != null">
#{bizType,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbConsInfoFlow">
update tb_cons_info_flow
<set>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=INTEGER},
</if>
<if test="consId != null">
cons_id = #{consId,jdbcType=INTEGER},
</if>
<if test="conName != null">
con_name = #{conName,jdbcType=VARCHAR},
</if>
<if test="amount != null">
amount = #{amount,jdbcType=DECIMAL},
</if>
<if test="balance != null">
balance = #{balance,jdbcType=DECIMAL},
</if>
<if test="bizCode != null">
biz_code = #{bizCode,jdbcType=VARCHAR},
</if>
<if test="bizName != null">
biz_name = #{bizName,jdbcType=VARCHAR},
</if>
<if test="bizType != null">
biz_type = #{bizType,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbConsInfoFlow">
update tb_cons_info_flow
set shop_id = #{shopId,jdbcType=INTEGER},
cons_id = #{consId,jdbcType=INTEGER},
con_name = #{conName,jdbcType=VARCHAR},
amount = #{amount,jdbcType=DECIMAL},
balance = #{balance,jdbcType=DECIMAL},
biz_code = #{bizCode,jdbcType=VARCHAR},
biz_name = #{bizName,jdbcType=VARCHAR},
biz_type = #{bizType,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<insert id="insertBatch">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
insert into tb_cons_info_flow (shop_id, cons_id,
con_name, amount, balance,
biz_code, biz_name, biz_type,
create_time, update_time)
values #{item.shopId,jdbcType=INTEGER}, #{item.consId,jdbcType=INTEGER},
#{item.conName,jdbcType=VARCHAR}, #{item.amount,jdbcType=DECIMAL}, #{item.balance,jdbcType=DECIMAL},
#{item.bizCode,jdbcType=VARCHAR}, #{item.bizName,jdbcType=VARCHAR}, #{item.bizType,jdbcType=VARCHAR},
#{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP})
</foreach>
</insert>
</mapper>

View File

@@ -0,0 +1,187 @@
<?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.TbConsInfoMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbConsInfo">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="shop_id" jdbcType="INTEGER" property="shopId" />
<result column="con_type_id" jdbcType="INTEGER" property="conTypeId" />
<result column="con_type_name" jdbcType="VARCHAR" property="conTypeName" />
<result column="con_code" jdbcType="VARCHAR" property="conCode" />
<result column="con_name" jdbcType="VARCHAR" property="conName" />
<result column="stock_number" jdbcType="DECIMAL" property="stockNumber" />
<result column="con_unit" jdbcType="VARCHAR" property="conUnit" />
<result column="surplus_stock" jdbcType="DECIMAL" property="surplusStock" />
<result column="laster_in_stock" jdbcType="DECIMAL" property="lasterInStock" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id, shop_id, con_type_id, con_type_name, con_code, con_name, stock_number, con_unit,
surplus_stock, laster_in_stock, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tb_cons_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_cons_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbConsInfo">
insert into tb_cons_info (id, shop_id, con_type_id,
con_type_name, con_code, con_name,
stock_number, con_unit, surplus_stock,
laster_in_stock, create_time, update_time
)
values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER}, #{conTypeId,jdbcType=INTEGER},
#{conTypeName,jdbcType=VARCHAR}, #{conCode,jdbcType=VARCHAR}, #{conName,jdbcType=VARCHAR},
#{stockNumber,jdbcType=DECIMAL}, #{conUnit,jdbcType=VARCHAR}, #{surplusStock,jdbcType=DECIMAL},
#{lasterInStock,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbConsInfo">
insert into tb_cons_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="shopId != null">
shop_id,
</if>
<if test="conTypeId != null">
con_type_id,
</if>
<if test="conTypeName != null">
con_type_name,
</if>
<if test="conCode != null">
con_code,
</if>
<if test="conName != null">
con_name,
</if>
<if test="stockNumber != null">
stock_number,
</if>
<if test="conUnit != null">
con_unit,
</if>
<if test="surplusStock != null">
surplus_stock,
</if>
<if test="lasterInStock != null">
laster_in_stock,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_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="conTypeId != null">
#{conTypeId,jdbcType=INTEGER},
</if>
<if test="conTypeName != null">
#{conTypeName,jdbcType=VARCHAR},
</if>
<if test="conCode != null">
#{conCode,jdbcType=VARCHAR},
</if>
<if test="conName != null">
#{conName,jdbcType=VARCHAR},
</if>
<if test="stockNumber != null">
#{stockNumber,jdbcType=DECIMAL},
</if>
<if test="conUnit != null">
#{conUnit,jdbcType=VARCHAR},
</if>
<if test="surplusStock != null">
#{surplusStock,jdbcType=DECIMAL},
</if>
<if test="lasterInStock != null">
#{lasterInStock,jdbcType=DECIMAL},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbConsInfo">
update tb_cons_info
<set>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=INTEGER},
</if>
<if test="conTypeId != null">
con_type_id = #{conTypeId,jdbcType=INTEGER},
</if>
<if test="conTypeName != null">
con_type_name = #{conTypeName,jdbcType=VARCHAR},
</if>
<if test="conCode != null">
con_code = #{conCode,jdbcType=VARCHAR},
</if>
<if test="conName != null">
con_name = #{conName,jdbcType=VARCHAR},
</if>
<if test="stockNumber != null">
stock_number = #{stockNumber,jdbcType=DECIMAL},
</if>
<if test="conUnit != null">
con_unit = #{conUnit,jdbcType=VARCHAR},
</if>
<if test="surplusStock != null">
surplus_stock = #{surplusStock,jdbcType=DECIMAL},
</if>
<if test="lasterInStock != null">
laster_in_stock = #{lasterInStock,jdbcType=DECIMAL},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbConsInfo">
update tb_cons_info
set shop_id = #{shopId,jdbcType=INTEGER},
con_type_id = #{conTypeId,jdbcType=INTEGER},
con_type_name = #{conTypeName,jdbcType=VARCHAR},
con_code = #{conCode,jdbcType=VARCHAR},
con_name = #{conName,jdbcType=VARCHAR},
stock_number = #{stockNumber,jdbcType=DECIMAL},
con_unit = #{conUnit,jdbcType=VARCHAR},
surplus_stock = #{surplusStock,jdbcType=DECIMAL},
laster_in_stock = #{lasterInStock,jdbcType=DECIMAL},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="batchStock">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update tb_cons_info
set stock_number= stock_number- #{item.amount},
update_time = now()
where id = #{item.id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,93 @@
<?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.TbCouponCategoryMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbCouponCategory">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<sql id="Base_Column_List">
id, name, create_time, update_time, status
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tb_coupon_category
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_coupon_category
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbCouponCategory">
insert into tb_coupon_category (id, name, create_time,
update_time, status)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbCouponCategory">
insert into tb_coupon_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="status != null">
status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbCouponCategory">
update tb_coupon_category
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbCouponCategory">
update tb_coupon_category
set name = #{name,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View 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>