luobang 1 year ago
parent
commit
435554a468

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

@@ -87,6 +87,9 @@
                             on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
                        left join RMS_CONSIGNEE RCON
                             on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
+                       left join RMS_CARRIER RCE
+                            ON RCE.CARRIER_ID = OO.CARRIER_ID
+
               where OO.ORDER_STATUS in (5,2)
                 and OO.ORDER_TYPE = #{orderTypee}
                 <if test="oneDate != null">
@@ -96,6 +99,9 @@
                     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
                 </if>
+                <if test="carrierSsoId != null">
+                    AND RCE.CARRIER_SSO_ID = #{carrierSsoId}
+                </if>
                <if test="con!=null">
                 and (instr(RM.MATERIAL_NAME, #{con}) > 0 or instr(RS.SUPPLIER_NAME, #{con}) > 0 or
                    instr(RCON.CONSIGNEE_COMPANY_NAME, #{con}) > 0 or instr(RC.CAPACITY_NUMBER, #{con}) > 0)
@@ -253,6 +259,9 @@
             and (instr(RM.MATERIAL_NAME, #{con}) > 0 or instr(RS.SUPPLIER_NAME, #{con}) > 0 or
             instr(RCON.CONSIGNEE_COMPANY_NAME, #{con}) > 0 or instr(RC.CAPACITY_NUMBER, #{con}) > 0)
         </if>
+        <if test="carrierSsoId != null">
+            AND RCE.CARRIER_SSO_ID = #{carrierSsoId}
+        </if>
         )
         <where>
             <if test="capacityNumber != null">
@@ -457,10 +466,17 @@
             and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
             and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
         </if>
-        <if test="oneDate != null and orderTypee != 1">
-            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+        <if test="oneDate != null and orderTypee != 1 and isEnfactoryFlag == null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TWR.RESULT_GROSS_WEIGHT_TIME
+        </if>
+        <if test="startDate != null and orderTypee != 1 and isEnfactoryFlag == null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TWR.RESULT_GROSS_WEIGHT_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_GROSS_WEIGHT_TIME
+        </if>
+        <if test="oneDate != null and orderTypee != 1 and isEnfactoryFlag == 1">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TWR.RESULT_GROSS_WEIGHT_TIME
         </if>
-        <if test="startDate != null and orderTypee != 1">
+        <if test="startDate != null and orderTypee != 1 and isEnfactoryFlag == 1">
             and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
             and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
         </if>