Просмотр исходного кода

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

zhouzh 3 лет назад
Родитель
Сommit
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"
         RPG.GRID_GRADATION_NUMBER "gridGradationNumber"
 
 
         from wmsp_inbound_result wir
         from wmsp_inbound_result wir
-
+        LEFT JOIN WMSP_GRID_MATERIAL wgm
+        ON wgm.MATERIAL_ID = wir.MATERIAL_ID
         LEFT JOIN RMS_MATERIAL_STEEL rms
         LEFT JOIN RMS_MATERIAL_STEEL rms
         ON rms.MATERIAL_STEEL_ID = wir.MATERIAL_ID
         ON rms.MATERIAL_STEEL_ID = wir.MATERIAL_ID
         LEFT JOIN RMS_MATERIAL rm
         LEFT JOIN RMS_MATERIAL rm
@@ -646,7 +647,7 @@
         where wir.inbound_type = 0
         where wir.inbound_type = 0
         and wir.result_deleted = 0
         and wir.result_deleted = 0
         and wir.INBOUND_ISCOMPLETE != 2
         and wir.INBOUND_ISCOMPLETE != 2
-        and wir.UPDATE_TIME is null
+        and wgm.UPDATE_TIME is null
         order by wir.inbound_time desc
         order by wir.inbound_time desc
         <where>
         <where>
             <if test="INBOUND_NUMBER != null">
             <if test="INBOUND_NUMBER != null">
@@ -1348,6 +1349,7 @@
     <update id="updateStatusByMaterilaId">
     <update id="updateStatusByMaterilaId">
        update WMSP_INBOUND_RESULT set INBOUND_ISCOMPLETE = 1 where MATERIAL_ID=#{materialId}
        update WMSP_INBOUND_RESULT set INBOUND_ISCOMPLETE = 1 where MATERIAL_ID=#{materialId}
     </update>
     </update>
+<!--    and  wir.insert_time between sysdate and trunc(sysdate + 1, 'dd')-->
     <update id="updateStatusByMaterialId">
     <update id="updateStatusByMaterialId">
         update wmsp_inbound_result set INBOUND_ISCOMPLETE=2 where inbound_id in
         update wmsp_inbound_result set INBOUND_ISCOMPLETE=2 where inbound_id in
           (
           (
@@ -1355,9 +1357,14 @@
               select inbound_id from WMSP_INBOUND_RESULT wir
               select inbound_id from WMSP_INBOUND_RESULT wir
               left join rms_material_steel rms
               left join rms_material_steel rms
               on wir.material_id = rms.material_steel_id
               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
               order by wir.insert_time desc
-          )
+          ) where  Rownum='1'
         )
         )
         
         
     </update>
     </update>