|
@@ -2161,5 +2161,209 @@
|
|
|
order by "resultTareWeightTime" desc
|
|
|
</if>
|
|
|
</select>
|
|
|
+<!-- 根据运输订单Id获取零星物资计皮实绩-->
|
|
|
+ <select id="getSporadicSuppliesJiPiResult" 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",
|
|
|
+ TWR.RESULT_TARE_WEIGHT "resultTareWeight",
|
|
|
+ TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
|
|
|
+ TWR.RESULT_NET_WEIGHT "resultNetWeight",
|
|
|
+ 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 APO
|
|
|
+ on APO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
|
|
|
+ left join RMS_CARRIER RC
|
|
|
+ on RC.CARRIER_ID = OO.CAPACITY_ID
|
|
|
+ left join RMS_TRUCK_CALCULATE RTC
|
|
|
+ on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_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
|
|
|
+ where RESULT_TARE_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="purchaseOrderNo != null">
|
|
|
+ <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
|
|
|
+ "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=")">
|
|
|
+ "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="resultForeignShipName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultForeignShipName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultGrossWeightTime != null">
|
|
|
+ and
|
|
|
+ <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="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="resultNetWeight != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultNetWeight" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "resultTareWeightTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+<!-- 根据运输订单Id获取计毛实绩-->
|
|
|
+ <select id="getSporadicSuppliesJiMiaoResult" 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"
|
|
|
+ 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 RMS_CARRIER RC
|
|
|
+ on RC.CARRIER_ID = OO.CAPACITY_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>
|
|
|
+ <if test="purchaseOrderNo != null">
|
|
|
+ <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
|
|
|
+ "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=")">
|
|
|
+ "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="supplierName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
|
|
|
+ "supplierName" 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>
|
|
|
|
|
|
</mapper>
|