Files
cashier-client/src/main/resources/mapper/TbShopAreaMapper.xml
韩鹏辉 b96a251fd8 提交
2024-03-21 10:17:54 +08:00

163 lines
5.8 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.TbShopAreaMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbShopArea">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="shop_id" jdbcType="INTEGER" property="shopId" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="price" jdbcType="INTEGER" property="price" />
<result column="capacity_range" jdbcType="VARCHAR" property="capacityRange" />
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.chaozhanggui.system.cashierservice.entity.TbShopArea">
<result column="view" jdbcType="LONGVARCHAR" property="view" />
</resultMap>
<sql id="Base_Column_List">
id, shop_id, sort, name, price, capacity_range, created_at, updated_at
</sql>
<sql id="Blob_Column_List">
view
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from tb_shop_area
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_shop_area
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopArea">
insert into tb_shop_area (id, shop_id, sort,
name, price, capacity_range,
created_at, updated_at, view
)
values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER},
#{name,jdbcType=VARCHAR}, #{price,jdbcType=INTEGER}, #{capacityRange,jdbcType=VARCHAR},
#{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{view,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopArea">
insert into tb_shop_area
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="shopId != null">
shop_id,
</if>
<if test="sort != null">
sort,
</if>
<if test="name != null">
name,
</if>
<if test="price != null">
price,
</if>
<if test="capacityRange != null">
capacity_range,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="view != null">
view,
</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="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="price != null">
#{price,jdbcType=INTEGER},
</if>
<if test="capacityRange != null">
#{capacityRange,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=BIGINT},
</if>
<if test="view != null">
#{view,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopArea">
update tb_shop_area
<set>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=INTEGER},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="price != null">
price = #{price,jdbcType=INTEGER},
</if>
<if test="capacityRange != null">
capacity_range = #{capacityRange,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="view != null">
view = #{view,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopArea">
update tb_shop_area
set shop_id = #{shopId,jdbcType=INTEGER},
sort = #{sort,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
price = #{price,jdbcType=INTEGER},
capacity_range = #{capacityRange,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=BIGINT},
view = #{view,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopArea">
update tb_shop_area
set shop_id = #{shopId,jdbcType=INTEGER},
sort = #{sort,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
price = #{price,jdbcType=INTEGER},
capacity_range = #{capacityRange,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=BIGINT}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByShopId" resultMap="BaseResultMap">
select * from tb_shop_area where shop_id=#{shopId} order by `sort` asc
</select>
</mapper>