|
@@ -6,7 +6,7 @@
|
|
|
<result column="PLAN_ID" jdbcType="DECIMAL" property="planId" />
|
|
|
<result column="SALE_NUMBER" jdbcType="VARCHAR" property="saleNumber" />
|
|
|
<result column="SHIPPER_ID" jdbcType="DECIMAL" property="shipperId" />
|
|
|
- <result column="CONSIGNEE_ID" jdbcType="DECIMAL" property="consigneeId" />
|
|
|
+ <result column="RECEIVE_ID" jdbcType="DECIMAL" property="receiveId" />
|
|
|
<result column="SALE_ACCOUNT_BALANCE" jdbcType="DECIMAL" property="saleAccountBalance" />
|
|
|
<result column="SALE_CURRENT_ORDER_AMOUNT" jdbcType="DECIMAL" property="saleCurrentOrderAmount" />
|
|
|
<result column="SALE_HISTORICAL_ORDER_AMOUNT" jdbcType="DECIMAL" property="saleHistoricalOrderAmount" />
|
|
@@ -24,13 +24,13 @@
|
|
|
<result column="DELETED" jdbcType="DECIMAL" property="deleted" />
|
|
|
</resultMap>
|
|
|
<sql id="columns">
|
|
|
- SALE_ORDER_ID, PLAN_ID, SALE_NUMBER, SHIPPER_ID, CONSIGNEE_ID, SALE_ACCOUNT_BALANCE,
|
|
|
+ SALE_ORDER_ID, PLAN_ID, SALE_NUMBER, SHIPPER_ID, RECEIVE_ID, SALE_ACCOUNT_BALANCE,
|
|
|
SALE_CURRENT_ORDER_AMOUNT, SALE_HISTORICAL_ORDER_AMOUNT, SALE_ORDER_STATUS, SALE_ORDER_RECEIVE_CUSTOMER,
|
|
|
SALE_ORDER_ISSELF_MENTION, SALE_UNIT_PRICE, SALE_ORDER_TAX, SALE_REMARK, INSERT_USERNAME,
|
|
|
INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED
|
|
|
</sql>
|
|
|
<sql id="columns_alias">
|
|
|
- t.SALE_ORDER_ID, t.PLAN_ID, t.SALE_NUMBER, t.SHIPPER_ID, t.CONSIGNEE_ID, t.SALE_ACCOUNT_BALANCE,
|
|
|
+ t.SALE_ORDER_ID, t.PLAN_ID, t.SALE_NUMBER, t.SHIPPER_ID, t.RECEIVE_ID, t.SALE_ACCOUNT_BALANCE,
|
|
|
t.SALE_CURRENT_ORDER_AMOUNT, t.SALE_HISTORICAL_ORDER_AMOUNT, t.SALE_ORDER_STATUS,
|
|
|
t.SALE_ORDER_RECEIVE_CUSTOMER, t.SALE_ORDER_ISSELF_MENTION, t.SALE_UNIT_PRICE, t.SALE_ORDER_TAX,
|
|
|
t.SALE_REMARK, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
|
|
@@ -56,8 +56,8 @@
|
|
|
<if test="shipperId != null">
|
|
|
and SHIPPER_ID = #{shipperId}
|
|
|
</if>
|
|
|
- <if test="consigneeId != null">
|
|
|
- and CONSIGNEE_ID = #{consigneeId}
|
|
|
+ <if test="receiveId != null">
|
|
|
+ and RECEIVE_ID = #{receiveId}
|
|
|
</if>
|
|
|
<if test="saleAccountBalance != null">
|
|
|
and SALE_ACCOUNT_BALANCE = #{saleAccountBalance}
|
|
@@ -120,8 +120,8 @@
|
|
|
<if test="shipperId != null">
|
|
|
and SHIPPER_ID = #{shipperId}
|
|
|
</if>
|
|
|
- <if test="consigneeId != null">
|
|
|
- and CONSIGNEE_ID = #{consigneeId}
|
|
|
+ <if test="receiveId != null">
|
|
|
+ and RECEIVE_ID = #{receiveId}
|
|
|
</if>
|
|
|
<if test="saleAccountBalance != null">
|
|
|
and SALE_ACCOUNT_BALANCE = #{saleAccountBalance}
|
|
@@ -186,8 +186,8 @@
|
|
|
<if test="shipperId != null">
|
|
|
or SHIPPER_ID = #{shipperId}
|
|
|
</if>
|
|
|
- <if test="consigneeId != null">
|
|
|
- or CONSIGNEE_ID = #{consigneeId}
|
|
|
+ <if test="receiveId != null">
|
|
|
+ or RECEIVE_ID = #{receiveId}
|
|
|
</if>
|
|
|
<if test="saleAccountBalance != null">
|
|
|
or SALE_ACCOUNT_BALANCE = #{saleAccountBalance}
|
|
@@ -237,7 +237,7 @@
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.steerinfo.dil.model.AmsSaleOrder">
|
|
|
insert into AMS_SALE_ORDER (SALE_ORDER_ID, PLAN_ID, SALE_NUMBER,
|
|
|
- SHIPPER_ID, CONSIGNEE_ID, SALE_ACCOUNT_BALANCE,
|
|
|
+ SHIPPER_ID, RECEIVE_ID, SALE_ACCOUNT_BALANCE,
|
|
|
SALE_CURRENT_ORDER_AMOUNT, SALE_HISTORICAL_ORDER_AMOUNT,
|
|
|
SALE_ORDER_STATUS, SALE_ORDER_RECEIVE_CUSTOMER,
|
|
|
SALE_ORDER_ISSELF_MENTION, SALE_UNIT_PRICE,
|
|
@@ -245,7 +245,7 @@
|
|
|
INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
|
|
|
INSERT_UPDATE_REMARK, DELETED)
|
|
|
values (#{saleOrderId,jdbcType=DECIMAL}, #{planId,jdbcType=DECIMAL}, #{saleNumber,jdbcType=VARCHAR},
|
|
|
- #{shipperId,jdbcType=DECIMAL}, #{consigneeId,jdbcType=DECIMAL}, #{saleAccountBalance,jdbcType=DECIMAL},
|
|
|
+ #{shipperId,jdbcType=DECIMAL}, #{receiveId,jdbcType=DECIMAL}, #{saleAccountBalance,jdbcType=DECIMAL},
|
|
|
#{saleCurrentOrderAmount,jdbcType=DECIMAL}, #{saleHistoricalOrderAmount,jdbcType=DECIMAL},
|
|
|
#{saleOrderStatus,jdbcType=DECIMAL}, #{saleOrderReceiveCustomer,jdbcType=VARCHAR},
|
|
|
#{saleOrderIsselfMention,jdbcType=VARCHAR}, #{saleUnitPrice,jdbcType=DECIMAL},
|
|
@@ -268,8 +268,8 @@
|
|
|
<if test="shipperId != null">
|
|
|
SHIPPER_ID,
|
|
|
</if>
|
|
|
- <if test="consigneeId != null">
|
|
|
- CONSIGNEE_ID,
|
|
|
+ <if test="receiveId != null">
|
|
|
+ RECEIVE_ID,
|
|
|
</if>
|
|
|
<if test="saleAccountBalance != null">
|
|
|
SALE_ACCOUNT_BALANCE,
|
|
@@ -330,8 +330,8 @@
|
|
|
<if test="shipperId != null">
|
|
|
#{shipperId,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
- <if test="consigneeId != null">
|
|
|
- #{consigneeId,jdbcType=DECIMAL},
|
|
|
+ <if test="receiveId != null">
|
|
|
+ #{receiveId,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
<if test="saleAccountBalance != null">
|
|
|
#{saleAccountBalance,jdbcType=DECIMAL},
|
|
@@ -385,7 +385,7 @@
|
|
|
set PLAN_ID = #{planId,jdbcType=DECIMAL},
|
|
|
SALE_NUMBER = #{saleNumber,jdbcType=VARCHAR},
|
|
|
SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
|
|
|
- CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL},
|
|
|
+ RECEIVE_ID = #{receiveId,jdbcType=DECIMAL},
|
|
|
SALE_ACCOUNT_BALANCE = #{saleAccountBalance,jdbcType=DECIMAL},
|
|
|
SALE_CURRENT_ORDER_AMOUNT = #{saleCurrentOrderAmount,jdbcType=DECIMAL},
|
|
|
SALE_HISTORICAL_ORDER_AMOUNT = #{saleHistoricalOrderAmount,jdbcType=DECIMAL},
|
|
@@ -415,8 +415,8 @@
|
|
|
<if test="shipperId != null">
|
|
|
SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
- <if test="consigneeId != null">
|
|
|
- CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL},
|
|
|
+ <if test="receiveId != null">
|
|
|
+ RECEIVE_ID = #{receiveId,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
<if test="saleAccountBalance != null">
|
|
|
SALE_ACCOUNT_BALANCE = #{saleAccountBalance,jdbcType=DECIMAL},
|
|
@@ -482,7 +482,7 @@
|
|
|
insert into AMS_SALE_ORDER
|
|
|
(SALE_ORDER_ID,
|
|
|
PLAN_ID, SALE_NUMBER, SHIPPER_ID,
|
|
|
- CONSIGNEE_ID, SALE_ACCOUNT_BALANCE,
|
|
|
+ RECEIVE_ID, SALE_ACCOUNT_BALANCE,
|
|
|
SALE_CURRENT_ORDER_AMOUNT, SALE_HISTORICAL_ORDER_AMOUNT,
|
|
|
SALE_ORDER_STATUS, SALE_ORDER_RECEIVE_CUSTOMER,
|
|
|
SALE_ORDER_ISSELF_MENTION, SALE_UNIT_PRICE,
|
|
@@ -494,7 +494,7 @@
|
|
|
select
|
|
|
#{item.saleOrderId,jdbcType=DECIMAL},
|
|
|
#{item.planId,jdbcType=DECIMAL}, #{item.saleNumber,jdbcType=VARCHAR}, #{item.shipperId,jdbcType=DECIMAL},
|
|
|
- #{item.consigneeId,jdbcType=DECIMAL}, #{item.saleAccountBalance,jdbcType=DECIMAL},
|
|
|
+ #{item.receiveId,jdbcType=DECIMAL}, #{item.saleAccountBalance,jdbcType=DECIMAL},
|
|
|
#{item.saleCurrentOrderAmount,jdbcType=DECIMAL}, #{item.saleHistoricalOrderAmount,jdbcType=DECIMAL},
|
|
|
#{item.saleOrderStatus,jdbcType=DECIMAL}, #{item.saleOrderReceiveCustomer,jdbcType=VARCHAR},
|
|
|
#{item.saleOrderIsselfMention,jdbcType=VARCHAR}, #{item.saleUnitPrice,jdbcType=DECIMAL},
|
|
@@ -523,9 +523,9 @@
|
|
|
<foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
|
|
|
when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.shipperId,jdbcType=DECIMAL}
|
|
|
</foreach>
|
|
|
- ,CONSIGNEE_ID=
|
|
|
+ ,RECEIVE_ID=
|
|
|
<foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
|
|
|
- when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.consigneeId,jdbcType=DECIMAL}
|
|
|
+ when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.receiveId,jdbcType=DECIMAL}
|
|
|
</foreach>
|
|
|
,SALE_ACCOUNT_BALANCE=
|
|
|
<foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
|
|
@@ -601,7 +601,6 @@
|
|
|
</delete>
|
|
|
<!-- 友情提示!!!-->
|
|
|
<!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
-
|
|
|
<select id="getSaleOrderInfo" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
|
|
|
select * from(
|
|
|
select a_s_order.SALE_ORDER_ID "saleOrderId",
|
|
@@ -637,7 +636,7 @@
|
|
|
left join RMS_SHIPPER r_shipper
|
|
|
on a_s_order.SHIPPER_ID=r_shipper.SHIPPER_ID
|
|
|
left join RMS_CONSIGNEE r_consignee
|
|
|
- on a_s_order.CONSIGNEE_ID=r_consignee.CONSIGNEE_ID
|
|
|
+ on a_s_order.RECEIVE_ID=r_consignee.CONSIGNEE_ID
|
|
|
where a_s_order.SALE_ORDER_STATUS=0 and a_s_order.DELETED=0)
|
|
|
<where>
|
|
|
<if test="saleNumber != null">
|
|
@@ -757,7 +756,7 @@
|
|
|
left join RMS_SHIPPER r_shipper
|
|
|
on a_s_order.SHIPPER_ID=r_shipper.SHIPPER_ID
|
|
|
left join RMS_CONSIGNEE r_consignee
|
|
|
- on a_s_order.CONSIGNEE_ID=r_consignee.CONSIGNEE_ID
|
|
|
+ on a_s_order.RECEIVE_ID=r_consignee.CONSIGNEE_ID
|
|
|
where a_s_order.SALE_ORDER_STATUS=1)
|
|
|
<where>
|
|
|
<if test="saleNumber != null">
|
|
@@ -1000,7 +999,7 @@
|
|
|
select
|
|
|
a_s_order.PLAN_ID "planId",
|
|
|
a_s_order.SHIPPER_ID "shipperId",
|
|
|
- a_s_order.CONSIGNEE_ID "consigneeId",
|
|
|
+ a_s_order.RECEIVE_ID "consigneeId",
|
|
|
a_s_order.SALE_ORDER_RECEIVE_CUSTOMER "saleOrderReceiveCustomer",
|
|
|
a_s_order.SALE_ORDER_ISSELF_MENTION "saleOrderIsselfMention",
|
|
|
a_s_order.SALE_REMARK "saleRemark"
|
|
@@ -1011,7 +1010,7 @@
|
|
|
<update id="deleteBySaleOrderId" parameterType="java.math.BigDecimal">
|
|
|
update AMS_SALE_ORDER_MATERIAL set DELETED = 1 where SALE_ORDER_ID = #{saleOrderId}
|
|
|
</update>
|
|
|
-
|
|
|
+
|
|
|
<select id="getAmsSaleOrderApproved" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
|
|
|
select * from(
|
|
|
select a_s_order.SALE_ORDER_ID "saleOrderId",
|
|
@@ -1049,7 +1048,7 @@
|
|
|
left join RMS_SHIPPER r_shipper
|
|
|
on a_s_order.SHIPPER_ID=r_shipper.SHIPPER_ID
|
|
|
left join RMS_CONSIGNEE r_consignee
|
|
|
- on a_s_order.CONSIGNEE_ID=r_consignee.CONSIGNEE_ID
|
|
|
+ on a_s_order.RECEIVE_ID=r_consignee.CONSIGNEE_ID
|
|
|
where a_s_order.SALE_ORDER_STATUS=4)
|
|
|
<where>
|
|
|
<if test="saleNumber != null">
|
|
@@ -1147,19 +1146,22 @@
|
|
|
</select>
|
|
|
<!-- 展示所有销售公司已审核的销售订单 -->
|
|
|
<select id="getSaleOrderList" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
- select
|
|
|
- asom.SALE_ORDER_MATERIAL_ID "orderMaterialId",
|
|
|
- asom.sale_order_id as "saleOrderId",
|
|
|
- asom.sale_order_material_truck_no as "saleOrderMaterialTruckNo",
|
|
|
- asom.sale_order_material_id,
|
|
|
- rra.address_delivery_address as "addressDeliveryAddress",
|
|
|
- asom.sale_date_of_receipt as "saleDateOfReceipt",
|
|
|
- asom.sale_order_consignee as "saleOrderConsignee",
|
|
|
- asom.sale_order_consignee_tel as "saleOrderConsigneeTel"
|
|
|
+ select asom.SALE_ORDER_MATERIAL_ID "orderMaterialId",
|
|
|
+ asom.sale_order_id as "saleOrderId",
|
|
|
+ asom.sale_order_material_truck_no as "saleOrderMaterialTruckNo",
|
|
|
+ asom.sale_order_material_id,
|
|
|
+ rra.address_delivery_address as "addressDeliveryAddress",
|
|
|
+ asom.sale_date_of_receipt as "saleDateOfReceipt",
|
|
|
+ asom.sale_order_consignee as "saleOrderConsignee",
|
|
|
+ asom.sale_order_consignee_tel as "saleOrderConsigneeTel"
|
|
|
from ams_sale_order aso
|
|
|
- join ams_sale_order_material asom on aso.sale_order_id =asom.sale_order_id
|
|
|
- left join rms_receive_address rra on asom.sale_shipping_address_id=rra.address_id
|
|
|
- where asom.sale_order_material_id not in (select adso.sale_order_material_id from ams_dispatch_sale_order adso group by adso.sale_order_material_id) and aso.sale_order_status=2 or aso.sale_order_status=4
|
|
|
+ join ams_sale_order_material asom on aso.sale_order_id = asom.sale_order_id
|
|
|
+ left join rms_receive_address rra on asom.sale_shipping_address_id = rra.address_id
|
|
|
+ where asom.sale_order_material_id not in (select adso.sale_order_material_id
|
|
|
+ from ams_dispatch_sale_order adso
|
|
|
+ group by adso.sale_order_material_id)
|
|
|
+ and aso.sale_order_status = 2
|
|
|
+ or aso.sale_order_status = 4
|
|
|
</select>
|
|
|
|
|
|
<!-- 通过收货地址,匹配对应的承运商-->
|