|
|
|
@ -101,117 +101,124 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<include refid="selectMesPrepareVo"/>
|
|
|
|
|
where prepare_id = #{prepareId}
|
|
|
|
|
</select>
|
|
|
|
|
<!--T+1天的母单-->
|
|
|
|
|
<select id="getParentWorkOrderT1" resultType="com.op.mes.domain.MesPrepare">
|
|
|
|
|
select workorder_code workorderCode
|
|
|
|
|
from pro_order_workorder
|
|
|
|
|
where parent_order = '0' and prod_type = 'prod'
|
|
|
|
|
and CONVERT(varchar(100), product_date, 23) = #{dayStr}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!-- <insert id="insertMesPrepare" parameterType="MesPrepare">-->
|
|
|
|
|
<!-- insert into mes_prepare-->
|
|
|
|
|
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
|
|
|
|
|
<!-- <if test="prepareId != null">prepare_id,</if>-->
|
|
|
|
|
<!-- <if test="workorderCode != null and workorderCode != ''">workorder_code,</if>-->
|
|
|
|
|
<!-- <if test="workorderName != null">workorder_name,</if>-->
|
|
|
|
|
<!-- <if test="parentOrder != null and parentOrder != ''">parent_order,</if>-->
|
|
|
|
|
<!-- <if test="orderId != null and orderId != ''">order_id,</if>-->
|
|
|
|
|
<!-- <if test="orderCode != null">order_code,</if>-->
|
|
|
|
|
<!-- <if test="productId != null">product_id,</if>-->
|
|
|
|
|
<!-- <if test="productCode != null and productCode != ''">product_code,</if>-->
|
|
|
|
|
<!-- <if test="prodType != null">prod_type,</if>-->
|
|
|
|
|
<!-- <if test="productName != null and productName != ''">product_name,</if>-->
|
|
|
|
|
<!-- <if test="productSpc != null">product_spc,</if>-->
|
|
|
|
|
<!-- <if test="wetDetailPlanId != null">wet_detail_plan_id,</if>-->
|
|
|
|
|
<!-- <if test="productDate != null">product_date,</if>-->
|
|
|
|
|
<!-- <if test="shiftId != null">shift_id,</if>-->
|
|
|
|
|
<!-- <if test="ancestors != null">ancestors,</if>-->
|
|
|
|
|
<!-- <if test="status != null">status,</if>-->
|
|
|
|
|
<!-- <if test="remark != null">remark,</if>-->
|
|
|
|
|
<!-- <if test="attr1 != null">attr1,</if>-->
|
|
|
|
|
<!-- <if test="attr2 != null">attr2,</if>-->
|
|
|
|
|
<!-- <if test="attr3 != null">attr3,</if>-->
|
|
|
|
|
<!-- <if test="attr4 != null">attr4,</if>-->
|
|
|
|
|
<!-- <if test="createBy != null">create_by,</if>-->
|
|
|
|
|
<!-- <if test="createTime != null">create_time,</if>-->
|
|
|
|
|
<!-- <if test="updateBy != null">update_by,</if>-->
|
|
|
|
|
<!-- <if test="updateTime != null">update_time,</if>-->
|
|
|
|
|
<!-- <if test="factoryCode != null">factory_code,</if>-->
|
|
|
|
|
<!-- <if test="materialCode != null and materialCode != ''">material_code,</if>-->
|
|
|
|
|
<!-- <if test="materialName != null and materialName != ''">material_name,</if>-->
|
|
|
|
|
<!-- <if test="materialSpc != null">material_spc,</if>-->
|
|
|
|
|
<!-- <if test="unit != null and unit != ''">unit,</if>-->
|
|
|
|
|
<!-- <if test="quantity != null">quantity,</if>-->
|
|
|
|
|
<!-- </trim>-->
|
|
|
|
|
<!-- <trim prefix="values (" suffix=")" suffixOverrides=",">-->
|
|
|
|
|
<!-- <if test="prepareId != null">#{prepareId},</if>-->
|
|
|
|
|
<!-- <if test="workorderCode != null and workorderCode != ''">#{workorderCode},</if>-->
|
|
|
|
|
<!-- <if test="workorderName != null">#{workorderName},</if>-->
|
|
|
|
|
<!-- <if test="parentOrder != null and parentOrder != ''">#{parentOrder},</if>-->
|
|
|
|
|
<!-- <if test="orderId != null and orderId != ''">#{orderId},</if>-->
|
|
|
|
|
<!-- <if test="orderCode != null">#{orderCode},</if>-->
|
|
|
|
|
<!-- <if test="productId != null">#{productId},</if>-->
|
|
|
|
|
<!-- <if test="productCode != null and productCode != ''">#{productCode},</if>-->
|
|
|
|
|
<!-- <if test="prodType != null">#{prodType},</if>-->
|
|
|
|
|
<!-- <if test="productName != null and productName != ''">#{productName},</if>-->
|
|
|
|
|
<!-- <if test="productSpc != null">#{productSpc},</if>-->
|
|
|
|
|
<!-- <if test="wetDetailPlanId != null">#{wetDetailPlanId},</if>-->
|
|
|
|
|
<!-- <if test="productDate != null">#{productDate},</if>-->
|
|
|
|
|
<!-- <if test="shiftId != null">#{shiftId},</if>-->
|
|
|
|
|
<!-- <if test="ancestors != null">#{ancestors},</if>-->
|
|
|
|
|
<!-- <if test="status != null">#{status},</if>-->
|
|
|
|
|
<!-- <if test="remark != null">#{remark},</if>-->
|
|
|
|
|
<!-- <if test="attr1 != null">#{attr1},</if>-->
|
|
|
|
|
<!-- <if test="attr2 != null">#{attr2},</if>-->
|
|
|
|
|
<!-- <if test="attr3 != null">#{attr3},</if>-->
|
|
|
|
|
<!-- <if test="attr4 != null">#{attr4},</if>-->
|
|
|
|
|
<!-- <if test="createBy != null">#{createBy},</if>-->
|
|
|
|
|
<!-- <if test="createTime != null">#{createTime},</if>-->
|
|
|
|
|
<!-- <if test="updateBy != null">#{updateBy},</if>-->
|
|
|
|
|
<!-- <if test="updateTime != null">#{updateTime},</if>-->
|
|
|
|
|
<!-- <if test="factoryCode != null">#{factoryCode},</if>-->
|
|
|
|
|
<!-- <if test="materialCode != null and materialCode != ''">#{materialCode},</if>-->
|
|
|
|
|
<!-- <if test="materialName != null and materialName != ''">#{materialName},</if>-->
|
|
|
|
|
<!-- <if test="materialSpc != null">#{materialSpc},</if>-->
|
|
|
|
|
<!-- <if test="unit != null and unit != ''">#{unit},</if>-->
|
|
|
|
|
<!-- <if test="quantity != null">#{quantity},</if>-->
|
|
|
|
|
<!-- </trim>-->
|
|
|
|
|
<!-- </insert>-->
|
|
|
|
|
<insert id="insertMesPrepare" parameterType="MesPrepare">
|
|
|
|
|
insert into mes_prepare
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="prepareId != null">prepare_id,</if>
|
|
|
|
|
<if test="workorderCode != null and workorderCode != ''">workorder_code,</if>
|
|
|
|
|
<if test="workorderName != null">workorder_name,</if>
|
|
|
|
|
<if test="parentOrder != null and parentOrder != ''">parent_order,</if>
|
|
|
|
|
<if test="orderId != null and orderId != ''">order_id,</if>
|
|
|
|
|
<if test="orderCode != null">order_code,</if>
|
|
|
|
|
<if test="productId != null">product_id,</if>
|
|
|
|
|
<if test="productCode != null and productCode != ''">product_code,</if>
|
|
|
|
|
<if test="prodType != null">prod_type,</if>
|
|
|
|
|
<if test="productName != null and productName != ''">product_name,</if>
|
|
|
|
|
<if test="productSpc != null">product_spc,</if>
|
|
|
|
|
<if test="wetDetailPlanId != null">wet_detail_plan_id,</if>
|
|
|
|
|
<if test="productDate != null">product_date,</if>
|
|
|
|
|
<if test="shiftId != null">shift_id,</if>
|
|
|
|
|
<if test="ancestors != null">ancestors,</if>
|
|
|
|
|
<if test="status != null">status,</if>
|
|
|
|
|
<if test="remark != null">remark,</if>
|
|
|
|
|
<if test="attr1 != null">attr1,</if>
|
|
|
|
|
<if test="attr2 != null">attr2,</if>
|
|
|
|
|
<if test="attr3 != null">attr3,</if>
|
|
|
|
|
<if test="attr4 != null">attr4,</if>
|
|
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
|
<if test="factoryCode != null">factory_code,</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''">material_code,</if>
|
|
|
|
|
<if test="materialName != null and materialName != ''">material_name,</if>
|
|
|
|
|
<if test="materialSpc != null">material_spc,</if>
|
|
|
|
|
<if test="unit != null and unit != ''">unit,</if>
|
|
|
|
|
<if test="quantity != null">quantity,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="prepareId != null">#{prepareId},</if>
|
|
|
|
|
<if test="workorderCode != null and workorderCode != ''">#{workorderCode},</if>
|
|
|
|
|
<if test="workorderName != null">#{workorderName},</if>
|
|
|
|
|
<if test="parentOrder != null and parentOrder != ''">#{parentOrder},</if>
|
|
|
|
|
<if test="orderId != null and orderId != ''">#{orderId},</if>
|
|
|
|
|
<if test="orderCode != null">#{orderCode},</if>
|
|
|
|
|
<if test="productId != null">#{productId},</if>
|
|
|
|
|
<if test="productCode != null and productCode != ''">#{productCode},</if>
|
|
|
|
|
<if test="prodType != null">#{prodType},</if>
|
|
|
|
|
<if test="productName != null and productName != ''">#{productName},</if>
|
|
|
|
|
<if test="productSpc != null">#{productSpc},</if>
|
|
|
|
|
<if test="wetDetailPlanId != null">#{wetDetailPlanId},</if>
|
|
|
|
|
<if test="productDate != null">#{productDate},</if>
|
|
|
|
|
<if test="shiftId != null">#{shiftId},</if>
|
|
|
|
|
<if test="ancestors != null">#{ancestors},</if>
|
|
|
|
|
<if test="status != null">#{status},</if>
|
|
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
|
|
<if test="attr1 != null">#{attr1},</if>
|
|
|
|
|
<if test="attr2 != null">#{attr2},</if>
|
|
|
|
|
<if test="attr3 != null">#{attr3},</if>
|
|
|
|
|
<if test="attr4 != null">#{attr4},</if>
|
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
<if test="factoryCode != null">#{factoryCode},</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
|
|
|
|
|
<if test="materialName != null and materialName != ''">#{materialName},</if>
|
|
|
|
|
<if test="materialSpc != null">#{materialSpc},</if>
|
|
|
|
|
<if test="unit != null and unit != ''">#{unit},</if>
|
|
|
|
|
<if test="quantity != null">#{quantity},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<!-- <update id="updateMesPrepare" parameterType="MesPrepare">-->
|
|
|
|
|
<!-- update mes_prepare-->
|
|
|
|
|
<!-- <trim prefix="SET" suffixOverrides=",">-->
|
|
|
|
|
<!-- <if test="workorderCode != null and workorderCode != ''">workorder_code = #{workorderCode},</if>-->
|
|
|
|
|
<!-- <if test="workorderName != null">workorder_name = #{workorderName},</if>-->
|
|
|
|
|
<!-- <if test="parentOrder != null and parentOrder != ''">parent_order = #{parentOrder},</if>-->
|
|
|
|
|
<!-- <if test="orderId != null and orderId != ''">order_id = #{orderId},</if>-->
|
|
|
|
|
<!-- <if test="orderCode != null">order_code = #{orderCode},</if>-->
|
|
|
|
|
<!-- <if test="productId != null">product_id = #{productId},</if>-->
|
|
|
|
|
<!-- <if test="productCode != null and productCode != ''">product_code = #{productCode},</if>-->
|
|
|
|
|
<!-- <if test="prodType != null">prod_type = #{prodType},</if>-->
|
|
|
|
|
<!-- <if test="productName != null and productName != ''">product_name = #{productName},</if>-->
|
|
|
|
|
<!-- <if test="productSpc != null">product_spc = #{productSpc},</if>-->
|
|
|
|
|
<!-- <if test="wetDetailPlanId != null">wet_detail_plan_id = #{wetDetailPlanId},</if>-->
|
|
|
|
|
<!-- <if test="productDate != null">product_date = #{productDate},</if>-->
|
|
|
|
|
<!-- <if test="shiftId != null">shift_id = #{shiftId},</if>-->
|
|
|
|
|
<!-- <if test="ancestors != null">ancestors = #{ancestors},</if>-->
|
|
|
|
|
<!-- <if test="status != null">status = #{status},</if>-->
|
|
|
|
|
<!-- <if test="remark != null">remark = #{remark},</if>-->
|
|
|
|
|
<!-- <if test="attr1 != null">attr1 = #{attr1},</if>-->
|
|
|
|
|
<!-- <if test="attr2 != null">attr2 = #{attr2},</if>-->
|
|
|
|
|
<!-- <if test="attr3 != null">attr3 = #{attr3},</if>-->
|
|
|
|
|
<!-- <if test="attr4 != null">attr4 = #{attr4},</if>-->
|
|
|
|
|
<!-- <if test="createBy != null">create_by = #{createBy},</if>-->
|
|
|
|
|
<!-- <if test="createTime != null">create_time = #{createTime},</if>-->
|
|
|
|
|
<!-- <if test="updateBy != null">update_by = #{updateBy},</if>-->
|
|
|
|
|
<!-- <if test="updateTime != null">update_time = #{updateTime},</if>-->
|
|
|
|
|
<!-- <if test="factoryCode != null">factory_code = #{factoryCode},</if>-->
|
|
|
|
|
<!-- </trim>-->
|
|
|
|
|
<!-- where prepare_id = #{prepareId}-->
|
|
|
|
|
<!-- </update>-->
|
|
|
|
|
<update id="updateMesPrepare" parameterType="MesPrepare">
|
|
|
|
|
update mes_prepare
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="workorderCode != null and workorderCode != ''">workorder_code = #{workorderCode},</if>
|
|
|
|
|
<if test="workorderName != null">workorder_name = #{workorderName},</if>
|
|
|
|
|
<if test="parentOrder != null and parentOrder != ''">parent_order = #{parentOrder},</if>
|
|
|
|
|
<if test="orderId != null and orderId != ''">order_id = #{orderId},</if>
|
|
|
|
|
<if test="orderCode != null">order_code = #{orderCode},</if>
|
|
|
|
|
<if test="productId != null">product_id = #{productId},</if>
|
|
|
|
|
<if test="productCode != null and productCode != ''">product_code = #{productCode},</if>
|
|
|
|
|
<if test="prodType != null">prod_type = #{prodType},</if>
|
|
|
|
|
<if test="productName != null and productName != ''">product_name = #{productName},</if>
|
|
|
|
|
<if test="productSpc != null">product_spc = #{productSpc},</if>
|
|
|
|
|
<if test="wetDetailPlanId != null">wet_detail_plan_id = #{wetDetailPlanId},</if>
|
|
|
|
|
<if test="productDate != null">product_date = #{productDate},</if>
|
|
|
|
|
<if test="shiftId != null">shift_id = #{shiftId},</if>
|
|
|
|
|
<if test="ancestors != null">ancestors = #{ancestors},</if>
|
|
|
|
|
<if test="status != null">status = #{status},</if>
|
|
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
|
|
<if test="attr1 != null">attr1 = #{attr1},</if>
|
|
|
|
|
<if test="attr2 != null">attr2 = #{attr2},</if>
|
|
|
|
|
<if test="attr3 != null">attr3 = #{attr3},</if>
|
|
|
|
|
<if test="attr4 != null">attr4 = #{attr4},</if>
|
|
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where prepare_id = #{prepareId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<!-- <delete id="deleteMesPrepareByPrepareId" parameterType="String">-->
|
|
|
|
|
<!-- delete from mes_prepare where prepare_id = #{prepareId}-->
|
|
|
|
|
<!-- </delete>-->
|
|
|
|
|
<delete id="deleteMesPrepareByPrepareId" parameterType="String">
|
|
|
|
|
delete from mes_prepare where prepare_id = #{prepareId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<!-- <delete id="deleteMesPrepareByPrepareIds" parameterType="String">-->
|
|
|
|
|
<!-- delete from mes_prepare where prepare_id in -->
|
|
|
|
|
<!-- <foreach item="prepareId" collection="array" open="(" separator="," close=")">-->
|
|
|
|
|
<!-- #{prepareId}-->
|
|
|
|
|
<!-- </foreach>-->
|
|
|
|
|
<!-- </delete>-->
|
|
|
|
|
<delete id="deleteMesPrepareByPrepareIds" parameterType="String">
|
|
|
|
|
delete from mes_prepare where prepare_id in
|
|
|
|
|
<foreach item="prepareId" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{prepareId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
</mapper>
|