Browse Source

优化oms

luobang 2 years ago
parent
commit
a135388051

+ 14 - 12
src/main/resources/com/steerinfo/dil/mapper/OmstruckOrderMapper.xml

@@ -3207,7 +3207,7 @@
         ON RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
         WHERE OO.ORDER_ID = #{orderId}
         <if test="status == null">
-            AND OO.ORDER_STATUS in (4, 5, 6)
+            AND OO.ORDER_STATUS between 4 and 6
         </if>
         <if test="status == 2">
             AND OO.ORDER_STATUS = 2
@@ -3237,7 +3237,7 @@
         ON RC2.CONSIGNEE_ID=ASO.RECEIVE_UNIT_ID
         WHERE OO.ORDER_ID = #{orderId}
         <if test="status == null">
-            AND OO.ORDER_STATUS in (4, 5, 6)
+            AND OO.ORDER_STATUS between 4 and 6
         </if>
         <if test="status == 2">
             AND OO.ORDER_STATUS = 2
@@ -3284,7 +3284,7 @@
         ON RC.CAPACITY_ID = OO.CAPACITY_ID
         WHERE OO.ORDER_ID = #{orderId}
         <if test="status == null">
-            AND OO.ORDER_STATUS in (4, 5, 6)
+            AND OO.ORDER_STATUS between 4 and 6
         </if>
         <if test="status == 2">
             AND OO.ORDER_STATUS = 2
@@ -3318,7 +3318,7 @@
         ON RC.CAPACITY_ID = OO.CAPACITY_ID
         WHERE OO.ORDER_ID = #{orderId}
         <if test="status == null">
-            AND OO.ORDER_STATUS in (4, 5, 6)
+            AND OO.ORDER_STATUS between 4 and 6
         </if>
         <if test="status != null">
             AND OO.ORDER_STATUS = 2
@@ -3350,10 +3350,11 @@
         LEFT JOIN RMS_RECEIVE_PLACE RRP ON RRP.PLACE_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
         LEFT JOIN RMS_RECEIVE_ADDRESS RDA ON RDA.ADDRESS_ID = RRP.ADDRESS_ID
         WHERE
+        ASO.DELETED = 0
+        and
         OO.ORDER_ID = #{orderId}
-        and ASO.DELETED = 0
         <if test="status == null">
-            AND OO.ORDER_STATUS in (4, 5, 6)
+            AND OO.ORDER_STATUS between 4 and 6
         </if>
         <if test="status == 2">
             AND OO.ORDER_STATUS = 2
@@ -3699,7 +3700,7 @@
         ON RW1.WAREHOUSE_ID = ARM.REQUIREMENT_PLATFORM_ID
         where oo.order_id = #{orderId}
         <if test="status == null">
-            AND OO.ORDER_STATUS in (4, 5, 6)
+            AND OO.ORDER_STATUS between 4 and 6
         </if>
         <if test="status == 2">
             AND OO.ORDER_STATUS = 2
@@ -3941,7 +3942,8 @@
         OO.CAN_WORK "canWork",
         OO.ORDER_STATUS "orderStatus",
         ASO.SALE_ORDER_ID   "saleOrderId",
-        OO.DELETED  "orderDeleted"
+        OO.DELETED  "orderDeleted",
+        OO.UPDATE_USERNAME "deleteReason"
         FROM
         OMSTRUCK_ORDER OO
         LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
@@ -3957,16 +3959,16 @@
         from OMSTRUCK_ORDER OO
         left join OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID=OOM.ORDER_ID
         left join RMS_MATERIAL RM ON OOM.MATERIAL_ID = RM.MATERIAL_ID
-        where OO.ORDER_STATUS in (4,5)
+        where OO.ORDER_STATUS between 4 and 5
         and
         RM.MATERIAL_ID||'' in (select SPECTIONS_MODEL from QMS_MODEL_UNROOLED)
         ) TEMP ON TEMP."orderId"=OO.ORDER_ID
         WHERE
-        OO.ORDER_ID = #{orderId}
-        AND ASO.DELETED = 0
+        ASO.DELETED = 0
+        AND OO.ORDER_ID = #{orderId}
         AND rownum =1
         <if test="status == null">
-            AND OO.ORDER_STATUS in (4, 5, 6)
+            AND OO.ORDER_STATUS between 4 and 6
         </if>
         <if test="status == 2">
             AND OO.ORDER_STATUS = 2

+ 1 - 1
src/main/resources/com/steerinfo/dil/mapper/OmstruckOrderSeparateMapper.xml

@@ -918,7 +918,7 @@
         LEFT JOIN OMSTRUCK_ORDER OO
         ON OO.ORDER_ID = TTR.ORDER_ID
         WHERE OO.ORDER_ID = #{orderId}
-        ORDER BY TWR.RESULT_TARE_WEIGHT DESC)
+        ORDER BY TWR.RESULT_TARE_WEIGHT asc)
         WHERE ROWNUM = 1
     </select>
     <select id="getDueTime" resultType="java.util.Map" parameterType="decimal">