243 lines
14 KiB
XML
243 lines
14 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.job.mydojobdetail.mapper.MydoJobDetailMapper">
|
|
|
|
<resultMap type="MydoJobDetail" id="MydoJobDetailResult">
|
|
<result property="jobDetailId" column="job_detail_id" />
|
|
<result property="jobId" column="job_id" />
|
|
<result property="stockId" column="stock_id" />
|
|
<result property="warehouseId" column="warehouse_id" />
|
|
<result property="lotNo" column="lot_no" />
|
|
<result property="inDate" column="in_date" />
|
|
<result property="inOrOutId" column="in_or_out_id" />
|
|
<result property="inOrOutDId" column="in_or_out_d_id" />
|
|
<result property="productGuid" column="product_guid" />
|
|
<result property="productId" column="product_id" />
|
|
<result property="stockStatus" column="stock_status" />
|
|
<result property="inQuantity" column="in_quantity" />
|
|
<result property="stockQuantity" column="stock_quantity" />
|
|
<result property="outQuantity" column="out_quantity" />
|
|
<result property="layerQuantity" column="layer_quantity" />
|
|
<result property="outLayerQuantity" column="out_layer_quantity" />
|
|
<result property="giveNum" column="give_num" />
|
|
<result property="stockinId" column="stockin_id" />
|
|
<result property="stackingId" column="stacking_id" />
|
|
<result property="exitId" column="exit_id" />
|
|
<result property="printDate" column="print_date" />
|
|
<result property="customerId" column="customer_id" />
|
|
<result property="supplierId" column="supplier_id" />
|
|
<result property="spare1" column="spare1" />
|
|
<result property="spare2" column="spare2" />
|
|
<result property="spare3" column="spare3" />
|
|
<result property="spare4" column="spare4" />
|
|
<result property="pickQuantity" column="pick_quantity" />
|
|
<result property="pickQuantityReal" column="pick_quantity_real" />
|
|
<association property="extraField" javaType="ExtraField">
|
|
<result property="productId" column="product_id" />
|
|
<result property="materialDesc" column="product_name" />
|
|
<result property="englishDesc" column="englishDesc" />
|
|
<result property="length" column="length" />
|
|
<result property="width" column="width" />
|
|
<result property="height" column="height" />
|
|
<result property="volume" column="volume" />
|
|
<result property="netWeight" column="netWeight" />
|
|
</association>
|
|
</resultMap>
|
|
|
|
<sql id="selectMydoJobDetailVo">
|
|
select mjd.job_detail_id,
|
|
mjd.job_id,
|
|
mjd.stock_id,
|
|
mjd.lot_no,
|
|
mjd.in_date,
|
|
mjd.in_or_out_id,
|
|
mjd.in_or_out_d_id,
|
|
mjd.product_guid,
|
|
mjd.product_id,
|
|
mjd.stock_status,
|
|
mjd.in_quantity,
|
|
mjd.stock_quantity,
|
|
mjd.out_quantity,
|
|
mjd.layer_quantity,
|
|
mjd.out_layer_quantity,
|
|
mjd.give_num,
|
|
mjd.stockin_id,
|
|
mjd.stacking_id,
|
|
mjd.exit_id,
|
|
mjd.print_date,
|
|
mjd.customer_id,
|
|
mjd.supplier_id,
|
|
mjd.spare1,
|
|
mjd.spare2,
|
|
mjd.spare3,
|
|
mjd.spare4,
|
|
mjd.pick_quantity,
|
|
mjd.out_quantity-mjd.pick_quantity as pick_quantity_real,
|
|
bp.product_name, bp.spare1 as englishDesc,
|
|
bp.spare2 as netWeight,bp.spare5 as length,bp.spare6 as width,bp.spare7 as height,bp.spare8 as volume,
|
|
mj.warehouse_id
|
|
|
|
from mydo_job_detail mjd
|
|
left join bas_product bp on mjd.product_id = bp.product_id
|
|
left join mydo_job mj on mjd.job_id = mj.job_id
|
|
|
|
|
|
</sql>
|
|
|
|
<select id="selectMydoJobDetailList" parameterType="MydoJobDetail" resultMap="MydoJobDetailResult">
|
|
<include refid="selectMydoJobDetailVo"/>
|
|
<where>
|
|
<if test="jobDetailId != null and jobDetailId != ''"> and mjd.job_detail_id = #{jobDetailId}</if>
|
|
<if test="jobId != null and jobId != ''"> and mjd.job_id = #{jobId}</if>
|
|
<if test="stockId != null and stockId != ''"> and mjd.stock_id = #{stockId}</if>
|
|
<if test="lotNo != null and lotNo != ''"> and mjd.lot_no = #{lotNo}</if>
|
|
<if test="inDate != null and inDate != ''"> and mjd.in_date = #{inDate}</if>
|
|
<if test="inOrOutId != null and inOrOutId != ''"> and mjd.in_or_out_id = #{inOrOutId}</if>
|
|
<if test="inOrOutDId != null and inOrOutDId != ''"> and mjd.in_or_out_d_id = #{inOrOutDId}</if>
|
|
<if test="productGuid != null and productGuid != ''"> and mjd.product_guid = #{productGuid}</if>
|
|
<if test="productId != null and productId != ''"> and mjd.product_id = #{productId}</if>
|
|
<if test="stockStatus != null and stockStatus != ''"> and mjd.stock_status = #{stockStatus}</if>
|
|
<if test="inQuantity != null and inQuantity != ''"> and mjd.in_quantity = #{inQuantity}</if>
|
|
<if test="stockQuantity != null and stockQuantity != ''"> and mjd.stock_quantity = #{stockQuantity}</if>
|
|
<if test="outQuantity != null and outQuantity != ''"> and mjd.out_quantity = #{outQuantity}</if>
|
|
<if test="layerQuantity != null and layerQuantity != ''"> and mjd.layer_quantity = #{layerQuantity}</if>
|
|
<if test="outLayerQuantity != null and outLayerQuantity != ''"> and mjd.out_layer_quantity = #{outLayerQuantity}</if>
|
|
<if test="giveNum != null and giveNum != ''"> and mjd.give_num = #{giveNum}</if>
|
|
<if test="stockinId != null and stockinId != ''"> and mjd.stockin_id = #{stockinId}</if>
|
|
<if test="stackingId != null and stackingId != ''"> and mjd.stacking_id = #{stackingId}</if>
|
|
<if test="exitId != null and exitId != ''"> and mjd.exit_id = #{exitId}</if>
|
|
<if test="printDate != null and printDate != ''"> and mjd.print_date = #{printDate}</if>
|
|
<if test="customerId != null and customerId != ''"> and mjd.customer_id = #{customerId}</if>
|
|
<if test="supplierId != null and supplierId != ''"> and mjd.supplier_id = #{supplierId}</if>
|
|
<if test="spare1 != null and spare1 != ''"> and mjd.spare1 = #{spare1}</if>
|
|
<if test="spare2 != null and spare2 != ''"> and mjd.spare2 = #{spare2}</if>
|
|
<if test="spare3 != null and spare3 != ''"> and mjd.spare3 = #{spare3}</if>
|
|
<if test="spare4 != null and spare4 != ''"> and mjd.spare4 = #{spare4}</if>
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<select id="selectMydoJobDetailByJobDetailId" parameterType="String" resultMap="MydoJobDetailResult">
|
|
<include refid="selectMydoJobDetailVo"/>
|
|
where job_detail_id = #{jobDetailId}
|
|
</select>
|
|
<select id="selectMydoJobDetailListByJobId" resultMap="MydoJobDetailResult">
|
|
<include refid="selectMydoJobDetailVo"/>
|
|
where mjd.job_id = #{jobId}
|
|
</select>
|
|
|
|
<insert id="insertMydoJobDetail" parameterType="MydoJobDetail">
|
|
insert into mydo_job_detail
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="jobDetailId != null and jobDetailId != ''">job_detail_id,</if>
|
|
<if test="jobId != null and jobId != ''">job_id,</if>
|
|
<if test="stockId != null">stock_id,</if>
|
|
<if test="lotNo != null">lot_no,</if>
|
|
<if test="inDate != null">in_date,</if>
|
|
<if test="inOrOutId != null">in_or_out_id,</if>
|
|
<if test="inOrOutDId != null">in_or_out_d_id,</if>
|
|
<if test="productGuid != null">product_guid,</if>
|
|
<if test="productId != null">product_id,</if>
|
|
<if test="stockStatus != null">stock_status,</if>
|
|
<if test="inQuantity != null">in_quantity,</if>
|
|
<if test="stockQuantity != null">stock_quantity,</if>
|
|
<if test="outQuantity != null">out_quantity,</if>
|
|
<if test="layerQuantity != null">layer_quantity,</if>
|
|
<if test="outLayerQuantity != null">out_layer_quantity,</if>
|
|
<if test="giveNum != null">give_num,</if>
|
|
<if test="stockinId != null">stockin_id,</if>
|
|
<if test="stackingId != null">stacking_id,</if>
|
|
<if test="exitId != null">exit_id,</if>
|
|
<if test="printDate != null">print_date,</if>
|
|
<if test="customerId != null">customer_id,</if>
|
|
<if test="supplierId != null">supplier_id,</if>
|
|
<if test="spare1 != null">spare1,</if>
|
|
<if test="spare2 != null">spare2,</if>
|
|
<if test="spare3 != null">spare3,</if>
|
|
<if test="spare4 != null">spare4,</if>
|
|
<if test="pickQuantity != null">pick_quantity,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="jobDetailId != null and jobDetailId != ''">#{jobDetailId},</if>
|
|
<if test="jobId != null and jobId != ''">#{jobId},</if>
|
|
<if test="stockId != null">#{stockId},</if>
|
|
<if test="lotNo != null">#{lotNo},</if>
|
|
<if test="inDate != null">#{inDate},</if>
|
|
<if test="inOrOutId != null">#{inOrOutId},</if>
|
|
<if test="inOrOutDId != null">#{inOrOutDId},</if>
|
|
<if test="productGuid != null">#{productGuid},</if>
|
|
<if test="productId != null">#{productId},</if>
|
|
<if test="stockStatus != null">#{stockStatus},</if>
|
|
<if test="inQuantity != null">#{inQuantity},</if>
|
|
<if test="stockQuantity != null">#{stockQuantity},</if>
|
|
<if test="outQuantity != null">#{outQuantity},</if>
|
|
<if test="layerQuantity != null">#{layerQuantity},</if>
|
|
<if test="outLayerQuantity != null">#{outLayerQuantity},</if>
|
|
<if test="giveNum != null">#{giveNum},</if>
|
|
<if test="stockinId != null">#{stockinId},</if>
|
|
<if test="stackingId != null">#{stackingId},</if>
|
|
<if test="exitId != null">#{exitId},</if>
|
|
<if test="printDate != null">#{printDate},</if>
|
|
<if test="customerId != null">#{customerId},</if>
|
|
<if test="supplierId != null">#{supplierId},</if>
|
|
<if test="spare1 != null">#{spare1},</if>
|
|
<if test="spare2 != null">#{spare2},</if>
|
|
<if test="spare3 != null">#{spare3},</if>
|
|
<if test="spare4 != null">#{spare4},</if>
|
|
<if test="pickQuantity != null">#{pick_quantity},</if>
|
|
</trim>
|
|
</insert>
|
|
<insert id="insertHistory">
|
|
insert into mydo_job_detail_finish select * from mydo_job_detail where job_id = #{jobId}
|
|
</insert>
|
|
|
|
<update id="updateMydoJobDetail" parameterType="MydoJobDetail">
|
|
update mydo_job_detail
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="jobId != null and jobId != ''">job_id = #{jobId},</if>
|
|
<if test="stockId != null">stock_id = #{stockId},</if>
|
|
<if test="lotNo != null">lot_no = #{lotNo},</if>
|
|
<if test="inDate != null">in_date = #{inDate},</if>
|
|
<if test="inOrOutId != null">in_or_out_id = #{inOrOutId},</if>
|
|
<if test="inOrOutDId != null">in_or_out_d_id = #{inOrOutDId},</if>
|
|
<if test="productGuid != null">product_guid = #{productGuid},</if>
|
|
<if test="productId != null">product_id = #{productId},</if>
|
|
<if test="stockStatus != null">stock_status = #{stockStatus},</if>
|
|
<if test="inQuantity != null">in_quantity = #{inQuantity},</if>
|
|
<if test="stockQuantity != null">stock_quantity = #{stockQuantity},</if>
|
|
<if test="outQuantity != null">out_quantity = #{outQuantity},</if>
|
|
<if test="layerQuantity != null">layer_quantity = #{layerQuantity},</if>
|
|
<if test="outLayerQuantity != null">out_layer_quantity = #{outLayerQuantity},</if>
|
|
<if test="giveNum != null">give_num = #{giveNum},</if>
|
|
<if test="stockinId != null">stockin_id = #{stockinId},</if>
|
|
<if test="stackingId != null">stacking_id = #{stackingId},</if>
|
|
<if test="exitId != null">exit_id = #{exitId},</if>
|
|
<if test="printDate != null">print_date = #{printDate},</if>
|
|
<if test="customerId != null">customer_id = #{customerId},</if>
|
|
<if test="supplierId != null">supplier_id = #{supplierId},</if>
|
|
<if test="spare1 != null">spare1 = #{spare1},</if>
|
|
<if test="spare2 != null">spare2 = #{spare2},</if>
|
|
<if test="spare3 != null">spare3 = #{spare3},</if>
|
|
<if test="spare4 != null">spare4 = #{spare4},</if>
|
|
<if test="pickQuantity != null">pick_quantity = #{pickQuantity},</if>
|
|
</trim>
|
|
where job_detail_id = #{jobDetailId}
|
|
</update>
|
|
|
|
<delete id="deleteMydoJobDetailByJobDetailId" parameterType="String">
|
|
delete from mydo_job_detail where job_detail_id = #{jobDetailId}
|
|
</delete>
|
|
|
|
<delete id="deleteMydoJobDetailByJobDetailIds" parameterType="String">
|
|
delete from mydo_job_detail where job_detail_id in
|
|
<foreach item="jobDetailId" collection="array" open="(" separator="," close=")">
|
|
#{jobDetailId}
|
|
</foreach>
|
|
</delete>
|
|
<delete id="deleteMydoJobDetailByJobId">
|
|
delete from mydo_job_detail where job_id = #{jobId}
|
|
</delete>
|
|
</mapper>
|