luobang 2 年之前
父节点
当前提交
adf6e87d29
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      src/main/resources/com/steerinfo/dil/mapper/StatisticalReportMapper.xml

+ 5 - 2
src/main/resources/com/steerinfo/dil/mapper/StatisticalReportMapper.xml

@@ -2098,8 +2098,11 @@
                               ON TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
                     LEFT JOIN TMSTRUCK_SMS_RUSULT TSR
                               ON TSR.TOTAL_RESULT_ID = TTR.RESULT_TOTAL_ID
-                    WHERE ASO.SALE_TYPE = 1
-                          and ASM.SALE_MATERIAL_ID IS NOT NULL
+                    WHERE
+                    ASM.SALE_MATERIAL_ID IS NOT NULL
+                    and (aso.DELETED = 1 and aso.SALE_ORDER_STATUS = 4 or aso.DELETED != 1 and aso.SALE_ORDER_STATUS between 0 and 4)
+
+                    and ASO.SALE_TYPE = 1
                     <if test="oneDate != null">
                         and to_date(#{oneDate}, 'yyyy-mm-dd') &lt; = to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
                     </if>