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

188 lines
6.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.TbShopPurveyorMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbShopPurveyor">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="shop_id" jdbcType="VARCHAR" property="shopId" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="purveyor_name" jdbcType="VARCHAR" property="purveyorName" />
<result column="purveyor_telephone" jdbcType="VARCHAR" property="purveyorTelephone" />
<result column="period" jdbcType="INTEGER" property="period" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="tip" jdbcType="VARCHAR" property="tip" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
<result column="last_transact_at" jdbcType="BIGINT" property="lastTransactAt" />
</resultMap>
<sql id="Base_Column_List">
id, shop_id, sort, name, purveyor_name, purveyor_telephone, period, address, tip,
remark, created_at, updated_at, last_transact_at
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tb_shop_purveyor
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_shop_purveyor
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopPurveyor">
insert into tb_shop_purveyor (id, shop_id, sort,
name, purveyor_name, purveyor_telephone,
period, address, tip,
remark, created_at, updated_at,
last_transact_at)
values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER},
#{name,jdbcType=VARCHAR}, #{purveyorName,jdbcType=VARCHAR}, #{purveyorTelephone,jdbcType=VARCHAR},
#{period,jdbcType=INTEGER}, #{address,jdbcType=VARCHAR}, #{tip,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT},
#{lastTransactAt,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopPurveyor">
insert into tb_shop_purveyor
<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="purveyorName != null">
purveyor_name,
</if>
<if test="purveyorTelephone != null">
purveyor_telephone,
</if>
<if test="period != null">
period,
</if>
<if test="address != null">
address,
</if>
<if test="tip != null">
tip,
</if>
<if test="remark != null">
remark,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="lastTransactAt != null">
last_transact_at,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="shopId != null">
#{shopId,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="purveyorName != null">
#{purveyorName,jdbcType=VARCHAR},
</if>
<if test="purveyorTelephone != null">
#{purveyorTelephone,jdbcType=VARCHAR},
</if>
<if test="period != null">
#{period,jdbcType=INTEGER},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="tip != null">
#{tip,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=BIGINT},
</if>
<if test="lastTransactAt != null">
#{lastTransactAt,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopPurveyor">
update tb_shop_purveyor
<set>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="purveyorName != null">
purveyor_name = #{purveyorName,jdbcType=VARCHAR},
</if>
<if test="purveyorTelephone != null">
purveyor_telephone = #{purveyorTelephone,jdbcType=VARCHAR},
</if>
<if test="period != null">
period = #{period,jdbcType=INTEGER},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="tip != null">
tip = #{tip,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,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="lastTransactAt != null">
last_transact_at = #{lastTransactAt,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopPurveyor">
update tb_shop_purveyor
set shop_id = #{shopId,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
purveyor_name = #{purveyorName,jdbcType=VARCHAR},
purveyor_telephone = #{purveyorTelephone,jdbcType=VARCHAR},
period = #{period,jdbcType=INTEGER},
address = #{address,jdbcType=VARCHAR},
tip = #{tip,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=BIGINT},
last_transact_at = #{lastTransactAt,jdbcType=BIGINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>