浏览代码

Merge remote-tracking branch 'origin/master'

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

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

@@ -1770,11 +1770,11 @@
                 AND OO.OPTIONER_CODE=#{orgCode}
             </if>
             <if test="oneDate != null">
-                and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; =  TWR.RESULT_TARE_WEIGHT_TIME
+                and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = greatest(TWR.RESULT_TARE_WEIGHT_TIME,TWR.RESULT_GROSS_WEIGHT_TIME)
             </if>
             <if test="startDate != null">
-                and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; =   TWR.RESULT_TARE_WEIGHT_TIME
-                and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_TARE_WEIGHT_TIME
+                and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; =  greatest(TWR.RESULT_TARE_WEIGHT_TIME,TWR.RESULT_GROSS_WEIGHT_TIME)
+                and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= greatest(TWR.RESULT_TARE_WEIGHT_TIME,TWR.RESULT_GROSS_WEIGHT_TIME)
             </if>
             <if test="index!=null">
                 and ((instr(RC.CAPACITY_NUMBER, #{index}) > 0) or (instr(RW1.WAREHOUSE_NAME, #{index}) > 0)
@@ -1859,11 +1859,11 @@
             or  (instr( RC.CARRIER_NAME , #{index}) > 0)  or     (instr(RL.LINE_NAME , #{index}) > 0))
         </if>
         <if test="oneDate != null">
-            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = TWR.RESULT_TARE_WEIGHT_TIME
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = GREATEST(TWR.RESULT_GROSS_WEIGHT_TIME,TWR.RESULT_TARE_WEIGHT_TIME)
         </if>
         <if test="startDate != null">
-            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=  TWR.RESULT_TARE_WEIGHT_TIME
-            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >=  TWR.RESULT_TARE_WEIGHT_TIME
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=  GREATEST(TWR.RESULT_GROSS_WEIGHT_TIME,TWR.RESULT_TARE_WEIGHT_TIME)
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >=  GREATEST(TWR.RESULT_GROSS_WEIGHT_TIME,TWR.RESULT_TARE_WEIGHT_TIME)
         </if>
         )
     </select>