277 lines
10 KiB
XML
277 lines
10 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.TbPrintMachineMapper">
|
|
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbPrintMachine">
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
|
<result column="connection_type" jdbcType="VARCHAR" property="connectionType" />
|
|
<result column="address" jdbcType="VARCHAR" property="address" />
|
|
<result column="port" jdbcType="VARCHAR" property="port" />
|
|
<result column="sub_type" jdbcType="VARCHAR" property="subType" />
|
|
<result column="status" jdbcType="TINYINT" property="status" />
|
|
<result column="shop_id" jdbcType="VARCHAR" property="shopId" />
|
|
<result column="category_ids" jdbcType="VARCHAR" property="categoryIds" />
|
|
<result column="content_type" jdbcType="VARCHAR" property="contentType" />
|
|
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
|
|
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
|
|
<result column="sort" jdbcType="INTEGER" property="sort" />
|
|
<result column="vendor_id" jdbcType="VARCHAR" property="vendorId" />
|
|
<result column="product_id" jdbcType="VARCHAR" property="productId" />
|
|
</resultMap>
|
|
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.chaozhanggui.system.cashierservice.entity.TbPrintMachineWithBLOBs">
|
|
<result column="config" jdbcType="LONGVARCHAR" property="config" />
|
|
<result column="category_list" jdbcType="LONGVARCHAR" property="categoryList" />
|
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
|
id, name, type, connection_type, address, port, sub_type, status, shop_id, category_ids,
|
|
content_type, created_at, updated_at, sort, vendor_id, product_id
|
|
</sql>
|
|
<sql id="Blob_Column_List">
|
|
config, category_list
|
|
</sql>
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
,
|
|
<include refid="Blob_Column_List" />
|
|
from tb_print_machine
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
delete from tb_print_machine
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</delete>
|
|
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbPrintMachineWithBLOBs">
|
|
insert into tb_print_machine (id, name, type,
|
|
connection_type, address, port,
|
|
sub_type, status, shop_id,
|
|
category_ids, content_type, created_at,
|
|
updated_at, sort, vendor_id,
|
|
product_id, config, category_list
|
|
)
|
|
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
|
#{connectionType,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{port,jdbcType=VARCHAR},
|
|
#{subType,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, #{shopId,jdbcType=VARCHAR},
|
|
#{categoryIds,jdbcType=VARCHAR}, #{contentType,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT},
|
|
#{updatedAt,jdbcType=BIGINT}, #{sort,jdbcType=INTEGER}, #{vendorId,jdbcType=VARCHAR},
|
|
#{productId,jdbcType=VARCHAR}, #{config,jdbcType=LONGVARCHAR}, #{categoryList,jdbcType=LONGVARCHAR}
|
|
)
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbPrintMachineWithBLOBs">
|
|
insert into tb_print_machine
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
id,
|
|
</if>
|
|
<if test="name != null">
|
|
name,
|
|
</if>
|
|
<if test="type != null">
|
|
type,
|
|
</if>
|
|
<if test="connectionType != null">
|
|
connection_type,
|
|
</if>
|
|
<if test="address != null">
|
|
address,
|
|
</if>
|
|
<if test="port != null">
|
|
port,
|
|
</if>
|
|
<if test="subType != null">
|
|
sub_type,
|
|
</if>
|
|
<if test="status != null">
|
|
status,
|
|
</if>
|
|
<if test="shopId != null">
|
|
shop_id,
|
|
</if>
|
|
<if test="categoryIds != null">
|
|
category_ids,
|
|
</if>
|
|
<if test="contentType != null">
|
|
content_type,
|
|
</if>
|
|
<if test="createdAt != null">
|
|
created_at,
|
|
</if>
|
|
<if test="updatedAt != null">
|
|
updated_at,
|
|
</if>
|
|
<if test="sort != null">
|
|
sort,
|
|
</if>
|
|
<if test="vendorId != null">
|
|
vendor_id,
|
|
</if>
|
|
<if test="productId != null">
|
|
product_id,
|
|
</if>
|
|
<if test="config != null">
|
|
config,
|
|
</if>
|
|
<if test="categoryList != null">
|
|
category_list,
|
|
</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="type != null">
|
|
#{type,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="connectionType != null">
|
|
#{connectionType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="address != null">
|
|
#{address,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="port != null">
|
|
#{port,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="subType != null">
|
|
#{subType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="status != null">
|
|
#{status,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="shopId != null">
|
|
#{shopId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="categoryIds != null">
|
|
#{categoryIds,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="contentType != null">
|
|
#{contentType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createdAt != null">
|
|
#{createdAt,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="updatedAt != null">
|
|
#{updatedAt,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="sort != null">
|
|
#{sort,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="vendorId != null">
|
|
#{vendorId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="productId != null">
|
|
#{productId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="config != null">
|
|
#{config,jdbcType=LONGVARCHAR},
|
|
</if>
|
|
<if test="categoryList != null">
|
|
#{categoryList,jdbcType=LONGVARCHAR},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbPrintMachineWithBLOBs">
|
|
update tb_print_machine
|
|
<set>
|
|
<if test="name != null">
|
|
name = #{name,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="type != null">
|
|
type = #{type,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="connectionType != null">
|
|
connection_type = #{connectionType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="address != null">
|
|
address = #{address,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="port != null">
|
|
port = #{port,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="subType != null">
|
|
sub_type = #{subType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="status != null">
|
|
status = #{status,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="shopId != null">
|
|
shop_id = #{shopId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="categoryIds != null">
|
|
category_ids = #{categoryIds,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="contentType != null">
|
|
content_type = #{contentType,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="sort != null">
|
|
sort = #{sort,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="vendorId != null">
|
|
vendor_id = #{vendorId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="productId != null">
|
|
product_id = #{productId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="config != null">
|
|
config = #{config,jdbcType=LONGVARCHAR},
|
|
</if>
|
|
<if test="categoryList != null">
|
|
category_list = #{categoryList,jdbcType=LONGVARCHAR},
|
|
</if>
|
|
</set>
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.chaozhanggui.system.cashierservice.entity.TbPrintMachineWithBLOBs">
|
|
update tb_print_machine
|
|
set name = #{name,jdbcType=VARCHAR},
|
|
type = #{type,jdbcType=VARCHAR},
|
|
connection_type = #{connectionType,jdbcType=VARCHAR},
|
|
address = #{address,jdbcType=VARCHAR},
|
|
port = #{port,jdbcType=VARCHAR},
|
|
sub_type = #{subType,jdbcType=VARCHAR},
|
|
status = #{status,jdbcType=TINYINT},
|
|
shop_id = #{shopId,jdbcType=VARCHAR},
|
|
category_ids = #{categoryIds,jdbcType=VARCHAR},
|
|
content_type = #{contentType,jdbcType=VARCHAR},
|
|
created_at = #{createdAt,jdbcType=BIGINT},
|
|
updated_at = #{updatedAt,jdbcType=BIGINT},
|
|
sort = #{sort,jdbcType=INTEGER},
|
|
vendor_id = #{vendorId,jdbcType=VARCHAR},
|
|
product_id = #{productId,jdbcType=VARCHAR},
|
|
config = #{config,jdbcType=LONGVARCHAR},
|
|
category_list = #{categoryList,jdbcType=LONGVARCHAR}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbPrintMachine">
|
|
update tb_print_machine
|
|
set name = #{name,jdbcType=VARCHAR},
|
|
type = #{type,jdbcType=VARCHAR},
|
|
connection_type = #{connectionType,jdbcType=VARCHAR},
|
|
address = #{address,jdbcType=VARCHAR},
|
|
port = #{port,jdbcType=VARCHAR},
|
|
sub_type = #{subType,jdbcType=VARCHAR},
|
|
status = #{status,jdbcType=TINYINT},
|
|
shop_id = #{shopId,jdbcType=VARCHAR},
|
|
category_ids = #{categoryIds,jdbcType=VARCHAR},
|
|
content_type = #{contentType,jdbcType=VARCHAR},
|
|
created_at = #{createdAt,jdbcType=BIGINT},
|
|
updated_at = #{updatedAt,jdbcType=BIGINT},
|
|
sort = #{sort,jdbcType=INTEGER},
|
|
vendor_id = #{vendorId,jdbcType=VARCHAR},
|
|
product_id = #{productId,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
|
|
<select id="selectByShopId" resultMap="ResultMapWithBLOBs">
|
|
select * from tb_print_machine where shop_id=#{shopId} and status=1
|
|
</select>
|
|
</mapper> |