Files
wx-cashier-service/src/main/resources/mapper/TbConsInfoMapper.xml
2024-08-20 15:53:09 +08:00

194 lines
7.2 KiB
XML

<?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="price" jdbcType="DECIMAL" property="price" />
<result column="stock_consume" jdbcType="DECIMAL" property="stockConsume" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="con_unit" jdbcType="VARCHAR" property="conUnit" />
<result column="laster_in_stock" jdbcType="DECIMAL" property="lasterInStock" />
<result column="con_warning" jdbcType="DECIMAL" property="conWarning" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_check" jdbcType="VARCHAR" property="isCheck" />
</resultMap>
<sql id="Base_Column_List">
id, shop_id, con_type_id, con_type_name, con_code, con_name, stock_number,price,stock_consume,status, con_unit,
laster_in_stock, con_warning, create_time, update_time,is_check
</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, laster_in_stock,
con_warning, 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}, #{lasterInStock,jdbcType=DECIMAL},
#{conWarning,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="lasterInStock != null">
laster_in_stock,
</if>
<if test="conWarning != null">
con_warning,
</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="lasterInStock != null">
#{lasterInStock,jdbcType=DECIMAL},
</if>
<if test="conWarning != null">
#{conWarning,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="lasterInStock != null">
laster_in_stock = #{lasterInStock,jdbcType=DECIMAL},
</if>
<if test="conWarning != null">
con_warning = #{conWarning,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},
laster_in_stock = #{lasterInStock,jdbcType=DECIMAL},
con_warning = #{conWarning,jdbcType=DECIMAL},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
stock_consume=#{stockConsume,jdbcType=DECIMAL}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="countAll" resultType="int">
select count(id) from tb_cons_info
</select>
<select id="selectAllInfo" resultType="com.chaozhanggui.system.cashierservice.entity.TbConsInfo">
select * from tb_cons_info order by id desc
</select>
</mapper>