|
@@ -0,0 +1,157 @@
|
|
|
+<?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.ams.erp.mapper.ErpBarcodesMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.ruoyi.ams.erp.domain.ErpBarcodes" id="ErpBarcodesResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="barcode" column="barcode" />
|
|
|
+ <result property="stockId" column="stock_id" />
|
|
|
+ <result property="locationNo" column="location_no" />
|
|
|
+ <result property="boxNo" column="box_no" />
|
|
|
+ <result property="lotnum" column="lotnum" />
|
|
|
+ <result property="qty" column="qty" />
|
|
|
+ <result property="type" column="type" />
|
|
|
+ <result property="erpNo" column="erp_no" />
|
|
|
+ <result property="erpName" column="erp_name" />
|
|
|
+ <result property="erpType" column="erp_type" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="userdefine1" column="userdefine1" />
|
|
|
+ <result property="userdefine2" column="userdefine2" />
|
|
|
+ <result property="userdefine3" column="userdefine3" />
|
|
|
+ <result property="userdefine4" column="userdefine4" />
|
|
|
+ <result property="userdefine5" column="userdefine5" />
|
|
|
+ <result property="userdefine6" column="userdefine6" />
|
|
|
+ <result property="userdefine7" column="userdefine7" />
|
|
|
+ <result property="userdefine8" column="userdefine8" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectErpBarcodesVo">
|
|
|
+ select id, barcode, stock_id, location_no, box_no, lotnum, qty, type, erp_no, erp_name, erp_type, create_time, create_by, update_time, update_by, userdefine1, userdefine2, userdefine3, userdefine4, userdefine5, userdefine6, userdefine7, userdefine8 from erp_barcodes
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectErpBarcodesList" parameterType="ErpBarcodes" resultMap="ErpBarcodesResult">
|
|
|
+ <include refid="selectErpBarcodesVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="barcode != null and barcode != ''"> and barcode = #{barcode}</if>
|
|
|
+ <if test="stockId != null and stockId != ''"> and stock_id = #{stockId}</if>
|
|
|
+ <if test="locationNo != null and locationNo != ''"> and location_no = #{locationNo}</if>
|
|
|
+ <if test="boxNo != null and boxNo != ''"> and box_no = #{boxNo}</if>
|
|
|
+ <if test="lotnum != null and lotnum != ''"> and lotnum = #{lotnum}</if>
|
|
|
+ <if test="qty != null "> and qty = #{qty}</if>
|
|
|
+ <if test="type != null and type != ''"> and type = #{type}</if>
|
|
|
+ <if test="erpNo != null and erpNo != ''"> and erp_no = #{erpNo}</if>
|
|
|
+ <if test="erpName != null and erpName != ''"> and erp_name like concat('%', #{erpName}, '%')</if>
|
|
|
+ <if test="erpType != null and erpType != ''"> and erp_type = #{erpType}</if>
|
|
|
+ <if test="userdefine1 != null and userdefine1 != ''"> and userdefine1 = #{userdefine1}</if>
|
|
|
+ <if test="userdefine2 != null and userdefine2 != ''"> and userdefine2 = #{userdefine2}</if>
|
|
|
+ <if test="userdefine3 != null and userdefine3 != ''"> and userdefine3 = #{userdefine3}</if>
|
|
|
+ <if test="userdefine4 != null and userdefine4 != ''"> and userdefine4 = #{userdefine4}</if>
|
|
|
+ <if test="userdefine5 != null and userdefine5 != ''"> and userdefine5 = #{userdefine5}</if>
|
|
|
+ <if test="userdefine6 != null and userdefine6 != ''"> and userdefine6 = #{userdefine6}</if>
|
|
|
+ <if test="userdefine7 != null and userdefine7 != ''"> and userdefine7 = #{userdefine7}</if>
|
|
|
+ <if test="userdefine8 != null and userdefine8 != ''"> and userdefine8 = #{userdefine8}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectErpBarcodesById" parameterType="Long" resultMap="ErpBarcodesResult">
|
|
|
+ <include refid="selectErpBarcodesVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertErpBarcodes" parameterType="ErpBarcodes" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into erp_barcodes
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="barcode != null">barcode,</if>
|
|
|
+ <if test="stockId != null">stock_id,</if>
|
|
|
+ <if test="locationNo != null">location_no,</if>
|
|
|
+ <if test="boxNo != null">box_no,</if>
|
|
|
+ <if test="lotnum != null">lotnum,</if>
|
|
|
+ <if test="qty != null">qty,</if>
|
|
|
+ <if test="type != null">type,</if>
|
|
|
+ <if test="erpNo != null">erp_no,</if>
|
|
|
+ <if test="erpName != null">erp_name,</if>
|
|
|
+ <if test="erpType != null">erp_type,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="userdefine1 != null">userdefine1,</if>
|
|
|
+ <if test="userdefine2 != null">userdefine2,</if>
|
|
|
+ <if test="userdefine3 != null">userdefine3,</if>
|
|
|
+ <if test="userdefine4 != null">userdefine4,</if>
|
|
|
+ <if test="userdefine5 != null">userdefine5,</if>
|
|
|
+ <if test="userdefine6 != null">userdefine6,</if>
|
|
|
+ <if test="userdefine7 != null">userdefine7,</if>
|
|
|
+ <if test="userdefine8 != null">userdefine8,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="barcode != null">#{barcode},</if>
|
|
|
+ <if test="stockId != null">#{stockId},</if>
|
|
|
+ <if test="locationNo != null">#{locationNo},</if>
|
|
|
+ <if test="boxNo != null">#{boxNo},</if>
|
|
|
+ <if test="lotnum != null">#{lotnum},</if>
|
|
|
+ <if test="qty != null">#{qty},</if>
|
|
|
+ <if test="type != null">#{type},</if>
|
|
|
+ <if test="erpNo != null">#{erpNo},</if>
|
|
|
+ <if test="erpName != null">#{erpName},</if>
|
|
|
+ <if test="erpType != null">#{erpType},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="userdefine1 != null">#{userdefine1},</if>
|
|
|
+ <if test="userdefine2 != null">#{userdefine2},</if>
|
|
|
+ <if test="userdefine3 != null">#{userdefine3},</if>
|
|
|
+ <if test="userdefine4 != null">#{userdefine4},</if>
|
|
|
+ <if test="userdefine5 != null">#{userdefine5},</if>
|
|
|
+ <if test="userdefine6 != null">#{userdefine6},</if>
|
|
|
+ <if test="userdefine7 != null">#{userdefine7},</if>
|
|
|
+ <if test="userdefine8 != null">#{userdefine8},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateErpBarcodes" parameterType="ErpBarcodes">
|
|
|
+ update erp_barcodes
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="barcode != null">barcode = #{barcode},</if>
|
|
|
+ <if test="stockId != null">stock_id = #{stockId},</if>
|
|
|
+ <if test="locationNo != null">location_no = #{locationNo},</if>
|
|
|
+ <if test="boxNo != null">box_no = #{boxNo},</if>
|
|
|
+ <if test="lotnum != null">lotnum = #{lotnum},</if>
|
|
|
+ <if test="qty != null">qty = #{qty},</if>
|
|
|
+ <if test="type != null">type = #{type},</if>
|
|
|
+ <if test="erpNo != null">erp_no = #{erpNo},</if>
|
|
|
+ <if test="erpName != null">erp_name = #{erpName},</if>
|
|
|
+ <if test="erpType != null">erp_type = #{erpType},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="userdefine1 != null">userdefine1 = #{userdefine1},</if>
|
|
|
+ <if test="userdefine2 != null">userdefine2 = #{userdefine2},</if>
|
|
|
+ <if test="userdefine3 != null">userdefine3 = #{userdefine3},</if>
|
|
|
+ <if test="userdefine4 != null">userdefine4 = #{userdefine4},</if>
|
|
|
+ <if test="userdefine5 != null">userdefine5 = #{userdefine5},</if>
|
|
|
+ <if test="userdefine6 != null">userdefine6 = #{userdefine6},</if>
|
|
|
+ <if test="userdefine7 != null">userdefine7 = #{userdefine7},</if>
|
|
|
+ <if test="userdefine8 != null">userdefine8 = #{userdefine8},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteErpBarcodesById" parameterType="Long">
|
|
|
+ delete from erp_barcodes where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteErpBarcodesByIds" parameterType="String">
|
|
|
+ delete from erp_barcodes where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|