|
@@ -903,33 +903,115 @@
|
|
</select>
|
|
</select>
|
|
<!-- 内转物流查询装车作业 -->
|
|
<!-- 内转物流查询装车作业 -->
|
|
<select id="selectLoadedForConverted" parameterType="java.util.Map" resultType="java.util.Map">
|
|
<select id="selectLoadedForConverted" parameterType="java.util.Map" resultType="java.util.Map">
|
|
- select
|
|
|
|
- TLR.RESULT_ID "resultId",
|
|
|
|
- TLR.RESULT_BILLABLE_TONNAGE "resultBillableTonnage",
|
|
|
|
- AROD.DAYPLAN_NO "dayplanNo",
|
|
|
|
- TLR.RESULT_CLASS "resultClass",
|
|
|
|
- TLR.INSERT_UPDATE_REMARK "insertUpdateRemark",
|
|
|
|
- TO_CHAR(TLR.RESULT_LOADING_DATE, 'yyyy-mm-dd') "resultLoadingDate",
|
|
|
|
- TLR.RESULT_WAGON_NO "resultWagonNo",
|
|
|
|
- RAS.ARRIVAL_NAME "dayplanSendStationName",
|
|
|
|
- RAS2.ARRIVAL_NAME "dayplanToTheStationName",
|
|
|
|
- AROD.DAYPLAN_CONSIGNEE_NAME "dayplanConsigneeName",
|
|
|
|
- AROD.DAYPLAN_CONSIGNEE_TEL "dayplanConsigneeTel",
|
|
|
|
- RAS2.DAYPLAN_DEDICATED_LINE "dayplanDedicatedLine",
|
|
|
|
- RS.SHIPPER_NAME "shipperName",
|
|
|
|
- RC.CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
|
|
|
|
- from TMSTRAIN_LOADING_RESULT TLR
|
|
|
|
- LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
|
|
|
|
- ON AROD.DAYPLAN_ID = TLR.PURCHASE_ORDER_RAIL_PLAN_ID
|
|
|
|
- LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS
|
|
|
|
- ON RAS.ARRIVAL_ID = AROD.DAYPLAN_SEND_STATION_ID
|
|
|
|
- LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS2
|
|
|
|
- ON AROD.DAYPLAN_TO_THE_STATION_ID = RAS2.ARRIVAL_ID
|
|
|
|
- LEFT JOIN RMS_CONSIGNEE RC
|
|
|
|
- ON RC.CONSIGNEE_ID = AROD.RECEIVING_UNIT_ID
|
|
|
|
- LEFT JOIN RMS_SHIPPER RS
|
|
|
|
- ON RS.SHIPPER_ID = AROD.SHIPPER_ID
|
|
|
|
- WHERE TLR.DELETED = 0 AND TLR.RESULT_TYPE = 4
|
|
|
|
|
|
+ select *
|
|
|
|
+ from (
|
|
|
|
+ select TLR.RESULT_ID "resultId",
|
|
|
|
+ TLR.RESULT_BILLABLE_TONNAGE "resultBillableTonnage",
|
|
|
|
+ AROD.DAYPLAN_NO "dayplanNo",
|
|
|
|
+ TLR.RESULT_CLASS "resultClass",
|
|
|
|
+ TLR.INSERT_UPDATE_REMARK "insertUpdateRemark",
|
|
|
|
+ TO_CHAR(TLR.RESULT_LOADING_DATE, 'yyyy-mm-dd') "resultLoadingDate",
|
|
|
|
+ TLR.RESULT_LOADING_DATE "loadDate",
|
|
|
|
+ TLR.RESULT_WAGON_NO "resultWagonNo",
|
|
|
|
+ RAS.ARRIVAL_NAME "dayplanSendStationName",
|
|
|
|
+ RAS2.ARRIVAL_NAME "dayplanToTheStationName",
|
|
|
|
+ AROD.DAYPLAN_CONSIGNEE_NAME "dayplanConsigneeName",
|
|
|
|
+ AROD.DAYPLAN_CONSIGNEE_TEL "dayplanConsigneeTel",
|
|
|
|
+ RAS2.DAYPLAN_DEDICATED_LINE "dayplanDedicatedLine",
|
|
|
|
+ RS.SHIPPER_NAME "shipperName",
|
|
|
|
+ RC.CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
|
|
|
|
+ from TMSTRAIN_LOADING_RESULT TLR
|
|
|
|
+ LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
|
|
|
|
+ ON AROD.DAYPLAN_ID = TLR.PURCHASE_ORDER_RAIL_PLAN_ID
|
|
|
|
+ LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS
|
|
|
|
+ ON RAS.ARRIVAL_ID = AROD.DAYPLAN_SEND_STATION_ID
|
|
|
|
+ LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS2
|
|
|
|
+ ON AROD.DAYPLAN_TO_THE_STATION_ID = RAS2.ARRIVAL_ID
|
|
|
|
+ LEFT JOIN RMS_CONSIGNEE RC
|
|
|
|
+ ON RC.CONSIGNEE_ID = AROD.RECEIVING_UNIT_ID
|
|
|
|
+ LEFT JOIN RMS_SHIPPER RS
|
|
|
|
+ ON RS.SHIPPER_ID = AROD.SHIPPER_ID
|
|
|
|
+ WHERE TLR.DELETED = 0
|
|
|
|
+ AND TLR.RESULT_TYPE = 4
|
|
|
|
+ )
|
|
|
|
+ <where>
|
|
|
|
+ <if test="resultBillableTonnage != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultBillableTonnage" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "resultBillableTonnage" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dayplanNo != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "dayplanNo" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="resultClass != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultClass" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "resultClass" 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="resultLoadingDate != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultLoadingDate" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "resultLoadingDate" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="resultWagonNo != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultWagonNo" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "resultWagonNo" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dayplanSendStationName != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="dayplanSendStationName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "dayplanSendStationName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dayplanToTheStationName != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="dayplanToTheStationName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "dayplanToTheStationName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dayplanConsigneeName != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="dayplanConsigneeName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "dayplanConsigneeName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dayplanConsigneeTel != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="dayplanConsigneeTel" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "dayplanConsigneeTel" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="shipperName != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "shipperName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="consigneeCompanyName != null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
|
|
|
|
+ "consigneeCompanyName" like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ <include refid="orderBy"></include>
|
|
|
|
+ <if test="orderField == null ">
|
|
|
|
+ order by "loadDate" desc
|
|
|
|
+ </if>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectLoadByResultId" parameterType="java.math.BigDecimal" resultType="java.util.LinkedHashMap">
|
|
<select id="selectLoadByResultId" parameterType="java.math.BigDecimal" resultType="java.util.LinkedHashMap">
|