|
@@ -0,0 +1,293 @@
|
|
|
+<?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.zkqy.business.mapper.ProductCodeAListMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.zkqy.business.domain.ProductCodeAList" id="ProductCodeAListResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="qrCode" column="qr_code" />
|
|
|
+ <result property="lotNum" column="lot_num" />
|
|
|
+ <result property="productId" column="product_id" />
|
|
|
+ <result property="productName" column="productName" />
|
|
|
+ <result property="productspecifications" column="productspecifications" />
|
|
|
+ <result property="productColour" column="product_colour" />
|
|
|
+ <result property="levels" column="levels" />
|
|
|
+ <result property="canisterNum" column="canister_num" />
|
|
|
+ <result property="boxNum" column="box_num" />
|
|
|
+ <result property="suttle" column="suttle" />
|
|
|
+ <result property="productionDate" column="production_date" />
|
|
|
+ <result property="machineTool" column="machine_tool" />
|
|
|
+ <result property="grossWeight" column="gross_weight" />
|
|
|
+ <result property="packaging" column="packaging" />
|
|
|
+ <result property="workShifts" column="work_shifts" />
|
|
|
+ <result property="foreignTradeNumber" column="foreign_trade_number" />
|
|
|
+ <result property="canisterWeight" column="canister_weight" />
|
|
|
+ <result property="boxWeight" column="box_weight" />
|
|
|
+ <result property="tubeColor" column="tube_color" />
|
|
|
+ <result property="comPort" column="com_port" />
|
|
|
+ <result property="printFormat" column="print_format" />
|
|
|
+ <result property="packagingType" column="packaging_type" />
|
|
|
+ <result property="storageLocation" column="storage_location" />
|
|
|
+ <result property="warehouseregionId" column="warehouseregion_id" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createById" column="create_by_id" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateById" column="update_by_id" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="totalCanisterNum" column="total_canister_num" />
|
|
|
+ <result property="totalBoxNum" column="total_box_num" />
|
|
|
+ <result property="totalSuttle" column="total_suttle" />
|
|
|
+ <result property="totalGrossWeight" column="total_gross_weight" />
|
|
|
+ <result property="withdrawingFlag" column="withdrawing_flag" />
|
|
|
+ <result property="saleProductId" column="sale_product_id" />
|
|
|
+ <result property="otherStates" column="other_states" />
|
|
|
+ <result property="parentCode" column="parent_code" />
|
|
|
+ <result property="qrCodeId" column="qr_code_id" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectProductCodeAListVo">
|
|
|
+ select id, qr_code, lot_num, product_id, product_colour, levels, canister_num, box_num, suttle, production_date, machine_tool, gross_weight, packaging, work_shifts, foreign_trade_number, canister_weight, box_weight, tube_color, com_port, print_format, packaging_type, storage_location, warehouseregion_id, remark, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time, total_canister_num, total_box_num, total_suttle, total_gross_weight, withdrawing_flag, sale_product_id, other_states, parent_code, qr_code_id from {DBNAME}.product_code_list
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <sql id="selectProductCodeAListVoproducts">
|
|
|
+ SELECT
|
|
|
+ a.id,
|
|
|
+ a.qr_code,
|
|
|
+ a.lot_num,
|
|
|
+ a.product_id,
|
|
|
+ b.product_name as productName,
|
|
|
+ b.product_specifications as productspecifications,
|
|
|
+ a.product_colour,
|
|
|
+ a.levels,
|
|
|
+ a.canister_num,
|
|
|
+ a.box_num,
|
|
|
+ a.suttle,
|
|
|
+ a.production_date,
|
|
|
+ a.machine_tool,
|
|
|
+ a.gross_weight,
|
|
|
+ a.packaging,
|
|
|
+ a.work_shifts,
|
|
|
+ a.foreign_trade_number,
|
|
|
+ a.canister_weight,
|
|
|
+ a.box_weight,
|
|
|
+ a.tube_color,
|
|
|
+ a.com_port,
|
|
|
+ a.print_format,
|
|
|
+ a.packaging_type,
|
|
|
+ a.storage_location,
|
|
|
+ a.warehouseregion_id,
|
|
|
+ a.remark,
|
|
|
+ a.del_flag,
|
|
|
+ a.create_by,
|
|
|
+ a.create_by_id,
|
|
|
+ a.create_time,
|
|
|
+ a.update_by,
|
|
|
+ a.update_by_id,
|
|
|
+ a.update_time,
|
|
|
+ a.total_canister_num,
|
|
|
+ a.total_box_num,
|
|
|
+ a.total_suttle,
|
|
|
+ a.total_gross_weight,
|
|
|
+ a.withdrawing_flag,
|
|
|
+ a.sale_product_id,
|
|
|
+ a.other_states,
|
|
|
+ a.parent_code,
|
|
|
+ a.qr_code_id
|
|
|
+ FROM
|
|
|
+ {DBNAME}.product_code_list a
|
|
|
+ LEFT JOIN {DBNAME}.production b ON a.product_id = b.id
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectProductCodeAListList" parameterType="com.zkqy.business.domain.ProductCodeAList" resultMap="ProductCodeAListResult">
|
|
|
+ <include refid="selectProductCodeAListVoproducts"/>
|
|
|
+ <where>
|
|
|
+ <if test="qrCode != null and qrCode != ''"> and a.qr_code = #{qrCode}</if>
|
|
|
+ <if test="lotNum != null and lotNum != ''"> and a.lot_num = #{lotNum}</if>
|
|
|
+ <if test="productId != null "> and a.product_id = #{productId}</if>
|
|
|
+ <if test="productColour != null and productColour != ''"> and a.product_colour = #{productColour}</if>
|
|
|
+ <if test="levels != null and levels != ''"> and a.levels = #{levels}</if>
|
|
|
+ <if test="canisterNum != null "> and a.canister_num = #{canisterNum}</if>
|
|
|
+ <if test="boxNum != null "> and a.box_num = #{boxNum}</if>
|
|
|
+ <if test="suttle != null "> and a.suttle = #{suttle}</if>
|
|
|
+ <if test="productionDate != null "> and a.production_date = #{productionDate}</if>
|
|
|
+ <if test="machineTool != null and machineTool != ''"> and a.machine_tool = #{machineTool}</if>
|
|
|
+ <if test="grossWeight != null "> and a.gross_weight = #{grossWeight}</if>
|
|
|
+ <if test="packaging != null and packaging != ''"> and a.packaging = #{packaging}</if>
|
|
|
+ <if test="workShifts != null and workShifts != ''"> and a.work_shifts = #{workShifts}</if>
|
|
|
+ <if test="foreignTradeNumber != null and foreignTradeNumber != ''"> and a.foreign_trade_number = #{foreignTradeNumber}</if>
|
|
|
+ <if test="canisterWeight != null "> and a.canister_weight = #{canisterWeight}</if>
|
|
|
+ <if test="boxWeight != null "> and a.box_weight = #{boxWeight}</if>
|
|
|
+ <if test="tubeColor != null and tubeColor != ''"> and a.tube_color = #{tubeColor}</if>
|
|
|
+ <if test="comPort != null and comPort != ''"> and a.com_port = #{comPort}</if>
|
|
|
+ <if test="printFormat != null and printFormat != ''"> and a.print_format = #{printFormat}</if>
|
|
|
+ <if test="packagingType != null and packagingType != ''"> and a.packaging_type = #{packagingType}</if>
|
|
|
+ <if test="storageLocation != null and storageLocation != ''"> and a.storage_location = #{storageLocation}</if>
|
|
|
+ <if test="warehouseregionId != null "> and a.warehouseregion_id = #{warehouseregionId}</if>
|
|
|
+ <if test="createById != null "> and a.create_by_id = #{createById}</if>
|
|
|
+ <if test="updateById != null "> and a.update_by_id = #{updateById}</if>
|
|
|
+ <if test="totalCanisterNum != null "> and a.total_canister_num = #{totalCanisterNum}</if>
|
|
|
+ <if test="totalBoxNum != null "> and a.total_box_num = #{totalBoxNum}</if>
|
|
|
+ <if test="totalSuttle != null "> and a.total_suttle = #{totalSuttle}</if>
|
|
|
+ <if test="totalGrossWeight != null "> and a.total_gross_weight = #{totalGrossWeight}</if>
|
|
|
+ <if test="withdrawingFlag != null and withdrawingFlag != ''"> and a.withdrawing_flag = #{withdrawingFlag}</if>
|
|
|
+ <if test="saleProductId != null and saleProductId != ''"> and a.sale_product_id = #{saleProductId}</if>
|
|
|
+ <if test="otherStates != null and otherStates != ''"> and a.other_states = #{otherStates}</if>
|
|
|
+ <if test="parentCode != null and parentCode != ''"> and a.parent_code = #{parentCode}</if>
|
|
|
+ <if test="qrCodeId != null and qrCodeId != ''"> and a.qr_code_id = #{qrCodeId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectProductCodeAListById" parameterType="Long" resultMap="ProductCodeAListResult">
|
|
|
+ <include refid="selectProductCodeAListVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertProductCodeAList" parameterType="com.zkqy.business.domain.ProductCodeAList">
|
|
|
+ insert into {DBNAME}.product_code_list
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="qrCode != null">qr_code,</if>
|
|
|
+ <if test="lotNum != null">lot_num,</if>
|
|
|
+ <if test="productId != null">product_id,</if>
|
|
|
+ <if test="productColour != null">product_colour,</if>
|
|
|
+ <if test="levels != null">levels,</if>
|
|
|
+ <if test="canisterNum != null">canister_num,</if>
|
|
|
+ <if test="boxNum != null">box_num,</if>
|
|
|
+ <if test="suttle != null">suttle,</if>
|
|
|
+ <if test="productionDate != null">production_date,</if>
|
|
|
+ <if test="machineTool != null">machine_tool,</if>
|
|
|
+ <if test="grossWeight != null">gross_weight,</if>
|
|
|
+ <if test="packaging != null">packaging,</if>
|
|
|
+ <if test="workShifts != null">work_shifts,</if>
|
|
|
+ <if test="foreignTradeNumber != null">foreign_trade_number,</if>
|
|
|
+ <if test="canisterWeight != null">canister_weight,</if>
|
|
|
+ <if test="boxWeight != null">box_weight,</if>
|
|
|
+ <if test="tubeColor != null">tube_color,</if>
|
|
|
+ <if test="comPort != null">com_port,</if>
|
|
|
+ <if test="printFormat != null">print_format,</if>
|
|
|
+ <if test="packagingType != null">packaging_type,</if>
|
|
|
+ <if test="storageLocation != null">storage_location,</if>
|
|
|
+ <if test="warehouseregionId != null">warehouseregion_id,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createById != null">create_by_id,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateById != null">update_by_id,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="totalCanisterNum != null">total_canister_num,</if>
|
|
|
+ <if test="totalBoxNum != null">total_box_num,</if>
|
|
|
+ <if test="totalSuttle != null">total_suttle,</if>
|
|
|
+ <if test="totalGrossWeight != null">total_gross_weight,</if>
|
|
|
+ <if test="withdrawingFlag != null">withdrawing_flag,</if>
|
|
|
+ <if test="saleProductId != null">sale_product_id,</if>
|
|
|
+ <if test="otherStates != null">other_states,</if>
|
|
|
+ <if test="parentCode != null">parent_code,</if>
|
|
|
+ <if test="qrCodeId != null">qr_code_id,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="qrCode != null">#{qrCode},</if>
|
|
|
+ <if test="lotNum != null">#{lotNum},</if>
|
|
|
+ <if test="productId != null">#{productId},</if>
|
|
|
+ <if test="productColour != null">#{productColour},</if>
|
|
|
+ <if test="levels != null">#{levels},</if>
|
|
|
+ <if test="canisterNum != null">#{canisterNum},</if>
|
|
|
+ <if test="boxNum != null">#{boxNum},</if>
|
|
|
+ <if test="suttle != null">#{suttle},</if>
|
|
|
+ <if test="productionDate != null">#{productionDate},</if>
|
|
|
+ <if test="machineTool != null">#{machineTool},</if>
|
|
|
+ <if test="grossWeight != null">#{grossWeight},</if>
|
|
|
+ <if test="packaging != null">#{packaging},</if>
|
|
|
+ <if test="workShifts != null">#{workShifts},</if>
|
|
|
+ <if test="foreignTradeNumber != null">#{foreignTradeNumber},</if>
|
|
|
+ <if test="canisterWeight != null">#{canisterWeight},</if>
|
|
|
+ <if test="boxWeight != null">#{boxWeight},</if>
|
|
|
+ <if test="tubeColor != null">#{tubeColor},</if>
|
|
|
+ <if test="comPort != null">#{comPort},</if>
|
|
|
+ <if test="printFormat != null">#{printFormat},</if>
|
|
|
+ <if test="packagingType != null">#{packagingType},</if>
|
|
|
+ <if test="storageLocation != null">#{storageLocation},</if>
|
|
|
+ <if test="warehouseregionId != null">#{warehouseregionId},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createById != null">#{createById},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateById != null">#{updateById},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="totalCanisterNum != null">#{totalCanisterNum},</if>
|
|
|
+ <if test="totalBoxNum != null">#{totalBoxNum},</if>
|
|
|
+ <if test="totalSuttle != null">#{totalSuttle},</if>
|
|
|
+ <if test="totalGrossWeight != null">#{totalGrossWeight},</if>
|
|
|
+ <if test="withdrawingFlag != null">#{withdrawingFlag},</if>
|
|
|
+ <if test="saleProductId != null">#{saleProductId},</if>
|
|
|
+ <if test="otherStates != null">#{otherStates},</if>
|
|
|
+ <if test="parentCode != null">#{parentCode},</if>
|
|
|
+ <if test="qrCodeId != null">#{qrCodeId},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateProductCodeAList" parameterType="com.zkqy.business.domain.ProductCodeAList">
|
|
|
+ update {DBNAME}.product_code_list
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="qrCode != null">qr_code = #{qrCode},</if>
|
|
|
+ <if test="lotNum != null">lot_num = #{lotNum},</if>
|
|
|
+ <if test="productId != null">product_id = #{productId},</if>
|
|
|
+ <if test="productColour != null">product_colour = #{productColour},</if>
|
|
|
+ <if test="levels != null">levels = #{levels},</if>
|
|
|
+ <if test="canisterNum != null">canister_num = #{canisterNum},</if>
|
|
|
+ <if test="boxNum != null">box_num = #{boxNum},</if>
|
|
|
+ <if test="suttle != null">suttle = #{suttle},</if>
|
|
|
+ <if test="productionDate != null">production_date = #{productionDate},</if>
|
|
|
+ <if test="machineTool != null">machine_tool = #{machineTool},</if>
|
|
|
+ <if test="grossWeight != null">gross_weight = #{grossWeight},</if>
|
|
|
+ <if test="packaging != null">packaging = #{packaging},</if>
|
|
|
+ <if test="workShifts != null">work_shifts = #{workShifts},</if>
|
|
|
+ <if test="foreignTradeNumber != null">foreign_trade_number = #{foreignTradeNumber},</if>
|
|
|
+ <if test="canisterWeight != null">canister_weight = #{canisterWeight},</if>
|
|
|
+ <if test="boxWeight != null">box_weight = #{boxWeight},</if>
|
|
|
+ <if test="tubeColor != null">tube_color = #{tubeColor},</if>
|
|
|
+ <if test="comPort != null">com_port = #{comPort},</if>
|
|
|
+ <if test="printFormat != null">print_format = #{printFormat},</if>
|
|
|
+ <if test="packagingType != null">packaging_type = #{packagingType},</if>
|
|
|
+ <if test="storageLocation != null">storage_location = #{storageLocation},</if>
|
|
|
+ <if test="warehouseregionId != null">warehouseregion_id = #{warehouseregionId},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createById != null">create_by_id = #{createById},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateById != null">update_by_id = #{updateById},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="totalCanisterNum != null">total_canister_num = #{totalCanisterNum},</if>
|
|
|
+ <if test="totalBoxNum != null">total_box_num = #{totalBoxNum},</if>
|
|
|
+ <if test="totalSuttle != null">total_suttle = #{totalSuttle},</if>
|
|
|
+ <if test="totalGrossWeight != null">total_gross_weight = #{totalGrossWeight},</if>
|
|
|
+ <if test="withdrawingFlag != null">withdrawing_flag = #{withdrawingFlag},</if>
|
|
|
+ <if test="saleProductId != null">sale_product_id = #{saleProductId},</if>
|
|
|
+ <if test="otherStates != null">other_states = #{otherStates},</if>
|
|
|
+ <if test="parentCode != null">parent_code = #{parentCode},</if>
|
|
|
+ <if test="qrCodeId != null">qr_code_id = #{qrCodeId},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteProductCodeAListById" parameterType="Long">
|
|
|
+ delete from {DBNAME}.product_code_list where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteProductCodeAListByIds" parameterType="String">
|
|
|
+ delete from {DBNAME}.product_code_list where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|