|
@@ -2371,6 +2371,118 @@
|
|
|
order by "resultTareWeightTime" desc
|
|
|
</if>
|
|
|
</select>
|
|
|
+<!-- 一车多趟获取计重实绩(零星物资) -->
|
|
|
+ <select id="getFactorySkinSporadicWeight" 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.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ 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_CAPACITY RC
|
|
|
+ on RC.CAPACITY_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 in (15,16)
|
|
|
+ )
|
|
|
+ <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="capacityNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityNumber" 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="getFactorySkinSporadicJiMiao" resultType="java.util.Map">
|
|
@@ -2471,6 +2583,109 @@
|
|
|
order by "resultGrossWeightTime" desc
|
|
|
</if>
|
|
|
</select>
|
|
|
+<!-- 根据运输订单id获取计量实绩-->
|
|
|
+ <select id="getFactorySporadicJiMiaoResult" resultType="java.util.Map">
|
|
|
+ select *
|
|
|
+ from (
|
|
|
+ select
|
|
|
+ TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ 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",
|
|
|
+ RM.MATERIAL_NAME "materialName"
|
|
|
+ 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 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 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_TRUCK_CALCULATE RTC
|
|
|
+ on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
|
|
|
+ where RESULT_GROSS_WEIGHT_TIME is not null and
|
|
|
+ OO.ORDER_TYPE in (15,16)
|
|
|
+ )
|
|
|
+ <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="capacityNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityNumber" 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="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="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">
|
|
|
+ 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>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<!-- 零星计皮 -->
|
|
|
<select id="getFactorySkinSporadicJIPi" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
select *
|