Files
wx-cashier-service/src/main/resources/mapper/TbShopTableMapper.xml
韩鹏辉 b77eacdccb 提交
2024-03-21 10:22:29 +08:00

233 lines
8.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.TbShopTableMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbShopTable">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="shop_id" jdbcType="INTEGER" property="shopId" />
<result column="max_capacity" jdbcType="INTEGER" property="maxCapacity" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="area_id" jdbcType="INTEGER" property="areaId" />
<result column="is_predate" jdbcType="TINYINT" property="isPredate" />
<result column="predate_amount" jdbcType="DECIMAL" property="predateAmount" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="amount" jdbcType="DECIMAL" property="amount" />
<result column="perhour" jdbcType="DECIMAL" property="perhour" />
<result column="view" jdbcType="VARCHAR" property="view" />
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
<result column="qrcode" jdbcType="VARCHAR" property="qrcode" />
</resultMap>
<sql id="Base_Column_List">
id, name, shop_id, max_capacity, sort, area_id, is_predate, predate_amount, status,
type, amount, perhour, view, created_at, updated_at,qrcode
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tb_shop_table
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectQRcode" resultType="com.chaozhanggui.system.cashierservice.entity.TbShopTable">
select
<include refid="Base_Column_List" />
from tb_shop_table
where qrcode = #{qrcode}
</select>
<select id="selectShopTableById" resultType="com.chaozhanggui.system.cashierservice.entity.TbShopTable">
select
a.id, a.name, a.shop_id, a.max_capacity, a.sort, a.area_id, a.is_predate, a.predate_amount, a.status,
a.type, a.amount, a.perhour, a.view, a.created_at, a.updated_at,a.qrcode,b.name as areaname
from tb_shop_table a
left join tb_shop_area b ON a.area_id=b.id
where a.shop_id = #{shopId}
<if test="areaId != null ">
and a.area_id = #{areaId}
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_shop_table
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopTable">
insert into tb_shop_table (id, name, shop_id,
max_capacity, sort, area_id,
is_predate, predate_amount, status,
type, amount, perhour,
view, created_at, updated_at
)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{shopId,jdbcType=INTEGER},
#{maxCapacity,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER}, #{areaId,jdbcType=INTEGER},
#{isPredate,jdbcType=TINYINT}, #{predateAmount,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR},
#{type,jdbcType=TINYINT}, #{amount,jdbcType=DECIMAL}, #{perhour,jdbcType=DECIMAL},
#{view,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopTable">
insert into tb_shop_table
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="shopId != null">
shop_id,
</if>
<if test="maxCapacity != null">
max_capacity,
</if>
<if test="sort != null">
sort,
</if>
<if test="areaId != null">
area_id,
</if>
<if test="isPredate != null">
is_predate,
</if>
<if test="predateAmount != null">
predate_amount,
</if>
<if test="status != null">
status,
</if>
<if test="type != null">
type,
</if>
<if test="amount != null">
amount,
</if>
<if test="perhour != null">
perhour,
</if>
<if test="view != null">
view,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</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="shopId != null">
#{shopId,jdbcType=INTEGER},
</if>
<if test="maxCapacity != null">
#{maxCapacity,jdbcType=INTEGER},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="areaId != null">
#{areaId,jdbcType=INTEGER},
</if>
<if test="isPredate != null">
#{isPredate,jdbcType=TINYINT},
</if>
<if test="predateAmount != null">
#{predateAmount,jdbcType=DECIMAL},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=TINYINT},
</if>
<if test="amount != null">
#{amount,jdbcType=DECIMAL},
</if>
<if test="perhour != null">
#{perhour,jdbcType=DECIMAL},
</if>
<if test="view != null">
#{view,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopTable">
update tb_shop_table
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=INTEGER},
</if>
<if test="maxCapacity != null">
max_capacity = #{maxCapacity,jdbcType=INTEGER},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="areaId != null">
area_id = #{areaId,jdbcType=INTEGER},
</if>
<if test="isPredate != null">
is_predate = #{isPredate,jdbcType=TINYINT},
</if>
<if test="predateAmount != null">
predate_amount = #{predateAmount,jdbcType=DECIMAL},
</if>
<if test="status != null">
status = #{status,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=TINYINT},
</if>
<if test="amount != null">
amount = #{amount,jdbcType=DECIMAL},
</if>
<if test="perhour != null">
perhour = #{perhour,jdbcType=DECIMAL},
</if>
<if test="view != null">
view = #{view,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=BIGINT},
</if>
<if test="qrcode != null">
qrcode = #{qrcode},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopTable">
update tb_shop_table
set name = #{name,jdbcType=VARCHAR},
shop_id = #{shopId,jdbcType=INTEGER},
max_capacity = #{maxCapacity,jdbcType=INTEGER},
sort = #{sort,jdbcType=INTEGER},
area_id = #{areaId,jdbcType=INTEGER},
is_predate = #{isPredate,jdbcType=TINYINT},
predate_amount = #{predateAmount,jdbcType=DECIMAL},
status = #{status,jdbcType=VARCHAR},
type = #{type,jdbcType=TINYINT},
amount = #{amount,jdbcType=DECIMAL},
perhour = #{perhour,jdbcType=DECIMAL},
view = #{view,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=BIGINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>