浏览代码

Merge branch 'master' of https://git.steerinfo.com/luobang/DIL-DAZHOU-WMS2

zhouzh 3 年之前
父节点
当前提交
0966d3cbca
共有 1 个文件被更改,包括 11 次插入4 次删除
  1. 11 4
      src/main/resources/com/steerinfo/dil/mapper/WmspInboundResultMapper.xml

+ 11 - 4
src/main/resources/com/steerinfo/dil/mapper/WmspInboundResultMapper.xml

@@ -629,7 +629,8 @@
         RPG.GRID_GRADATION_NUMBER "gridGradationNumber"
 
         from wmsp_inbound_result wir
-
+        LEFT JOIN WMSP_GRID_MATERIAL wgm
+        ON wgm.MATERIAL_ID = wir.MATERIAL_ID
         LEFT JOIN RMS_MATERIAL_STEEL rms
         ON rms.MATERIAL_STEEL_ID = wir.MATERIAL_ID
         LEFT JOIN RMS_MATERIAL rm
@@ -646,7 +647,7 @@
         where wir.inbound_type = 0
         and wir.result_deleted = 0
         and wir.INBOUND_ISCOMPLETE != 2
-        and wir.UPDATE_TIME is null
+        and wgm.UPDATE_TIME is null
         order by wir.inbound_time desc
         <where>
             <if test="INBOUND_NUMBER != null">
@@ -1348,6 +1349,7 @@
     <update id="updateStatusByMaterilaId">
        update WMSP_INBOUND_RESULT set INBOUND_ISCOMPLETE = 1 where MATERIAL_ID=#{materialId}
     </update>
+<!--    and  wir.insert_time between sysdate and trunc(sysdate + 1, 'dd')-->
     <update id="updateStatusByMaterialId">
         update wmsp_inbound_result set INBOUND_ISCOMPLETE=2 where inbound_id in
           (
@@ -1355,9 +1357,14 @@
               select inbound_id from WMSP_INBOUND_RESULT wir
               left join rms_material_steel rms
               on wir.material_id = rms.material_steel_id
-              where rms.material_id=(select distinct material_id from rms_material_steel where material_steel_id =#{materialId} ) and INBOUND_ISCOMPLETE='1' and Rownum='1' and rms.UPDATE_TIME is null
+              left join WMSP_GRID_MATERIAL wgm
+              on wgm.MATERIAL_ID = rms.material_steel_id
+              where rms.material_id=(
+                  select distinct rms2.material_id from rms_material_steel rms2
+                  where material_steel_id =#{materialId}
+                ) and INBOUND_ISCOMPLETE='1'  and wgm.deleted ='0'
               order by wir.insert_time desc
-          )
+          ) where  Rownum='1'
         )
         
     </update>