|
@@ -1959,8 +1959,8 @@
|
|
|
ON R_SALER.SALER_ID = a_s_order.SALER_ID
|
|
|
where a_s_order.SALE_ORDER_STATUS in (2,4)
|
|
|
and a_s_order.CLOSE_STATUS is null
|
|
|
- and a_s_order.DELETED = 0
|
|
|
and ASM.DELETED IS NULL
|
|
|
+ and ASM.SALE_MATERIAL_ID IS NOT NULL
|
|
|
<if test="con != null">
|
|
|
and (instr(r_consignee.CONSIGNEE_COMPANY_NAME, #{con}) > 0 or instr(a_s_order.SALE_NUMBER, #{con}) > 0)
|
|
|
</if>
|
|
@@ -2515,6 +2515,7 @@
|
|
|
AND OO.ORDER_ID IS NULL
|
|
|
AND ADSO.DISPATCH_ID IS NOT NULL
|
|
|
AND ASM.DELETED IS NULL
|
|
|
+ AND ASM.SALE_MATERIAL_ID IS NOT NULL
|
|
|
ORDER BY ASOM.SALE_ORDER_MATERIAL_TRUCK_NO ASC
|
|
|
</select>
|
|
|
|
|
@@ -2602,6 +2603,7 @@
|
|
|
and ADSO.DISPATCH_TYPE = 2
|
|
|
and OO.ORDER_ID IS NULL
|
|
|
AND ASM.DELETED IS NULL
|
|
|
+ AND ASM.SALE_MATERIAL_ID IS NOT NULL
|
|
|
<if test="oneDate != null">
|
|
|
and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = a_s_order.INSERT_TIME
|
|
|
</if>
|
|
@@ -2909,6 +2911,7 @@
|
|
|
AND ADSO.CARRIER_ID IS NULL
|
|
|
AND ASO.DELETED = 0
|
|
|
AND ASM.DELETED IS NULL
|
|
|
+ AND ASM.SALE_MATERIAL_ID IS NOT NULL
|
|
|
<if test="oneDate != null">
|
|
|
and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = ASO.INSERT_TIME
|
|
|
</if>
|
|
@@ -3068,6 +3071,7 @@
|
|
|
AND OO.ORDER_ID IS NULL
|
|
|
AND ASO.DELETED = 0
|
|
|
AND ASM.DELETED IS NULL
|
|
|
+ AND ASM.SALE_MATERIAL_ID IS NOT NULL
|
|
|
<if test="oneDate != null">
|
|
|
and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = ASO.INSERT_TIME
|
|
|
</if>
|
|
@@ -3202,6 +3206,7 @@
|
|
|
LEFT JOIN AMS_DISPATCH_SALE_ORDER ADSO
|
|
|
ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
WHERE ASOM.SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
|
|
|
+ and ASM.SALE_MATERIAL_ID IS NOT NULL
|
|
|
ORDER BY ASOM.SALE_ORDER_MATERIAL_TRUCK_NO ASC
|
|
|
</select>
|
|
|
|
|
@@ -3443,7 +3448,8 @@
|
|
|
ON RRP.PLACE_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
|
|
|
LEFT JOIN RMS_RECEIVE_ADDRESS RRA
|
|
|
ON RRA.ADDRESS_ID = RRP.ADDRESS_ID
|
|
|
- WHERE ASO.SALE_ORDER_ID = #{saleOrderId}
|
|
|
+ WHERE asm.SALE_MATERIAL_ID is not null
|
|
|
+ and ASO.SALE_ORDER_ID = #{saleOrderId}
|
|
|
</select>
|
|
|
|
|
|
<select id="matchingAddressRecently" parameterType="DECIMAL" resultType="java.util.LinkedHashMap" >
|
|
@@ -4207,7 +4213,8 @@
|
|
|
<!-- 修改厂内未装货车辆的运单车牌号 -->
|
|
|
<update id="updateCapacityNumberInFactory" parameterType="java.util.Map" >
|
|
|
UPDATE OMSTRUCK_ORDER OO
|
|
|
- SET OO.CAPACITY_ID = #{capacityId}
|
|
|
+ SET OO.CAPACITY_ID = #{capacityId},
|
|
|
+ OO.insert_update_remark = '修改车牌号'
|
|
|
WHERE OO.ORDER_ID = #{orderId}
|
|
|
</update>
|
|
|
<update id="bindSaleArea">
|
|
@@ -4567,4 +4574,31 @@
|
|
|
where RC.CAPACITY_NUMBER=#{capacityNumber} and OO.order_status=5
|
|
|
fetch next 1 rows only
|
|
|
</select>
|
|
|
+ <select id="getOrderMes" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
+ SELECT TTR.RESULT_TOTAL_ID "resultTotalId",
|
|
|
+ OO.ORDER_STATUS "orderStatus"
|
|
|
+ FROM OMSTRUCK_ORDER OO
|
|
|
+ LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ ON TTR.ORDER_ID = OO.ORDER_ID
|
|
|
+ WHERE OO.ORDER_ID = #{orderId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getId" resultType="java.math.BigDecimal">
|
|
|
+ select ASOM.SALE_ORDER_MATERIAL_ID "saleodermatetialid"
|
|
|
+ from AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ LEFT JOIN AMS_SALE_ORDER ASO
|
|
|
+ ON ASO.SALE_ORDER_ID= ASOM.SALE_ORDER_ID
|
|
|
+ LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
|
|
|
+ ON ASTM.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN AMS_SALE_MATERIAL ASM
|
|
|
+ ON ASM.SALE_MATERIAL_ID = ASTM.MATERIAL_ID
|
|
|
+ where ASO.sale_number=#{saleOrderNo}
|
|
|
+ and ASM.SALE_MATERIAL_ID =#{saleMaterialId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="updateForTel">
|
|
|
+ update AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ set ASOM.SALE_ORDER_CONSIGNEE_TEL=#{consigneeTel}
|
|
|
+ WHERE ASOM.SALE_ORDER_MATERIAL_ID=#{saleodermatetialid}
|
|
|
+ </update>
|
|
|
</mapper>
|