|
@@ -1004,14 +1004,10 @@
|
|
|
</select>
|
|
|
|
|
|
<!-- 得到单价id -->
|
|
|
- <select id="getPriceId" resultType="java.util.Map">
|
|
|
- SELECT actp.PRICE_ID as "priceId"
|
|
|
- FROM AMS_CONTRACT_TRANSPORT_PRICE actp
|
|
|
- LEFT JOIN RMS_CAPACITY rc
|
|
|
- ON rc.CAPACITY_ID = actp.CAPACITY_ID
|
|
|
- WHERE rc.CAPACITY_TYPE_ID = 1
|
|
|
- AND actp.DELETED = 0
|
|
|
- ORDER BY actp.PRICE_DATE DESC
|
|
|
+ <select id="getPriceId" resultType="java.util.Map" parameterType="DECIMAL">
|
|
|
+ SELECT OO.PRICE_ID AS "priceId"
|
|
|
+ FROM OMSTRUCK_ORDER OO
|
|
|
+ WHERE OO.ORDER_ID = #{orderId}
|
|
|
</select>
|
|
|
|
|
|
<select id="getPriceValue" parameterType="DECIMAL" resultType="DECIMAL">
|
|
@@ -1021,7 +1017,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getNetWeight" parameterType="DECIMAL" resultType="DECIMAL">
|
|
|
- SELECT twr.RESULT_NET_WEIGHT as "netWeight"
|
|
|
+ SELECT SUM(twr.RESULT_NET_WEIGHT) as "netWeight"
|
|
|
FROM OMSTRUCK_ORDER oo
|
|
|
LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr
|
|
|
ON oo.ORDER_ID = ttr.ORDER_ID
|
|
@@ -1032,95 +1028,103 @@
|
|
|
|
|
|
<!-- 查询未生成账单的计时详单 -->
|
|
|
<!--计时-->
|
|
|
- <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 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 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 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="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:包月))-->
|
|
|
+ <!-- 通过运单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"
|
|
|
+ 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}
|
|
|
+ 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>
|