Explorar el Código

'合并冲突'

HUJIANGUO hace 3 años
padre
commit
333c81614d

+ 2 - 2
src/main/java/com/steerinfo/dil/mapper/TmstruckLeaveFactoryResultMapper.java

@@ -51,6 +51,6 @@ public interface TmstruckLeaveFactoryResultMapper extends IBaseMapper<TmstruckLe
     Map<String, Object> getDeliveryOrder(String orderNumber);
 
     List<Map<String,Object>> getDeliveryOrderMaterial(String orderNumber);
-//    根据订单id获取零星物资出厂实绩
-    List<Map<String, Object>> getSporadicSuppliesOutFactoryResult(Map<String, Object> map);
+    // 查询零星物资出厂列表
+    List<Map<String,Object>> getSporadicLeaveFactory(Map<String, Object> mapValue);
 }

+ 2 - 1
src/main/java/com/steerinfo/dil/mapper/TmstruckLoadResultMapper.java

@@ -105,5 +105,6 @@ public interface TmstruckLoadResultMapper extends IBaseMapper<TmstruckLoadResult
 
     Integer getOrderType(BigDecimal totalId);
 
-
+    //根据运输id查询所有的零星物资出厂实绩
+    List<Map<String, Object>> getSporadicSuppliesLoadResult(Map<String, Object> map);
 }

+ 5 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.java

@@ -72,6 +72,11 @@ public interface TmstruckWeightResultMapper extends IBaseMapper<TmstruckWeightRe
     //通过运输订单id获取路段顺序号、物资类型、计量实绩主键、line_id
     Map<String, BigDecimal> selectByOrderId(BigDecimal orderId);
 
+    //    根据运输订单Id获取计皮实绩
+    List<Map<String, Object>> getFactorySkinSporadicJiMiao(Map<String, Object> map);
+
+    //    根据运输订单Id获取计皮实绩
+    List<Map<String, Object>> getFactorySkinSporadicJIPi(Map<String, Object> map);
 //    根据运输订单Id获取计皮实绩
     List<Map<String, Object>> getSporadicSuppliesJiPiResult(Map<String, Object> map);
 

+ 3 - 0
src/main/java/com/steerinfo/dil/service/ITmstruckLeaveFactoryResultService.java

@@ -38,4 +38,7 @@ public interface ITmstruckLeaveFactoryResultService {
 
     // APP查询出厂信息
     List<Map<String, Object>> getLeaveFactoryList(String orderNumber);
+
+    // 查询零星物资出厂列表
+    List<Map<String,Object>> getSporadicLeaveFactory(Map<String, Object> mapValue);
 }

+ 2 - 1
src/main/java/com/steerinfo/dil/service/impl/TmstruckEnfactoryResultServiceImpl.java

@@ -116,7 +116,8 @@ public class TmstruckEnfactoryResultServiceImpl implements ITmstruckEnfactoryRes
             case 11:
                 return tmstruckEnfactoryResultMapper.getInFactoryMaterialEnFactoryResult(map); //apiId:357
             case 12:
-                return  tmstruckEnfactoryResultMapper.getSporadicSuppliesEnFactoryResult(map); //apiId:387
+            case 13:
+                return tmstruckEnfactoryResultMapper.getSporadicSuppliesEnFactoryResult(map);// apiId:394
         }
         return null;
     }

+ 12 - 1
src/main/java/com/steerinfo/dil/service/impl/TmstruckLeaveFactoryResultServiceImpl.java

@@ -130,7 +130,8 @@ public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFact
             case 11:
                 return tmstruckLeaveFactoryResultMapper.getInFactoryOutFactoryResult(map); //apiId:361
             case 12:
-                return tmstruckLeaveFactoryResultMapper.getSporadicSuppliesOutFactoryResult(map); //apiId:388
+            case 13:
+                return tmstruckLeaveFactoryResultMapper.getSporadicLeaveFactory(map);
         }
         return null;
     }
@@ -221,4 +222,14 @@ public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFact
         tmstruckLeaveFactoryResult.setGatepostId(new BigDecimal(gatepostId));
         return tmstruckLeaveFactoryResultMapper.updateByPrimaryKeySelective(tmstruckLeaveFactoryResult);
     }
+
+    /**
+     * 查询零星物资出厂列表
+     * @param mapValue
+     * @return
+     */
+    @Override
+    public List<Map<String, Object>> getSporadicLeaveFactory(Map<String, Object> mapValue) {
+        return tmstruckLeaveFactoryResultMapper.getSporadicLeaveFactory(mapValue);
+    }
 }

+ 2 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstruckLoadResultServiceImpl.java

@@ -90,6 +90,8 @@ public class TmstruckLoadResultServiceImpl implements ITmstruckLoadResultService
                 return tmstruckLoadResultMapper.getImportedDomesticNzLoadResult(map); //apiId = 353
             case 11:
                 return tmstruckLoadResultMapper.getInFactoryLoadResult(map); //apiId = 359
+            case 13:
+                return tmstruckLoadResultMapper.getSporadicSuppliesLoadResult(map); //apiId = 400
         }
         return null;
     }

+ 6 - 2
src/main/java/com/steerinfo/dil/service/impl/TmstruckWeightResultServiceImpl.java

@@ -98,7 +98,9 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
             case 11:
                 return tmstruckWeightResultMapper.getInFactoryJiLiangResult(map);       //apiId: 358
             case 12:
-                return tmstruckWeightResultMapper.getSporadicSuppliesJiMiaoResult(map);//apiId:390
+                return tmstruckWeightResultMapper.getSporadicSuppliesJiMiaoResult(map);//apiId:398
+            case 13:
+                return tmstruckWeightResultMapper.getFactorySkinSporadicJiMiao(map);//apiId:402
         }
         return null;
     }
@@ -131,9 +133,11 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
             case 10:
                 return tmstruckWeightResultMapper.getImportedDomesticNzJiPi2Result(map);// apiId: 104
             case 11:
-
+                break;
             case 12:
                 return tmstruckWeightResultMapper.getSporadicSuppliesJiPiResult(map);//apiId:392
+            case 13:
+                return tmstruckWeightResultMapper.getFactorySkinSporadicJIPi(map); //apiId=401
         }
         return null;
     }

+ 10 - 11
src/main/resources/bootstrap.yml

@@ -17,25 +17,25 @@ spring:
 openfeign:
   #正式环境
   ColumnDataFeign:
-    url: ${COLUMNDATAFEIGN_URL:172.16.33.162:8083}
+    url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
   BmsShipFeign:
-    url: ${BMSSHIPFEIGN_URL:172.16.33.162:8021}
+    url: ${BMSSHIPFEIGN_URL:172.16.33.166:8078}
   BmsTruckFeign:
-    url: ${BMSTRUCKFEIGN_URL:172.16.33.162:8076}
+    url: ${BMSTRUCKFEIGN_URL:172.16.33.166:8076}
   WmshBoundFeign:
-    url: ${WMSHBOUNDFEIGN_URL:172.16.33.162:8070}
+    url: ${WMSHBOUNDFEIGN_URL:172.16.33.166:8070}
   WMSFeign:
-    url: ${WMSFEIGN_URL:172.16.33.162:8093}
+    url: ${WMSFEIGN_URL:172.16.33.166:8093}
   OmsFeign:
-    url: ${OMSFEIGN_URL:172.16.33.162:8095}
+    url: ${OMSFEIGN_URL:172.16.33.166:8095}
   JoinFeign:
-    url: ${JOINFEIGN_URL:172.16.33.162:8066}
+    url: ${JOINFEIGN_URL:172.16.33.166:8066}
   QmsFeign:
-    url: ${QMSFEIGN_URL:172.16.33.162:8047}
+    url: ${QMSFEIGN_URL:172.16.33.166:8047}
   ImFeign:
-    url: ${IMFEIGN_URL:172.16.33.162:8055}
+    url: ${IMFEIGN_URL:172.16.33.166:8055}
 
-#    测试环境
+##    测试环境
 #  ColumnDataFeign:
 #    url: ${COLUMNDATAFEIGN_URL:172.16.33.162:8001}
 #  BmsShipFeign:
@@ -122,7 +122,6 @@ mybatis:
     call-setters-on-nulls: true
 
 server:
-#  port: 8008
   port: 8088
 
 

+ 13 - 24
src/main/resources/com/steerinfo/dil/mapper/TmstruckEnfactoryResultMapper.xml

@@ -1228,15 +1228,14 @@
                  rm.material_id = oom.order_material_id
         where oo.order_number = #{orderNumber}
     </select>
-<!--    通过id获取零星物资id-->
+
+    <!--    通过id获取零星物资id-->
     <select id="getSporadicSuppliesEnFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
         select *
         from (
         select TER.RESULT_ID "resultId",
                OO.ORDER_ID      "orderId",
                 OO.ORDER_NUMBER "orderNumber",
-                RS1.SUPPLIER_NAME "sendCompany",
-                RS2.SUPPLIER_NAME "receiveCompany",
                 RC.CARRIER_NAME "carrierName",
                 RG.GATEPOST_NAME "gatepostName",
                 TER.RESULT_ENTRY_MODE "resultEntryMode",
@@ -1248,27 +1247,17 @@
             on TTR.ORDER_ID = OO.ORDER_ID
         left join AMSTRUCK_SPORADIC_ORDER ASO
             on OO.ORDER_PLAN_ID = ASO.SPORADIC_ORDER_ID
-        LEFT JOIN RMS_SUPPLIER RS1
-        ON RS1.SUPPLIER_ID = ASO.SEND_UNIT_ID
-        LEFT JOIN RMS_SUPPLIER RS2
-        ON RS2.SUPPLIER_ID = ASO.RECEIVE_UNIT_ID
-        left join RMS_CARRIER RC
-        on RC.CARRIER_ID = ASO.CARRIER_ID
-        left join RMS_GATEPOST RG
-        on RG.GATEPOST_ID = TER.GATEPOST_ID
-        where TER.RESULT_ENTRY_GATE_TIME is not null
-        and OO.ORDER_TYPE in (12, 13)
+                   left join RMS_GATEPOST RG
+                   on RG.GATEPOST_ID = TER.GATEPOST_ID
+                          left join RMS_CARRIER RC
+                          on RC.CARRIER_ID = ASO.CARRIER_ID
+        and OO.ORDER_TYPE = #{orderTypee}
         )
         <where>
-            <if test="materialName != null">
-                <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-                    "materialName" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="supplierName != null">
+            <if test="sendCompany != null">
                 and
-                <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
-                    "supplierName" like '%${item}%'
+                <foreach collection="sendCompany" item="item" open="(" separator="or" close=")">
+                    "sendCompany" like '%${item}%'
                 </foreach>
             </if>
             <if test="orderNumber != null">
@@ -1283,10 +1272,10 @@
                     "carrierName" like '%${item}%'
                 </foreach>
             </if>
-            <if test="shipperName != null">
+            <if test="receiveCompany != null">
                 and
-                <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
-                    "shipperName" like '%${item}%'
+                <foreach collection="receiveCompany" item="item" open="(" separator="or" close=")">
+                    "receiveCompany" like '%${item}%'
                 </foreach>
             </if>
             <if test="resultEntryMode != null">

+ 62 - 62
src/main/resources/com/steerinfo/dil/mapper/TmstruckLeaveFactoryResultMapper.xml

@@ -1151,68 +1151,68 @@
             and twr.MATERIAL_ID = oom.MATERIAL_ID
         where oo.order_number = #{orderNumber}
     </select>
-<!--    根据订单id获取零星物资出厂实绩-->
-    <select id="getSporadicSuppliesOutFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
-    select *
-    from (
-    select
-    TLFR.RESULT_ID                     "resultId",
-    OO.ORDER_NUMBER                    "orderNumber",
-    RC.CARRIER_NAME                    "carrierName",
-    RG.GATEPOST_NAME                   "gatepostName",
-    TLFR.RESULT_OUT_MODE               "resultOutMode",
-    TLFR.RESULT_OUT_GATE_TIME          "resultOutGateTime",
-    TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
-    from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
-    left join TMSTRUCK_TOTAL_RESULT TTR
-    on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
-    left join OMSTRUCK_ORDER OO
-    on OO.ORDER_ID = TTR.ORDER_ID
-    left join RMS_CARRIER RC
-    on RC.CARRIER_ID = OO.CAPACITY_ID
-    left join RMS_GATEPOST RG
-    on RG.GATEPOST_ID = TLFR.GATEPOST_ID
 
-    where RESULT_OUT_GATE_TIME is not null
-    and OO.ORDER_TYPE = 12
-    )
-    <where>
-        <if test="orderNumber != null">
-            <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-                "orderNumber" like '%${item}%'
-            </foreach>
-        </if>
-        <if test="carrierName != null">
-            and
-            <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
-                "carrierName" like '%${item}%'
-            </foreach>
-        </if>
-        <if test="gatepostName != null">
-            and
-            <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
-                "gatepostName" like '%${item}%'
-            </foreach>
-        </if>
-        <if test="resultOutMode != null">
-            and
-            <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
-                "resultOutMode" like '%${item}%'
-            </foreach>
-        </if>
-        <if test="resultOutGateTime != null">
-            and
-            <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
-                "resultOutGateTime" like '%${item}%'
-            </foreach>
-        </if>
-        <if test="resultTruckSnapshotPicture != null">
-            and
-            <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
-                "resultTruckSnapshotPicture" like '%${item}%'
-            </foreach>
-        </if>
-    </where>
-    <include refid="orderByOutTime"></include>
+    <select id="getSporadicLeaveFactory" parameterType="java.util.Map" resultType="java.util.Map">
+        select *
+        from (
+        select TLFR.RESULT_ID              "resultId",
+        OO.ORDER_NUMBER                    "orderNumber",
+        RC.CAPACITY_NUMBER                 "capacityNumber",
+        RG.GATEPOST_NAME                   "gatepostName",
+        TLFR.RESULT_OUT_MODE               "resultOutMode",
+        TLFR.RESULT_OUT_GATE_TIME          "resultOutGateTime",
+        TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
+        from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
+        left join TMSTRUCK_TOTAL_RESULT TTR
+        on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
+        left join OMSTRUCK_ORDER OO
+        on OO.ORDER_ID = TTR.ORDER_ID
+        left join AMSTRUCK_SPORADIC_ORDER ASO
+        on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
+        left join RMS_CAPACITY RC
+        on RC.CAPACITY_ID = OO.CAPACITY_ID
+        left join RMS_GATEPOST RG
+        on RG.GATEPOST_ID = TLFR.GATEPOST_ID
+        where RESULT_OUT_GATE_TIME is not null
+        and OO.ORDER_TYPE = #{orderTypee}
+        )
+        <where>
+            <if test="orderNumber != null">
+                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+                    "orderNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="capacityNumber != null">
+                and
+                <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
+                    "capacityNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="gatepostName != null">
+                and
+                <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
+                    "gatepostName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultOutMode != null">
+                and
+                <foreach collection="resultOutMode" item="item" open="(" separator="or" close=")">
+                    "resultOutMode" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultOutGateTime != null">
+                and
+                <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
+                    "resultOutGateTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultTruckSnapshotPicture != null">
+                and
+                <foreach collection="resultTruckSnapshotPicture" item="item" open="(" separator="or" close=")">
+                    "resultTruckSnapshotPicture" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderByOutTime"></include>
     </select>
 </mapper>

+ 84 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckLoadResultMapper.xml

@@ -1481,4 +1481,88 @@
          where ttr.result_total_id = #{totalId}
         </select>
 
+    <!--    根据订单id查询所有的零星物资出厂实绩-->
+    <select id="getSporadicSuppliesLoadResult" resultType="java.util.Map">
+        select *
+        from (
+        select
+        TLR.RESULT_ID "resultId",
+        OO.ORDER_NUMBER "orderNumber",
+        RC.CARRIER_NAME "carrierName",
+        TLR.RESULT_MEASURED_TONNAGE "resultMeasuredTonnage",
+        TLR.RESULT_ISCLEAR "resultIsclear",
+        to_char(TLR.RESULT_LOAD_START_TIME, 'yyyy-mm-dd') "resultLoadStartTime",
+        TLR.INSERT_UPDATE_REMARK "insertUpdateRemark",
+        TLR.INSERT_TIME "insertTime",
+        RCON.CONSIGNEE_COMPANY_NAME "receiveCompany",
+        RS.SUPPLIER_NAME "sendCompany"
+
+        from TMSTRUCK_LOAD_RESULT TLR
+        left join TMSTRUCK_TOTAL_RESULT TTR
+        on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join OMSTRUCK_ORDER OO
+        on TTR.ORDER_ID = OO.ORDER_ID
+
+        left join AMSTRUCK_SPORADIC_ORDER ASO
+        on OO.ORDER_PLAN_ID = ASO.SPORADIC_ORDER_ID
+
+        left join RMS_CARRIER RC
+        on RC.CARRIER_ID = ASO.CARRIER_ID
+
+        left join RMS_SUPPLIER RS
+        on RS.SUPPLIER_ID = ASO.SEND_UNIT_ID
+        left join RMS_CONSIGNEE RCON
+        on RCON.CONSIGNEE_ID = ASO.RECEIVE_UNIT_ID
+
+        where TLR.STATUS = #{status} and OO.ORDER_TYPE = #{orderTypee}
+        )
+        <where>
+            <if test="orderNumber != null">
+                and
+                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+                    "orderNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="carrierName != null">
+                and
+                <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
+                    "carrierName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultIsclear != null">
+                and
+                <foreach collection="resultIsclear" item="item" open="(" separator="or" close=")">
+                    "resultIsclear" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultLoadStartTime != null">
+                and
+                <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
+                    "resultLoadStartTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="insertUpdateRemark != null">
+                and
+                <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
+                    "insertUpdateRemark" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="receiveCompany != null">
+                and
+                <foreach collection="receiveCompany" item="item" open="(" separator="or" close=")">
+                    "receiveCompany" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="sendCompany != null">
+                and
+                <foreach collection="sendCompany" item="item" open="(" separator="or" close=")">
+                    "sendCompany" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderBy"></include>
+        <if test="orderField == null  ">
+            order by "resultLoadStartTime" desc
+        </if>
+    </select>
 </mapper>

+ 65 - 79
src/main/resources/com/steerinfo/dil/mapper/TmstruckUnloadResultMapper.xml

@@ -886,86 +886,72 @@
         </where>
         <include refid="orderBy"></include>
     </select>
-<!--    根据总实绩ID查询卸货地点-->
+
+    <!--    根据总实绩ID查询卸货地点-->
     <select id="getSporadicSuppliesUnloadResult" resultType="java.util.Map">
-    SELECT *
-    FROM (
-    SELECT TUR.RESULT_ID             "resultId",
-            OO.ORDER_NUMBER           "orderNumber",
-            RC.CARRIER_NAME        "carrierName",
-            RM.MATERIAL_NAME          "materialName",
-            OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
-            TUR.RESULT_START_TIME     "resultStartTime",
-            TUR.RESULT_END_TIME       "resultEndTime",
-            TUR.RESULT_DURATION       "resultDuration",
-            RW.WAREHOUSE_NAME         "warehouseName"
-    FROM TMSTRUCK_UNLOAD_RESULT TUR
-    LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
-    ON TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
-    LEFT JOIN OMSTRUCK_ORDER OO
-    ON OO.ORDER_ID = TTR.ORDER_ID
-    LEFT JOIN RMS_CARRIER RC
-    ON RC.CARRIER_ID = OO.CAPACITY_ID
-    LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
-    ON OOM.ORDER_ID = OO.ORDER_ID
-    LEFT JOIN RMS_MATERIAL RM
-    ON RM.MATERIAL_ID = OOM.MATERIAL_ID
-    LEFT JOIN RMS_WAREHOUSE RW
-    ON RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
-    WHERE TUR.RESULT_START_TIME IS NOT NULL
-    AND OO.ORDER_TYPE = 12
-    )
-    <where>
-        <if test="orderNumber != null">
-            <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-                "orderNumber" like '%${item}%'
-            </foreach>
-        </if>
-        <if test="carrierName != null">
-            and
-            <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
-                "carrierName" like '%${item}%'
-            </foreach>
-        </if>
-        <if test="materialName != null">
-            and
-            <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-                "materialName" like '%${item}%'
-            </foreach>
-        </if>
-        <if test="orderMaterialNumber != null">
-            and
-            <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
-                "orderMaterialNumber" like '%${item}%'
-            </foreach>
-        </if>
-        <if test="warehouseName != null">
-            and
-            <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
-                "warehouseName" like '%${item}%'
-            </foreach>
-        </if>
-        <if test="resultStartTime != null">
-            and
-            <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">
-                "resultStartTime" like '%${item}%'
-            </foreach>
-        </if>
-        <if test="resultEndTime != null">
-            and
-            <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
-                "resultEndTime" like '%${item}%'
-            </foreach>
-        </if>
-        <if test="resultDuration != null">
-            and
-            <foreach collection="resultDuration" item="item" open="(" separator="or" close=")">
-                "resultDuration" like '%${item}%'
-            </foreach>
-        </if>
-    </where>
-    <include refid="orderBy"></include>
-    </select>
+        SELECT *
+        FROM (
+        SELECT
+        TUR.RESULT_ID             "resultId",
+        OO.ORDER_NUMBER           "orderNumber",
+        RC.CARRIER_NAME        "carrierName",
+        TUR.RESULT_START_TIME     "resultStartTime",
+        TUR.RESULT_END_TIME       "resultEndTime",
+        TUR.RESULT_DURATION       "resultDuration",
+        RW.WAREHOUSE_NAME         "warehouseName"
 
+        FROM TMSTRUCK_UNLOAD_RESULT TUR
+        LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+        ON TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
+        LEFT JOIN OMSTRUCK_ORDER OO
+        ON OO.ORDER_ID = TTR.ORDER_ID
+        LEFT JOIN AMSTRUCK_SPORADIC_ORDER ASO
+        ON OO.ORDER_PLAN_ID = ASO.SPORADIC_ORDER_ID
+        LEFT JOIN RMS_CARRIER RC
+        ON RC.CARRIER_ID = ASO.CARRIER_ID
+        LEFT JOIN RMS_WAREHOUSE RW
+        ON RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
+        WHERE TUR.RESULT_START_TIME IS NOT NULL
+        AND OO.ORDER_TYPE = 12
+        )
+        <where>
+            <if test="orderNumber != null">
+                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+                    "orderNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="carrierName != null">
+                and
+                <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
+                    "carrierName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="warehouseName != null">
+                and
+                <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
+                    "warehouseName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultStartTime != null">
+                and
+                <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">
+                    "resultStartTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultEndTime != null">
+                and
+                <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
+                    "resultEndTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultDuration != null">
+                and
+                <foreach collection="resultDuration" item="item" open="(" separator="or" close=")">
+                    "resultDuration" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderBy"></include>
+    </select>
 
 </mapper>

+ 210 - 37
src/main/resources/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.xml

@@ -2161,7 +2161,97 @@
             order by "resultTareWeightTime" desc
         </if>
     </select>
-<!--    根据运输订单Id获取零星物资计皮实绩-->
+
+    <!--    根据运输订单Id获取计毛实绩-->
+    <select id="getSporadicSuppliesJiMiaoResult" resultType="java.util.Map">
+        select *
+        from (
+        select
+        TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
+        OO.ORDER_NUMBER "orderNumber",
+        RC.CARRIER_NAME "carrierName",
+        RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
+        TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
+        TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
+        RS1.SUPPLIER_NAME "sendCompany",
+        RS2.CONSIGNEE_COMPANY_NAME "receiveCompany",
+        OO.ORDER_ID "orderId",
+        OO.ORDER_STATUS "orderStatus"
+
+        from TMSTRUCK_WEIGHT_RESULT TWR
+        left join TMSTRUCK_TOTAL_RESULT TTR
+        on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join OMSTRUCK_ORDER OO
+        on TTR.ORDER_ID = OO.ORDER_ID
+        left join AMSTRUCK_SPORADIC_ORDER ASO
+        on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
+        left join RMS_CARRIER RC
+        on RC.CARRIER_ID = ASO.CARRIER_ID
+        left join RMS_TRUCK_CALCULATE RTC
+        on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
+        left join RMS_SUPPLIER RS1
+        on RS1.SUPPLIER_ID = ASO.SEND_UNIT_ID
+        left join RMS_CONSIGNEE RS2
+        on RS2.CONSIGNEE_ID = ASO.RECEIVE_UNIT_ID
+        where RESULT_GROSS_WEIGHT_TIME is not null and
+        OO.ORDER_TYPE = 12
+        )
+        <where>
+            <if test="purchaseOrderNo != null">
+                <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
+                    "purchaseOrderNo" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="orderNumber != null">
+                and
+                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+                    "orderNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="carrierName != null">
+                and
+                <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
+                    "carrierName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="truckCalculateNumber != null">
+                and
+                <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
+                    "truckCalculateNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultGrossWeight != null">
+                and
+                <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeight" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="sendCompany != null">
+                and
+                <foreach collection="sendCompany" item="item" open="(" separator="or" close=")">
+                    "sendCompany" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="receiveCompany != null">
+                and
+                <foreach collection="receiveCompany" item="item" open="(" separator="or" close=")">
+                    "receiveCompany" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultGrossWeightTime != null">
+                and
+                <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeightTime" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderBy"></include>
+        <if test="orderField == null  ">
+            order by "resultGrossWeightTime" desc
+        </if>
+    </select>
+
+    <!--    根据运输订单Id获取零星物资计皮实绩-->
     <select id="getSporadicSuppliesJiPiResult" resultType="java.util.Map">
         select *
         from (
@@ -2193,7 +2283,7 @@
         on OOM.ORDER_ID = OO.ORDER_ID
         left join RMS_MATERIAL RM
         on RM.MATERIAL_ID = OOM.MATERIAL_ID
-        where RESULT_TARE_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
+        where RESULT_TARE_WEIGHT_TIME is not null and OO.ORDER_TYPE = 12
         )
         <where>
             <if test="purchaseOrderNo != null">
@@ -2273,43 +2363,34 @@
             order by "resultTareWeightTime" desc
         </if>
     </select>
-<!--    根据运输订单Id获取计毛实绩-->
-    <select id="getSporadicSuppliesJiMiaoResult" resultType="java.util.Map">
+
+    <!--    根据运输订单Id获取计毛实绩-->
+    <select id="getFactorySkinSporadicJiMiao" resultType="java.util.Map">
         select *
         from (
         select
-                TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
-                APO.SPORADIC_ORDER_NO "purchaseOrderNo",
-                RM.MATERIAL_NAME "materialName",
-                OO.ORDER_NUMBER "orderNumber",
-                RC.CARRIER_NAME "carrierName",
-                RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
-                TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
-                TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
-                RS.SUPPLIER_NAME "supplierName",
-                RCON.SHIPPER_NAME "consigneeCompanyName",
-                OO.ORDER_ID "orderId",
-                OO.ORDER_STATUS "orderStatus"
+        TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
+        OO.ORDER_NUMBER "orderNumber",
+        RC.CARRIER_NAME "carrierName",
+        RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
+        TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
+        TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
+        TWR.RESULT_NET_WEIGHT "resultNetWeight",
+        TWR.RESULT_TARE_WEIGHT "resultTareWeight",
+        TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime"
         from TMSTRUCK_WEIGHT_RESULT TWR
         left join TMSTRUCK_TOTAL_RESULT TTR
         on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
         left join OMSTRUCK_ORDER OO
         on TTR.ORDER_ID = OO.ORDER_ID
-        left join AMSTRUCK_SPORADIC_ORDER APO
-        on APO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
+        left join AMSTRUCK_SPORADIC_ORDER ASO
+        on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
         left join RMS_CARRIER RC
-        on RC.CARRIER_ID = OO.CAPACITY_ID
+        on RC.CARRIER_ID = ASO.CARRIER_ID
         left join RMS_TRUCK_CALCULATE RTC
         on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
-        left join OMSTRUCK_ORDER_MATERIAL OOM
-        on OOM.ORDER_ID = OO.ORDER_ID
-        left join RMS_MATERIAL RM
-        on RM.MATERIAL_ID = OOM.MATERIAL_ID
-        left join RMS_SUPPLIER RS
-        on RS.SUPPLIER_ID = APO.SEND_UNIT_ID
-        left join RMS_SHIPPER RCON
-        on RCON.SHIPPER_ID = APO.RECEIVE_UNIT_ID
-        where RESULT_GROSS_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
+        where RESULT_GROSS_WEIGHT_TIME is not null and
+        OO.ORDER_TYPE = 13
         )
         <where>
             <if test="purchaseOrderNo != null">
@@ -2317,12 +2398,6 @@
                     "purchaseOrderNo" like '%${item}%'
                 </foreach>
             </if>
-            <if test="materialName != null">
-                and
-                <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-                    "materialName" like '%${item}%'
-                </foreach>
-            </if>
             <if test="orderNumber != null">
                 and
                 <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
@@ -2347,10 +2422,28 @@
                     "resultGrossWeight" like '%${item}%'
                 </foreach>
             </if>
-            <if test="supplierName != null">
+            <if test="resultGrossWeightTime != null">
                 and
-                <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
-                    "supplierName" like '%${item}%'
+                <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeightTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultTareWeight != null">
+                and
+                <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
+                    "resultTareWeight" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultTareWeightTime != null">
+                and
+                <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultTareWeightTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultNetWeight != null">
+                and
+                <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
+                    "resultNetWeight" like '%${item}%'
                 </foreach>
             </if>
             <if test="resultGrossWeightTime != null">
@@ -2366,4 +2459,84 @@
         </if>
     </select>
 
+    <select id="getFactorySkinSporadicJIPi"  parameterType="java.util.Map"  resultType="java.util.Map">
+        select *
+        from (
+        select
+        TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
+        ASO.SPORADIC_ORDER_NO "purchaseOrderNo",
+        OO.ORDER_NUMBER "orderNumber",
+        RC.CARRIER_NAME "carrierName",
+        RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
+        TWR.RESULT_TARE_WEIGHT "resultTareWeight",
+        TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
+        TWR.RESULT_POUND_NO "resultPoundNo"
+        from TMSTRUCK_WEIGHT_RESULT TWR
+        left join TMSTRUCK_TOTAL_RESULT TTR
+        on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join OMSTRUCK_ORDER OO
+        on TTR.ORDER_ID = OO.ORDER_ID
+        left join AMSTRUCK_SPORADIC_ORDER ASO
+        on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
+        left join RMS_CARRIER RC
+        on RC.CARRIER_ID = ASO.CARRIER_ID
+        left join RMS_TRUCK_CALCULATE RTC
+        on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
+        where RESULT_TARE_WEIGHT_TIME is not null
+        and OO.ORDER_TYPE = 13
+        )
+        <where>
+            <if test="purchaseOrderNo != null">
+                <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
+                    "purchaseOrderNo" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="orderNumber != null">
+                and
+                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+                    "orderNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="carrierName != null">
+                and
+                <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
+                    "carrierName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="truckCalculateNumber != null">
+                and
+                <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
+                    "truckCalculateNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultTareWeight != null">
+                and
+                <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
+                    "resultTareWeight" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultPoundNo != null">
+                and
+                <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
+                    "resultPoundNo" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultTareWeightTime != null">
+                and
+                <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultTareWeightTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultPoundNo != null">
+                and
+                <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
+                    "resultPoundNo" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderBy"></include>
+        <if test="orderField == null  ">
+            order by "resultTareWeightTime" desc
+        </if>
+    </select>
 </mapper>