|
@@ -1029,4 +1029,98 @@
|
|
ON ttr.RESULT_TOTAL_ID = twr.RESULT_TOTAL_ID
|
|
ON ttr.RESULT_TOTAL_ID = twr.RESULT_TOTAL_ID
|
|
WHERE oo.ORDER_ID = #{orderId}
|
|
WHERE oo.ORDER_ID = #{orderId}
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <!-- 查询未生成账单的计时详单 -->
|
|
|
|
+ <!--计时-->
|
|
|
|
+ <select id="getUnFinishedTimeTruckDetailsOrderList" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
|
+ select bdo.details_no as "detailsNo",
|
|
|
|
+ bdo.order_id as "orderId",
|
|
|
|
+ bdo.details_time as "detailsTime",
|
|
|
|
+ rc.capacity_number as "capacityNumber",
|
|
|
|
+ rct.capacity_type_name as "capacityType",
|
|
|
|
+ air.requirement_type as "requirementType",
|
|
|
|
+ bdo.price_id as "priceId",
|
|
|
|
+ bdo.details_amount as "detailsAmount"
|
|
|
|
+from bmstruck_details_order bdo
|
|
|
|
+join omstruck_order oo on bdo.order_id=oo.order_id
|
|
|
|
+join rms_capacity rc on oo.capacity_id=rc.capacity_id
|
|
|
|
+join rms_capacity_type rct on rc.capacity_type_id=rct.capacity_type_id
|
|
|
|
+join amstruck_inward_plan aip on oo.order_plan_id=aip.plan_id
|
|
|
|
+join amstruck_requirement_plan arp on aip.plan_id=arp.plan_id
|
|
|
|
+join amstruck_inward_requirement air on arp.requirement_plan_id=air.requirement_id
|
|
|
|
+join rms_line rl on air.line_id=rl.line_id
|
|
|
|
+where air.requirement_type=1 and bdo.wether_to_statement=0 and oo.order_type=4
|
|
|
|
+ </select>
|
|
|
|
+ <!--计数-->
|
|
|
|
+ <select id="getUnFinishedNumTruckDetailsOrderList" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
|
+ select bdo.details_no as "detailsNo",
|
|
|
|
+ bdo.order_id as "orderId",
|
|
|
|
+ bdo.details_time as "detailsTime",
|
|
|
|
+ rc.capacity_number as "capacityNumber",
|
|
|
|
+ rct.capacity_type_name as "capacityType",
|
|
|
|
+ air.requirement_type as "requirementType",
|
|
|
|
+ bdo.price_id as "priceId",
|
|
|
|
+ bdo.details_amount as "detailsAmount"
|
|
|
|
+from bmstruck_details_order bdo
|
|
|
|
+join omstruck_order oo on bdo.order_id=oo.order_id
|
|
|
|
+join rms_capacity rc on oo.capacity_id=rc.capacity_id
|
|
|
|
+join rms_capacity_type rct on rc.capacity_type_id=rct.capacity_type_id
|
|
|
|
+join amstruck_inward_plan aip on oo.order_plan_id=aip.plan_id
|
|
|
|
+join amstruck_requirement_plan arp on aip.plan_id=arp.plan_id
|
|
|
|
+join amstruck_inward_requirement air on arp.requirement_plan_id=air.requirement_id
|
|
|
|
+join rms_line rl on air.line_id=rl.line_id
|
|
|
|
+where air.requirement_type=2 and bdo.wether_to_statement=0 and oo.order_type=4
|
|
|
|
+ </select>
|
|
|
|
+ <!--计重-->
|
|
|
|
+ <select id="getUnFinishedWeightTruckDetailsOrderList" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
|
+ select bdo.details_no as "detailsNo",
|
|
|
|
+ bdo.order_id as "orderId",
|
|
|
|
+ bdo.details_time as "detailsTime",
|
|
|
|
+ rc.capacity_number as "capacityNumber",
|
|
|
|
+ rct.capacity_type_name as "capacityType",
|
|
|
|
+ air.requirement_type as "requirementType",
|
|
|
|
+ bdo.price_id as "priceId",
|
|
|
|
+ bdo.details_amount as "detailsAmount"
|
|
|
|
+from bmstruck_details_order bdo
|
|
|
|
+join omstruck_order oo on bdo.order_id=oo.order_id
|
|
|
|
+join rms_capacity rc on oo.capacity_id=rc.capacity_id
|
|
|
|
+join rms_capacity_type rct on rc.capacity_type_id=rct.capacity_type_id
|
|
|
|
+join amstruck_inward_plan aip on oo.order_plan_id=aip.plan_id
|
|
|
|
+join amstruck_requirement_plan arp on aip.plan_id=arp.plan_id
|
|
|
|
+join amstruck_inward_requirement air on arp.requirement_plan_id=air.requirement_id
|
|
|
|
+join rms_line rl on air.line_id=rl.line_id
|
|
|
|
+where air.requirement_type=0 and bdo.wether_to_statement=0 and oo.order_type=4
|
|
|
|
+ </select>
|
|
|
|
+ <!--包月-->
|
|
|
|
+ <select id="getUnFinishedMonthTruckDetailsOrderList" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
|
+ select bdo.details_no as "detailsNo",
|
|
|
|
+ bdo.order_id as "orderId",
|
|
|
|
+ bdo.details_time as "detailsTime",
|
|
|
|
+ rc.capacity_number as "capacityNumber",
|
|
|
|
+ rct.capacity_type_name as "capacityType",
|
|
|
|
+ air.requirement_type as "requirementType",
|
|
|
|
+ bdo.price_id as "priceId",
|
|
|
|
+ bdo.details_amount as "detailsAmount"
|
|
|
|
+from bmstruck_details_order bdo
|
|
|
|
+join omstruck_order oo on bdo.order_id=oo.order_id
|
|
|
|
+join rms_capacity rc on oo.capacity_id=rc.capacity_id
|
|
|
|
+join rms_capacity_type rct on rc.capacity_type_id=rct.capacity_type_id
|
|
|
|
+join amstruck_inward_plan aip on oo.order_plan_id=aip.plan_id
|
|
|
|
+join amstruck_requirement_plan arp on aip.plan_id=arp.plan_id
|
|
|
|
+join amstruck_inward_requirement air on arp.requirement_plan_id=air.requirement_id
|
|
|
|
+join rms_line rl on air.line_id=rl.line_id
|
|
|
|
+where air.requirement_type=3 and bdo.wether_to_statement=0 and oo.order_type=4
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+<!-- 通过运单id获取需求类型(需求类型(0:计重;1:计时;2:计次;3:包月))-->
|
|
|
|
+ <select id="getSettlement" parameterType="java.math.BigDecimal" resultType="java.util.Map">
|
|
|
|
+ select air.requirement_type as "requirementType",
|
|
|
|
+ oom.material_id as "materialId"
|
|
|
|
+ from omstruck_order oo
|
|
|
|
+ left join omstruck_order_material oom on oo.order_id=oom.order_id
|
|
|
|
+ left join amstruck_inward_plan aip on oo.order_plan_id=aip.plan_id
|
|
|
|
+ left join amstruck_requirement_plan arp on arp.plan_id=aip.plan_id
|
|
|
|
+ left join amstruck_inward_requirement air on arp.requirement_id=air.requirement_id
|
|
|
|
+ where oo.order_id=#{orderId}
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|