|
|
@@ -107,23 +107,23 @@
|
|
|
</select>
|
|
|
<select id="listPort" resultType="org.springblade.los.box.dto.BoxPoolPortDTO">
|
|
|
SELECT
|
|
|
- lp.id AS portId,
|
|
|
- lp.cn_name AS portName,
|
|
|
- item.pol_cy_cname AS stationName,
|
|
|
- item.pol_cy_id AS stationId,
|
|
|
- lpb.box_class AS busType,
|
|
|
- sum( lpb.remaining_num ) AS remainingTotal
|
|
|
+ lp.id as portId,
|
|
|
+ lp.cn_name as portName,
|
|
|
+ corp.cn_name as stationName,
|
|
|
+ lpb.pol_station_id as stationId,
|
|
|
+ lpb.box_class as busType,
|
|
|
+ sum(lpb.remaining_num) as remainingTotal
|
|
|
FROM
|
|
|
- logistics_put_box_items item
|
|
|
- LEFT JOIN logistics_put_box lpb on item.pid = lpb.id
|
|
|
+ logistics_put_box lpb
|
|
|
LEFT JOIN los_b_ports lp ON FIND_IN_SET( lp.id, lpb.pol_id )
|
|
|
+ LEFT JOIN los_b_corps corp on lpb.pol_station_id = corp.id
|
|
|
WHERE
|
|
|
lpb.tenant_id = #{data.tenantId}
|
|
|
AND lpb.is_deleted = '0'
|
|
|
AND lp.tenant_id = #{data.tenantId}
|
|
|
AND lp.is_deleted = '0'
|
|
|
- AND item.is_deleted = '0'
|
|
|
- AND item.tenant_id = #{data.tenantId}
|
|
|
+ AND corp.tenant_id = #{data.tenantId}
|
|
|
+ AND corp.is_deleted = '0'
|
|
|
AND lpb.remaining_num > 0
|
|
|
AND lpb.whether_deactivate = '0'
|
|
|
<if test='data.containerNumber != null and data.containerNumber != ""'>
|
|
|
@@ -133,7 +133,7 @@
|
|
|
and lpb.pol_id like concat(concat('%', #{data.polId}),'%')
|
|
|
</if>
|
|
|
<if test="data.stationId!=null and data.stationId != ''">
|
|
|
- and item.pol_cy_id = #{data.stationId}
|
|
|
+ and lpb.pol_station_id = #{data.stationId}
|
|
|
</if>
|
|
|
<if test="data.podId!=null and data.podId != ''">
|
|
|
and lpb.pod_id like concat(concat('%', #{data.podId}),'%')
|
|
|
@@ -161,7 +161,7 @@
|
|
|
and DATE_FORMAT(lpb.effective_end_date,'%Y-%m-%d') <= DATE_FORMAT(CURDATE(), '%Y-%m-%d')
|
|
|
</if>
|
|
|
GROUP BY
|
|
|
- lp.id,lpb.box_class,item.pol_cy_id
|
|
|
+ lp.id,lpb.box_class,lpb.pol_station_id
|
|
|
</select>
|
|
|
<select id="selectBoxNumber" resultType="java.util.Map">
|
|
|
SELECT
|
|
|
@@ -177,9 +177,6 @@
|
|
|
AND box_status = '好箱'
|
|
|
AND status = '待使用'
|
|
|
AND box_type = '20GP'
|
|
|
- <if test="stationId !=null and stationId != ''">
|
|
|
- and pol_cy_id = #{stationId}
|
|
|
- </if>
|
|
|
) AS gP20Good,
|
|
|
(
|
|
|
SELECT
|
|
|
@@ -193,9 +190,6 @@
|
|
|
AND box_status = '好箱'
|
|
|
AND status = '待使用'
|
|
|
AND box_type = '40GP'
|
|
|
- <if test="stationId !=null and stationId != ''">
|
|
|
- and pol_cy_id = #{stationId}
|
|
|
- </if>
|
|
|
) AS gP40Good,
|
|
|
(
|
|
|
SELECT
|
|
|
@@ -209,9 +203,6 @@
|
|
|
AND box_status = '好箱'
|
|
|
AND status = '待使用'
|
|
|
AND box_type = '40HC'
|
|
|
- <if test="stationId !=null and stationId != ''">
|
|
|
- and pol_cy_id = #{stationId}
|
|
|
- </if>
|
|
|
) AS hG40Good,
|
|
|
(
|
|
|
SELECT
|
|
|
@@ -225,9 +216,6 @@
|
|
|
AND box_status = '好箱'
|
|
|
AND status = '待使用'
|
|
|
AND NOT FIND_IN_SET( box_type, '40HC,40GP,20GP' )
|
|
|
- <if test="stationId !=null and stationId != ''">
|
|
|
- and pol_cy_id = #{stationId}
|
|
|
- </if>
|
|
|
) AS otherGood,
|
|
|
(
|
|
|
SELECT
|
|
|
@@ -241,9 +229,6 @@
|
|
|
AND box_status = '坏箱'
|
|
|
AND status = '待使用'
|
|
|
AND box_type = '20GP'
|
|
|
- <if test="stationId !=null and stationId != ''">
|
|
|
- and pol_cy_id = #{stationId}
|
|
|
- </if>
|
|
|
) AS gP20Bad,
|
|
|
(
|
|
|
SELECT
|
|
|
@@ -257,9 +242,6 @@
|
|
|
AND box_status = '坏箱'
|
|
|
AND status = '待使用'
|
|
|
AND box_type = '40GP'
|
|
|
- <if test="stationId !=null and stationId != ''">
|
|
|
- and pol_cy_id = #{stationId}
|
|
|
- </if>
|
|
|
) AS gP40Bad,
|
|
|
(
|
|
|
SELECT
|
|
|
@@ -273,9 +255,6 @@
|
|
|
AND box_status = '坏箱'
|
|
|
AND status = '待使用'
|
|
|
AND box_type = '40HC'
|
|
|
- <if test="stationId !=null and stationId != ''">
|
|
|
- and pol_cy_id = #{stationId}
|
|
|
- </if>
|
|
|
) AS hG40Bad,
|
|
|
(
|
|
|
SELECT
|
|
|
@@ -289,19 +268,19 @@
|
|
|
AND box_status = '坏箱'
|
|
|
AND status = '待使用'
|
|
|
AND NOT FIND_IN_SET( box_type, '40HC,40GP,20GP' )
|
|
|
- <if test="stationId !=null and stationId != ''">
|
|
|
- and pol_cy_id = #{stationId}
|
|
|
- </if>
|
|
|
) AS otherBad
|
|
|
FROM
|
|
|
- logistics_put_box lpb
|
|
|
+ logistics_put_box lpb
|
|
|
WHERE
|
|
|
- lpb.tenant_id = #{tenantId}
|
|
|
- AND lpb.is_deleted = '0'
|
|
|
+ lpb.tenant_id = #{tenantId}
|
|
|
+ AND lpb.is_deleted = '0'
|
|
|
AND lpb.whether_deactivate = '0'
|
|
|
<if test="portId !=null and portId != ''">
|
|
|
and lpb.pol_id like concat(concat('%', #{portId}),'%')
|
|
|
</if>
|
|
|
+ <if test="stationId !=null and stationId != ''">
|
|
|
+ and lpb.pol_station_id = #{stationId}
|
|
|
+ </if>
|
|
|
<if test="busType != null and busType != ''">
|
|
|
and lpb.box_class like concat(concat('%', #{busType}),'%')
|
|
|
</if>
|
|
|
@@ -312,21 +291,21 @@
|
|
|
</select>
|
|
|
<select id="getBoxNumber" resultType="org.springblade.los.excel.RouteCostProfitExcel">
|
|
|
SELECT
|
|
|
- lpb.pol_id as polId,
|
|
|
- lpb.pol_cname as podCname,
|
|
|
- lpb.pod_id as podId,
|
|
|
- lpb.pod_cname as destinationCname,
|
|
|
- lpb.box_type as boxType,
|
|
|
- lpb.bus_type as busType,
|
|
|
- lpb.remaining_num as remainingNum,
|
|
|
- count(lpbi.id) as sum
|
|
|
+ lpb.pol_id as polId,
|
|
|
+ lpb.pol_cname as podCname,
|
|
|
+ lpb.pod_id as podId,
|
|
|
+ lpb.pod_cname as destinationCname,
|
|
|
+ lpb.box_type as boxType,
|
|
|
+ lpb.bus_type as busType,
|
|
|
+ lpb.remaining_num as remainingNum,
|
|
|
+ count(lpbi.id) as sum
|
|
|
FROM
|
|
|
- logistics_put_box lpb
|
|
|
- LEFT JOIN logistics_put_box_items lpbi ON lpb.id = lpbi.pid AND lpbi.is_deleted = '0'
|
|
|
+ logistics_put_box lpb
|
|
|
+ LEFT JOIN logistics_put_box_items lpbi ON lpb.id = lpbi.pid AND lpbi.is_deleted = '0'
|
|
|
AND lpbi.tenant_id = '128478'
|
|
|
WHERE
|
|
|
- lpb.is_deleted = '0'
|
|
|
- AND lpb.tenant_id = #{data.tenantId}
|
|
|
+ lpb.is_deleted = '0'
|
|
|
+ AND lpb.tenant_id = #{data.tenantId}
|
|
|
<if test="data.podCname !=null and data.podCname != ''">
|
|
|
and lpb.pol_cname like concat(concat('%', #{data.podCname}),'%')
|
|
|
</if>
|
|
|
@@ -337,23 +316,23 @@
|
|
|
</select>
|
|
|
<select id="listPortExport" resultType="org.springblade.los.box.dto.BoxPoolPortDTO">
|
|
|
SELECT
|
|
|
- lp.id AS portId,
|
|
|
- lp.cn_name AS portName,
|
|
|
- item.pol_cy_cname AS stationName,
|
|
|
- item.pol_cy_id AS stationId,
|
|
|
- lpb.box_class AS busType,
|
|
|
- sum( lpb.remaining_num ) AS remainingTotal
|
|
|
+ lp.id as portId,
|
|
|
+ lp.cn_name as portName,
|
|
|
+ corp.cn_name as stationName,
|
|
|
+ lpb.pol_station_id as stationId,
|
|
|
+ lpb.box_class as busType,
|
|
|
+ sum(lpb.remaining_num) as remainingTotal
|
|
|
FROM
|
|
|
- logistics_put_box_items item
|
|
|
- LEFT JOIN logistics_put_box lpb on item.pid = lpb.id
|
|
|
+ logistics_put_box lpb
|
|
|
LEFT JOIN los_b_ports lp ON FIND_IN_SET( lp.id, lpb.pol_id )
|
|
|
+ LEFT JOIN los_b_corps corp on lpb.pol_station_id = corp.id
|
|
|
WHERE
|
|
|
lpb.tenant_id = #{data.tenantId}
|
|
|
AND lpb.is_deleted = '0'
|
|
|
AND lp.tenant_id = #{data.tenantId}
|
|
|
AND lp.is_deleted = '0'
|
|
|
- AND item.is_deleted = '0'
|
|
|
- AND item.tenant_id = #{data.tenantId}
|
|
|
+ AND corp.tenant_id = #{data.tenantId}
|
|
|
+ AND corp.is_deleted = '0'
|
|
|
AND lpb.remaining_num > 0
|
|
|
AND lpb.whether_deactivate = '0'
|
|
|
<if test='data.containerNumber != null and data.containerNumber != ""'>
|
|
|
@@ -363,7 +342,7 @@
|
|
|
and lpb.pol_id like concat(concat('%', #{data.polId}),'%')
|
|
|
</if>
|
|
|
<if test="data.stationId!=null and data.stationId != ''">
|
|
|
- and item.pol_cy_id = #{data.stationId}
|
|
|
+ and lpb.pol_station_id = #{data.stationId}
|
|
|
</if>
|
|
|
<if test="data.podId!=null and data.podId != ''">
|
|
|
and lpb.pod_id like concat(concat('%', #{data.podId}),'%')
|
|
|
@@ -391,7 +370,7 @@
|
|
|
and DATE_FORMAT(lpb.effective_end_date,'%Y-%m-%d') <= DATE_FORMAT(CURDATE(), '%Y-%m-%d')
|
|
|
</if>
|
|
|
GROUP BY
|
|
|
- lp.id,lpb.box_class,item.pol_cy_id
|
|
|
+ lp.id,lpb.box_class,lpb.pol_station_id
|
|
|
</select>
|
|
|
<select id="listContainerNumberExport" resultType="org.springblade.los.box.dto.BoxPoolContainerNumberDTO">
|
|
|
SELECT
|