|
@@ -1,133 +1,173 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.zkqy.business.mapper.ProductOutboundRecordMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="com.zkqy.business.domain.ProductOutboundRecord" id="ProductOutboundRecordResult">
|
|
|
- <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="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"/>
|
|
|
<result property="productColour" column="product_colour"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.zkqy.business.domain.vo.ProductCodeListVO" id="ProductCodeListResultVO">
|
|
|
- <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="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="productName" column="product_name" />
|
|
|
+ <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="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="productName" column="product_name"/>
|
|
|
<result property="productColor" column="product_color"/>
|
|
|
<result property="productSpecifications" column="product_specifications"/>
|
|
|
<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="warehousingTime" column="warehousing_time" />
|
|
|
- <result property="depositor" column="depositor" />
|
|
|
+ <result property="warehousingTime" column="warehousing_time"/>
|
|
|
+ <result property="depositor" column="depositor"/>
|
|
|
<result property="warehouseId" column="warehouse_id"/>
|
|
|
<result property="productColour" column="product_colour"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectProductOutboundRecordVo">
|
|
|
- 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,product_colour from {DBNAME}.product_outbound_record
|
|
|
+ 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,
|
|
|
+ product_colour
|
|
|
+ from {DBNAME}.product_outbound_record
|
|
|
</sql>
|
|
|
|
|
|
- <select id="selectProductOutboundRecordList" parameterType="com.zkqy.business.domain.ProductOutboundRecord" resultMap="ProductOutboundRecordResult">
|
|
|
+ <select id="selectProductOutboundRecordList" parameterType="com.zkqy.business.domain.ProductOutboundRecord"
|
|
|
+ resultMap="ProductOutboundRecordResult">
|
|
|
<include refid="selectProductOutboundRecordVo"/>
|
|
|
- <where>
|
|
|
- <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="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>
|
|
|
+ <where>
|
|
|
+ <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="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>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectProductOutboundRecordById" parameterType="Long" resultMap="ProductOutboundRecordResult">
|
|
|
<include refid="selectProductOutboundRecordVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
- <insert id="insertProductOutboundRecord" parameterType="com.zkqy.business.domain.ProductOutboundRecord" useGeneratedKeys="true" keyProperty="id">
|
|
|
+
|
|
|
+ <insert id="insertProductOutboundRecord" parameterType="com.zkqy.business.domain.ProductOutboundRecord"
|
|
|
+ useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into {DBNAME}.product_outbound_record
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="qrCode != null">qr_code,</if>
|
|
@@ -162,7 +202,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="noticeNumber != null">notice_number,</if>
|
|
|
<if test="productColour != null">product_colour,</if>
|
|
|
del_flag
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="qrCode != null">#{qrCode},</if>
|
|
|
<if test="qrCodeId != null">#{qrCodeId},</if>
|
|
@@ -196,7 +236,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="noticeNumber != null">#{noticeNumber},</if>
|
|
|
<if test="productColour != null">#{productColour},</if>
|
|
|
'0'
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateProductOutboundRecord" parameterType="com.zkqy.business.domain.ProductOutboundRecord">
|
|
@@ -238,17 +278,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteProductOutboundRecordById" parameterType="Long">
|
|
|
- delete from product_outbound_record where id = #{id}
|
|
|
+ delete
|
|
|
+ from product_outbound_record
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteProductOutboundRecordByIds" parameterType="String">
|
|
|
- delete from product_outbound_record where id in
|
|
|
+ delete from product_outbound_record where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
|
|
|
- <select id="selectList" parameterType="com.zkqy.business.domain.vo.ProductCodeListVO" resultMap="ProductCodeListResultVO">
|
|
|
+ <select id="selectList" parameterType="com.zkqy.business.domain.vo.ProductCodeListVO"
|
|
|
+ resultMap="ProductCodeListResultVO">
|
|
|
SELECT
|
|
|
r.qr_code,
|
|
|
p.product_name,
|
|
@@ -270,10 +313,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
WHERE
|
|
|
r.del_flag = '0'
|
|
|
<if test="qrCode != null and qrCode != ''">and r.qr_code like concat('%', #{qrCode}, '%')</if>
|
|
|
- <if test="lotNum != null and lotNum != ''"> and r.lot_num like concat('%', #{lotNum}, '%')</if>
|
|
|
- <if test="productionDate != null"> and r.production_date = #{productionDate}</if>
|
|
|
- <if test="warehousingTime != null "> and r.warehousing_time = #{warehousingTime}</if>
|
|
|
- <if test="depositor != null and depositor != ''"> and r.depositor like concat('%', #{depositor}, '%')</if>
|
|
|
+ <if test="lotNum != null and lotNum != ''">and r.lot_num like concat('%', #{lotNum}, '%')</if>
|
|
|
+ <if test="productionDate != null">and r.production_date = #{productionDate}</if>
|
|
|
+ <if test="warehousingTime != null ">and r.warehousing_time = #{warehousingTime}</if>
|
|
|
+ <if test="depositor != null and depositor != ''">and r.depositor like concat('%', #{depositor}, '%')</if>
|
|
|
GROUP BY
|
|
|
r.qr_code
|
|
|
</select>
|
|
@@ -284,7 +327,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="statisticsBoxNumSuttle" resultType="com.zkqy.business.domain.ProductOutboundRecord">
|
|
|
- select count(1) as boxNum , sum(suttle) as suttle from {DBNAME}.product_outbound_record where product_id = #{productId} and notice_number = #{noticeNumber} and qr_code = #{qrCode}
|
|
|
+ select count(1) as boxNum, sum(suttle) as suttle
|
|
|
+ from {DBNAME}.product_outbound_record
|
|
|
+ where product_id = #{productId}
|
|
|
+ and notice_number = #{noticeNumber}
|
|
|
+ and qr_code = #{qrCode}
|
|
|
</select>
|
|
|
|
|
|
+ <delete id="deleteProductOutboundRecordByUUID" parameterType="string">
|
|
|
+ delete
|
|
|
+ from product_outbound_record
|
|
|
+ where qr_code_id = #{qrCodeId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
</mapper>
|