Files
FT546MWS/ruoyi-admin/src/main/resources/mapper/bas/BasTraycodeFormatMapper.xml
1009473166@qq.com 0a021caba6 1
2026-07-31 10:16:48 +08:00

107 lines
5.6 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.ruoyi.bas.traycodeformat.mapper.BasTraycodeFormatMapper">
<resultMap type="BasTraycodeFormat" id="BasTraycodeFormatResult">
<result property="id" column="id" />
<result property="barcodeFormat" column="barcode_format" />
<result property="serialRule" column="serial_rule" />
<result property="serialExample" column="serial_example" />
<result property="remarks" column="remarks" />
<result property="minNum" column="min_num" />
<result property="maxNum" column="max_num" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare3" column="spare3" />
</resultMap>
<sql id="selectBasTraycodeFormatVo">
select id, barcode_format, serial_rule, serial_example, remarks, min_num, max_num, create_time, update_time, spare1, spare2, spare3 from bas_traycode_format
</sql>
<select id="selectBasTraycodeFormatList" parameterType="BasTraycodeFormat" resultMap="BasTraycodeFormatResult">
<include refid="selectBasTraycodeFormatVo"/>
<where>
<if test="barcodeFormat != null and barcodeFormat != ''"> and barcode_format like concat('%', #{barcodeFormat}, '%')</if>
<if test="serialRule != null and serialRule != ''"> and serial_rule like concat('%',#{serialRule}, '%')</if>
<if test="serialExample != null and serialExample != ''"> and serial_example like concat('%',#{serialExample}, '%')</if>
<if test="remarks != null and remarks != ''"> and remarks like concat('%',#{remarks}, '%')</if>
<if test="minNum != null "> and min_num like concat('%',#{minNum}, '%')</if>
<if test="maxNum != null "> and max_num like concat('%',#{maxNum}, '%')</if>
<if test="spare1 != null and spare1 != ''"> and spare1 like concat('%', #{spare1}, '%')</if>
<if test="spare2 != null and spare2 != ''"> and spare2 like concat('%', #{spare2}, '%')</if>
<if test="spare3 != null and spare3 != ''"> and spare3 like concat('%', #{spare3}, '%')</if>
</where>
</select>
<select id="selectBasTraycodeFormatById" parameterType="Long" resultMap="BasTraycodeFormatResult">
<include refid="selectBasTraycodeFormatVo"/>
where id = #{id}
</select>
<insert id="insertBasTraycodeFormat" parameterType="BasTraycodeFormat">
insert into bas_traycode_format
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="barcodeFormat != null">barcode_format,</if>
<if test="serialRule != null">serial_rule,</if>
<if test="serialExample != null">serial_example,</if>
<if test="remarks != null">remarks,</if>
<if test="minNum != null">min_num,</if>
<if test="maxNum != null">max_num,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="spare1 != null">spare1,</if>
<if test="spare2 != null">spare2,</if>
<if test="spare3 != null">spare3,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="barcodeFormat != null">#{barcodeFormat},</if>
<if test="serialRule != null">#{serialRule},</if>
<if test="serialExample != null">#{serialExample},</if>
<if test="remarks != null">#{remarks},</if>
<if test="minNum != null">#{minNum},</if>
<if test="maxNum != null">#{maxNum},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="spare1 != null">#{spare1},</if>
<if test="spare2 != null">#{spare2},</if>
<if test="spare3 != null">#{spare3},</if>
</trim>
</insert>
<update id="updateBasTraycodeFormat" parameterType="BasTraycodeFormat">
update bas_traycode_format
<trim prefix="SET" suffixOverrides=",">
<if test="barcodeFormat != null">barcode_format = #{barcodeFormat},</if>
<if test="serialRule != null">serial_rule = #{serialRule},</if>
<if test="serialExample != null">serial_example = #{serialExample},</if>
<if test="remarks != null">remarks = #{remarks},</if>
<if test="minNum != null">min_num = #{minNum},</if>
<if test="maxNum != null">max_num = #{maxNum},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="spare1 != null">spare1 = #{spare1},</if>
<if test="spare2 != null">spare2 = #{spare2},</if>
<if test="spare3 != null">spare3 = #{spare3},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBasTraycodeFormatById" parameterType="Long">
delete from bas_traycode_format where id = #{id}
</delete>
<delete id="deleteBasTraycodeFormatByIds" parameterType="String">
delete from bas_traycode_format where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>