自动化立体仓库 - WMS系统
whycq
2023-08-28 d3f11759e6b32d7e9e63e0f7b0cc4b6874aea020
src/main/resources/mapper/WrkDetlMapper.xml
@@ -45,6 +45,7 @@
        <result column="appe_user" property="appeUser" />
        <result column="appe_time" property="appeTime" />
        <result column="memo" property="memo" />
        <result column="mat_type" property="matType" />
    </resultMap>
    <sql id="batchSeq">
@@ -70,6 +71,9 @@
        and matnr = #{matnr}
        <include refid="batchSeq"></include>
    </delete>
    <delete id="deleteByWrkNo">
        DELETE FROM asr_wrk_detl where wrk_no = #{wrkNo}
    </delete>
    <update id="updateAnfme">
        update asr_wrk_detl
@@ -85,28 +89,31 @@
        select awd.*
        from asr_wrk_detl awd
        left join asr_wrk_mast awm on awd.wrk_no = awm.wrk_no and awd.io_time = awm.io_time
        where order_no = #{orderNo}
        where order_no like '%' + #{orderNo} + '%'
        union
        select distinct awdl.*
        from asr_wrk_detl_log awdl
        left join asr_wrk_mast_log awml on awdl.wrk_no = awml.wrk_no and awdl.io_time = awml.io_time
        where awdl.order_no = #{orderNo}
        where awdl.order_no like '%' + #{orderNo} + '%'
        and (awml.manu_type is null or awml.manu_type != '手动取消')
    </select>
    <select id="selectAndLogByOrderNoGroupByMatnrOfSum" resultMap="BaseResultMap">
        select awd.wrk_no, awd.io_time, awd.matnr, sum(awd.anfme) as anfme
        select awd.wrk_no, awd.io_time, awd.matnr, awd.order_no, sum(awd.anfme) as anfme
        from asr_wrk_detl awd
        left join asr_wrk_mast awm on awd.wrk_no = awm.wrk_no and awd.io_time = awm.io_time
        where order_no = #{orderNo}
        group by awd.wrk_no, awd.io_time, awd.matnr
        where order_no like '%' + #{orderNo} + '%'
        group by awd.wrk_no, awd.io_time, awd.matnr, awd.order_no
        union
        select distinct awdl.wrk_no, awdl.io_time, awdl.matnr, sum(awdl.anfme) as anfme
        from asr_wrk_detl_log awdl
        left join asr_wrk_mast_log awml on awdl.wrk_no = awml.wrk_no and awdl.io_time = awml.io_time
        where awdl.order_no = #{orderNo}
        and (awml.manu_type is null or awml.manu_type != '手动取消')
        group by awdl.wrk_no, awdl.io_time, awdl.matnr
        select awdl.wrk_no, awdl.io_time, awdl.matnr, awdl.order_no, sum(awdl.anfme) as anfme from
        (
            select distinct awdl.*
            from asr_wrk_detl_log awdl
            left join asr_wrk_mast_log awml on awdl.wrk_no = awml.wrk_no and awdl.io_time = awml.io_time
            where awdl.order_no like '%' + #{orderNo} + '%'
            and (awml.manu_type is null or awml.manu_type != '手动取消')
        ) as awdl
        group by awdl.wrk_no, awdl.io_time, awdl.matnr, awdl.order_no
    </select>
    <update id="updateInspect">