|
@@ -0,0 +1,217 @@
|
|
|
+<?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.ProductHandsetOutboundRecordMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.zkqy.business.domain.ProductHandsetOutboundRecord" id="ProductHandsetOutboundRecordResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="qrCode" column="qr_code" />
|
|
|
+ <result property="qrCodeId" column="qr_code_id" />
|
|
|
+ <result property="lotNum" column="lot_num" />
|
|
|
+ <result property="productId" column="product_id" />
|
|
|
+ <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="warehousingTime" column="warehousing_time" />
|
|
|
+ <result property="depositor" column="depositor" />
|
|
|
+ <result property="warehouseId" column="warehouse_id" />
|
|
|
+ <result property="noticeNumber" column="notice_number" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectProductHandsetOutboundRecordVo">
|
|
|
+ select id, qr_code, qr_code_id, lot_num, product_id, 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, warehousing_time, depositor, warehouse_id, notice_number from {DBNAME}.product_handset_outbound_record
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectProductHandsetOutboundRecordList" parameterType="com.zkqy.business.domain.ProductHandsetOutboundRecord" resultMap="ProductHandsetOutboundRecordResult">
|
|
|
+ <include refid="selectProductHandsetOutboundRecordVo"/>
|
|
|
+ where del_flag = '0'
|
|
|
+ <if test="qrCode != null and qrCode != ''"> and qr_code = #{qrCode}</if>
|
|
|
+ <if test="qrCodeId != null and qrCodeId != ''"> and qr_code_id = #{qrCodeId}</if>
|
|
|
+ <if test="lotNum != null and lotNum != ''"> and lot_num = #{lotNum}</if>
|
|
|
+ <if test="productId != null "> and product_id = #{productId}</if>
|
|
|
+ <if test="levels != null and levels != ''"> and levels = #{levels}</if>
|
|
|
+ <if test="canisterNum != null "> and canister_num = #{canisterNum}</if>
|
|
|
+ <if test="boxNum != null "> and box_num = #{boxNum}</if>
|
|
|
+ <if test="suttle != null "> and suttle = #{suttle}</if>
|
|
|
+ <if test="productionDate != null "> and production_date = #{productionDate}</if>
|
|
|
+ <if test="machineTool != null and machineTool != ''"> and machine_tool = #{machineTool}</if>
|
|
|
+ <if test="grossWeight != null "> and gross_weight = #{grossWeight}</if>
|
|
|
+ <if test="packaging != null and packaging != ''"> and packaging = #{packaging}</if>
|
|
|
+ <if test="workShifts != null and workShifts != ''"> and work_shifts = #{workShifts}</if>
|
|
|
+ <if test="foreignTradeNumber != null and foreignTradeNumber != ''"> and foreign_trade_number = #{foreignTradeNumber}</if>
|
|
|
+ <if test="canisterWeight != null "> and canister_weight = #{canisterWeight}</if>
|
|
|
+ <if test="boxWeight != null "> and box_weight = #{boxWeight}</if>
|
|
|
+ <if test="tubeColor != null and tubeColor != ''"> and tube_color = #{tubeColor}</if>
|
|
|
+ <if test="comPort != null and comPort != ''"> and com_port = #{comPort}</if>
|
|
|
+ <if test="printFormat != null and printFormat != ''"> and print_format = #{printFormat}</if>
|
|
|
+ <if test="packagingType != null and packagingType != ''"> and packaging_type = #{packagingType}</if>
|
|
|
+ <if test="storageLocation != null and storageLocation != ''"> and storage_location = #{storageLocation}</if>
|
|
|
+ <if test="warehouseregionId != null "> and warehouseregion_id = #{warehouseregionId}</if>
|
|
|
+ <if test="remark != null and remark != ''"> and remark = #{remark}</if>
|
|
|
+ <if test="warehousingTime != null "> and warehousing_time = #{warehousingTime}</if>
|
|
|
+ <if test="depositor != null and depositor != ''"> and depositor = #{depositor}</if>
|
|
|
+ <if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
|
|
|
+ <if test="noticeNumber != null and noticeNumber != ''"> and notice_number = #{noticeNumber}</if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectProductHandsetOutboundRecordById" parameterType="Long" resultMap="ProductHandsetOutboundRecordResult">
|
|
|
+ <include refid="selectProductHandsetOutboundRecordVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertProductHandsetOutboundRecord" parameterType="com.zkqy.business.domain.ProductHandsetOutboundRecord" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into {DBNAME}.product_handset_outbound_record
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="qrCode != null">qr_code,</if>
|
|
|
+ <if test="qrCodeId != null">qr_code_id,</if>
|
|
|
+ <if test="lotNum != null">lot_num,</if>
|
|
|
+ <if test="productId != null">product_id,</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="createBy != null">create_by,</if>
|
|
|
+ <if test="createById != null">create_by_id,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="warehousingTime != null">warehousing_time,</if>
|
|
|
+ <if test="depositor != null">depositor,</if>
|
|
|
+ <if test="warehouseId != null">warehouse_id,</if>
|
|
|
+ <if test="noticeNumber != null">notice_number,</if>
|
|
|
+ del_flag
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="qrCode != null">#{qrCode},</if>
|
|
|
+ <if test="qrCodeId != null">#{qrCodeId},</if>
|
|
|
+ <if test="lotNum != null">#{lotNum},</if>
|
|
|
+ <if test="productId != null">#{productId},</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="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createById != null">#{createById},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="warehousingTime != null">#{warehousingTime},</if>
|
|
|
+ <if test="depositor != null">#{depositor},</if>
|
|
|
+ <if test="warehouseId != null">#{warehouseId},</if>
|
|
|
+ <if test="noticeNumber != null">#{noticeNumber},</if>
|
|
|
+ '0'
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateProductHandsetOutboundRecord" parameterType="com.zkqy.business.domain.ProductHandsetOutboundRecord">
|
|
|
+ update {DBNAME}.product_handset_outbound_record
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="qrCode != null">qr_code = #{qrCode},</if>
|
|
|
+ <if test="qrCodeId != null">qr_code_id = #{qrCodeId},</if>
|
|
|
+ <if test="lotNum != null">lot_num = #{lotNum},</if>
|
|
|
+ <if test="productId != null">product_id = #{productId},</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="warehousingTime != null">warehousing_time = #{warehousingTime},</if>
|
|
|
+ <if test="depositor != null">depositor = #{depositor},</if>
|
|
|
+ <if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
|
|
+ <if test="noticeNumber != null">notice_number = #{noticeNumber},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteProductHandsetOutboundRecordById" parameterType="Long">
|
|
|
+ delete from product_handset_outbound_record where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteProductHandsetOutboundRecordByIds" parameterType="String">
|
|
|
+ update {DBNAME}.product_handset_outbound_record set del_flag = '2' where id in
|
|
|
+ <foreach item="id" collection="list" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <select id="selectWhetherExist" resultType="com.zkqy.business.domain.ProductHandsetOutboundRecord">
|
|
|
+ <include refid="selectProductHandsetOutboundRecordVo"/>
|
|
|
+ where del_flag = '0' and qr_code = #{qrCode} and qr_code_id = #{qrCodeId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectBoxNumSuttle" resultType="com.zkqy.business.domain.ProductHandsetOutboundRecord">
|
|
|
+ select count(1) as boxNum , sum(suttle) as suttle from {DBNAME}.product_handset_outbound_record where product_id = #{productId} and notice_number = #{noticeNumber}
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|