廖井涛
2024-09-06 10a26b9b670efef0a2adba675c794c539846aa3c
north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml
@@ -46,6 +46,7 @@
        on r.order_id = ogd.order_id and r.order_sort = ogd.order_number
        <where>
            date(r.create_time)>=#{startDate} and date(r.create_time) &lt;= #{endDate}
            and o.create_order>0
        </where>
         order by r.review_status,r.id desc
        limit #{offset},#{pageSize};
@@ -156,8 +157,44 @@
                           on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=0 and (dd.responsible_process=rw.this_process or (dd.quality_ins_status!=1)) and rw.reviewed_state!=-1
          and o.create_order>0
        order by dd.id desc
    </select>
    <delete id="deleteReplenishMp">
        delete from pp.patch_log where patch_id=#{patchId}
    </delete>
    <update id="updatePatchDdMp">
        update pp.damage_details set patch_status=0,quantity=quantity-#{qualityInspector}
     where reporting_work_id=#{reportingWorkId} and order_number=#{orderSort} and technology_number=#{technologyNumber}
    </update>
    <update id="updatePatchBgMp">
        update pp.reporting_work_detail set patch_status=0
        where reporting_work_id=#{reportingWorkId} and order_number=#{orderSort} and technology_number=#{technologyNumber}
    </update>
    <update id="updateOrderProcessDetailCancel">
        update sd.order_process_detail
        set reporting_work_num=reporting_work_num + #{patchLog.patchNum}
        where order_id = #{patchLog.orderId}
          and process_id = #{patchLog.processId}
          and order_number = #{patchLog.orderSort}
          and technology_number = #{patchLog.technologyNumber}
          and id <![CDATA[<]]> (select a.opdid
                                from (select id as opdid
                                      from sd.order_process_detail opd
                                      where opd.order_id = #{patchLog.orderId}
                                        and opd.process_id = #{patchLog.processId}
                                        and opd.order_number = #{patchLog.orderSort}
                                        and opd.technology_number = #{patchLog.technologyNumber}
                                        and process = #{reportingWork.thisProcess}) as a)
    </update>
    <update id="updateReplenishCancel">
        update pp.patch_log set reviewer=null,review_status=0,update_time=now() where id=#{patchLog.id}
    </update>
</mapper>