|
|
@@ -29,31 +29,25 @@
|
|
|
</select>
|
|
|
<select id="exportTradingBoxItemOut" resultType="org.springblade.box.tube.dto.ExportTradingBoxItemOut">
|
|
|
SELECT
|
|
|
- c.contract_no AS contractNo,
|
|
|
- i.`code` AS CODE,
|
|
|
- i.new_date AS newDate,
|
|
|
- i.amount AS amount,
|
|
|
- i.address AS address,
|
|
|
- i.`status` AS STATUS,
|
|
|
- ( CASE c.bill_type WHEN 'CKZY' THEN '出口装运' WHEN 'JKFC' THEN '进口返程' END ) AS type
|
|
|
+ c.contract_no AS contractNo,
|
|
|
+ i.`code` AS CODE,
|
|
|
+ i.new_date AS newDate,
|
|
|
+ i.amount AS amount,
|
|
|
+ i.address AS address,
|
|
|
+ i.`status` AS STATUS,
|
|
|
+ ( CASE c.type WHEN 'ZR' THEN '租入' WHEN 'ZC' THEN '租出' WHEN 'BUY' THEN '买箱' WHEN 'SELL' THEN '卖箱' END ) AS type
|
|
|
FROM
|
|
|
- container_transport_item i
|
|
|
- LEFT JOIN container_transport c ON i.pid = c.id
|
|
|
+ container_trading_box_item i
|
|
|
+ LEFT JOIN container_trading_box c ON i.pid = c.id
|
|
|
WHERE
|
|
|
- i.tenant_id = #{item.tenantId}
|
|
|
- AND i.is_deleted = '0'
|
|
|
- AND c.is_deleted = '0'
|
|
|
- <if test='item.effectiveDateList != null and item.effectiveDateList[0] != null and item.effectiveDateList[0]!= ""'>
|
|
|
- and c.effective_date >= #{item.effectiveDateList[0]}
|
|
|
+ i.tenant_id = #{item.tenantId}
|
|
|
+ AND i.is_deleted = '0'
|
|
|
+ AND c.is_deleted = '0'
|
|
|
+ <if test='item.purchaseDateList != null and item.purchaseDateList[0] != null and item.purchaseDateList[0]!= ""'>
|
|
|
+ and c.purchase_date >= #{item.purchaseDateList[0]}
|
|
|
</if>
|
|
|
- <if test='item.effectiveDateList != null and item.effectiveDateList[1] != null and item.effectiveDateList[1]!= ""'>
|
|
|
- and c.effective_date <= #{item.effectiveDateList[1]}
|
|
|
- </if>
|
|
|
- <if test='item.startingRentDateList != null and item.startingRentDateList[0] != null and item.startingRentDateList[0]!= ""'>
|
|
|
- and c.starting_rent_date >= #{item.startingRentDateList[0]}
|
|
|
- </if>
|
|
|
- <if test='item.startingRentDateList != null and item.startingRentDateList[1] != null and item.startingRentDateList[1]!= ""'>
|
|
|
- and c.starting_rent_date <= #{item.startingRentDateList[1]}
|
|
|
+ <if test='item.purchaseDateList != null and item.purchaseDateList[1] != null and item.purchaseDateList[1]!= ""'>
|
|
|
+ and c.purchase_date <= #{item.purchaseDateList[1]}
|
|
|
</if>
|
|
|
<if test='item.createTimeList != null and item.createTimeList[0] != null and item.createTimeList[0]!= ""'>
|
|
|
and c.create_time >= #{item.createTimeList[0]}
|
|
|
@@ -73,20 +67,8 @@
|
|
|
<if test="item.contractNo != null and item.contractNo != ''">
|
|
|
AND c.contract_no like CONCAT(CONCAT('%', #{item.contractNo}), '%')
|
|
|
</if>
|
|
|
- <if test="item.code != null and item.code != ''">
|
|
|
- AND c.code like CONCAT(CONCAT('%', #{item.code}), '%')
|
|
|
- </if>
|
|
|
- <if test="item.corpId!=null">
|
|
|
- and c.corp_id = #{item.corpId}
|
|
|
- </if>
|
|
|
- <if test="item.departureHarborId!=null">
|
|
|
- and c.departure_harbor_id = #{item.departureHarborId}
|
|
|
- </if>
|
|
|
- <if test="item.objectiveHarborId!=null">
|
|
|
- and c.objective_harbor_id = #{item.objectiveHarborId}
|
|
|
- </if>
|
|
|
- <if test="item.shippingCompanyId!=null">
|
|
|
- and c.shipping_company_id = #{item.shippingCompanyId}
|
|
|
+ <if test="item.purchaseCompanyId!=null">
|
|
|
+ and c.purchase_company_id = #{item.purchaseCompanyId}
|
|
|
</if>
|
|
|
<if test="item.status!=null">
|
|
|
and c.status = #{item.status}
|
|
|
@@ -97,8 +79,8 @@
|
|
|
<if test="item.updateUser!=null and item.updateUser != ''">
|
|
|
and c.update_user = #{item.updateUser}
|
|
|
</if>
|
|
|
- <if test="item.billType!=null and item.billType != ''">
|
|
|
- and c.bill_type = #{item.billType}
|
|
|
+ <if test="item.type!=null and item.type != ''">
|
|
|
+ and c.type = #{item.type}
|
|
|
</if>
|
|
|
order by c.create_time desc
|
|
|
</select>
|