|
|
|
@ -223,7 +223,7 @@
|
|
|
|
|
<select id="findBillLadingTotal" resultType="com.logpm.report.vo.indexCount.IndexDeliveryDataVO"> |
|
|
|
|
SELECT |
|
|
|
|
3 AS type, |
|
|
|
|
count( 1 ) |
|
|
|
|
count( 1 ) AS totalNum |
|
|
|
|
FROM |
|
|
|
|
logpm_distrilbution_bill_lading |
|
|
|
|
<where> |
|
|
|
@ -246,7 +246,7 @@
|
|
|
|
|
AND is_deleted = 0 |
|
|
|
|
AND delivery_type = #{type} |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
AND warehouse IN |
|
|
|
|
AND warehouse_id IN |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
@ -268,7 +268,7 @@
|
|
|
|
|
AND ldrp.packet_bar_status != 2 |
|
|
|
|
AND ldr.delivery_type = #{type} |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
AND ldr.warehouse IN |
|
|
|
|
AND ldr.warehouse_id IN |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
@ -289,7 +289,7 @@
|
|
|
|
|
AND ldrp.packet_bar_status != 2 |
|
|
|
|
AND ldr.delivery_type = #{type} |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
AND ldr.warehouse IN |
|
|
|
|
AND ldr.warehouse_id IN |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
@ -311,7 +311,7 @@
|
|
|
|
|
AND ldl.is_deleted = 0 |
|
|
|
|
AND ldr.delivery_type = #{type} |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
AND ldr.warehouse IN |
|
|
|
|
AND ldr.warehouse_id IN |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
@ -329,7 +329,7 @@
|
|
|
|
|
AND ldbp.is_deleted = 0 |
|
|
|
|
AND ldbl.is_deleted = 0 |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
AND ldbl.warehouse IN |
|
|
|
|
AND ldbl.warehouse_id IN |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
@ -348,7 +348,7 @@
|
|
|
|
|
AND ldbp.is_deleted = 0 |
|
|
|
|
AND ldbl.is_deleted = 0 |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
AND ldbl.warehouse IN |
|
|
|
|
AND ldbl.warehouse_id IN |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
@ -367,7 +367,7 @@
|
|
|
|
|
AND ldbp.is_deleted = 0 |
|
|
|
|
AND ldbl.is_deleted = 0 |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
AND ldbl.warehouse IN |
|
|
|
|
AND ldbl.warehouse_id IN |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
@ -454,5 +454,214 @@
|
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
</select> |
|
|
|
|
<select id="findSignforDataByDay" resultType="java.lang.Integer"> |
|
|
|
|
SELECT |
|
|
|
|
(( |
|
|
|
|
SELECT |
|
|
|
|
IFNULL( SUM( received_quantity ), 0 ) |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_loadscan |
|
|
|
|
<where> |
|
|
|
|
signfor_state = 2 |
|
|
|
|
AND DATE_FORMAT( signing_time, "%y%m%d" ) = DATE_FORMAT( #{param.dayStr}, "%y%m%d" ) |
|
|
|
|
AND is_deleted = 0 |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
and warehouse_id in |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
) + ( |
|
|
|
|
SELECT |
|
|
|
|
IFNULL( SUM( quantity ), 0 ) |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_bill_lading_scan |
|
|
|
|
<where> |
|
|
|
|
material_type = 2 |
|
|
|
|
AND DATE_FORMAT( create_time, "%y%m%d" ) = DATE_FORMAT( #{param.dayStr}, "%y%m%d" ) |
|
|
|
|
AND is_deleted = 0 |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
and warehouse_id in |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
)) AS num |
|
|
|
|
|
|
|
|
|
</select> |
|
|
|
|
<select id="findSignforDataByMonth" resultType="java.lang.Integer"> |
|
|
|
|
SELECT |
|
|
|
|
(( |
|
|
|
|
SELECT |
|
|
|
|
IFNULL( SUM( received_quantity ), 0 ) |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_loadscan |
|
|
|
|
<where> |
|
|
|
|
signfor_state = 2 |
|
|
|
|
AND DATE_FORMAT( signing_time, "%y%m" ) = DATE_FORMAT( #{param.dayStr}, "%y%m" ) |
|
|
|
|
AND is_deleted = 0 |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
and warehouse_id in |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
) + ( |
|
|
|
|
SELECT |
|
|
|
|
IFNULL( SUM( quantity ), 0 ) |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_bill_lading_scan |
|
|
|
|
<where> |
|
|
|
|
material_type = 2 |
|
|
|
|
AND DATE_FORMAT( create_time, "%y%m" ) = DATE_FORMAT( #{param.dayStr}, "%y%m" ) |
|
|
|
|
AND is_deleted = 0 |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
and warehouse_id in |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
)) AS num |
|
|
|
|
</select> |
|
|
|
|
<select id="findUnSignforDataByDay" resultType="java.lang.Integer"> |
|
|
|
|
SELECT |
|
|
|
|
(( |
|
|
|
|
SELECT |
|
|
|
|
IFNULL( sum( quantity ), 0 ) |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_reservation_package AS ldrp |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldrp.parce_list_id = ldpl.id |
|
|
|
|
<where> |
|
|
|
|
ldpl.order_package_status != 70 |
|
|
|
|
AND ldrp.packet_bar_status != 2 |
|
|
|
|
AND ldrp.is_deleted = 0 |
|
|
|
|
AND DATE_FORMAT( ldrp.create_time, "%y%m%d" ) = DATE_FORMAT( #{param.dayStr}, "%y%m%d" ) |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
AND ldpl.warehouse_id IN |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
) + ( |
|
|
|
|
SELECT |
|
|
|
|
IFNULL( sum( quantity ), 0 ) |
|
|
|
|
FROM |
|
|
|
|
logpm_distrilbution_bill_package AS ldbp |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldbp.parce_list_id = ldpl.id |
|
|
|
|
<where> |
|
|
|
|
ldpl.order_package_status != 70 |
|
|
|
|
AND ldbp.packet_bar_status != 2 |
|
|
|
|
AND ldbp.is_deleted = 0 |
|
|
|
|
AND DATE_FORMAT( ldbp.create_time, "%y%m%d" ) = DATE_FORMAT( #{param.dayStr}, "%y%m%d" ) |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
AND ldpl.warehouse_id IN |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
)) |
|
|
|
|
</select> |
|
|
|
|
<select id="findUnSignforDataByMonth" resultType="java.lang.Integer"> |
|
|
|
|
SELECT |
|
|
|
|
(( |
|
|
|
|
SELECT |
|
|
|
|
IFNULL( sum( quantity ), 0 ) |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_reservation_package AS ldrp |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldrp.parce_list_id = ldpl.id |
|
|
|
|
<where> |
|
|
|
|
ldpl.order_package_status != 70 |
|
|
|
|
AND ldrp.packet_bar_status != 2 |
|
|
|
|
AND ldrp.is_deleted = 0 |
|
|
|
|
AND DATE_FORMAT( ldrp.create_time, "%y%m" ) = DATE_FORMAT( #{param.dayStr}, "%y%m" ) |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
AND ldpl.warehouse_id IN |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
) + ( |
|
|
|
|
SELECT |
|
|
|
|
IFNULL( sum( quantity ), 0 ) |
|
|
|
|
FROM |
|
|
|
|
logpm_distrilbution_bill_package AS ldbp |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldbp.parce_list_id = ldpl.id |
|
|
|
|
<where> |
|
|
|
|
ldpl.order_package_status != 70 |
|
|
|
|
AND ldbp.packet_bar_status != 2 |
|
|
|
|
AND ldbp.is_deleted = 0 |
|
|
|
|
AND DATE_FORMAT( ldbp.create_time, "%y%m" ) = DATE_FORMAT( #{param.dayStr}, "%y%m" ) |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
AND ldpl.warehouse_id IN |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
)) |
|
|
|
|
</select> |
|
|
|
|
<select id="findClerkSignforNumByDay" resultType="java.lang.Integer"> |
|
|
|
|
SELECT |
|
|
|
|
count( 1 ) |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_reservation AS ldr |
|
|
|
|
LEFT JOIN logpm_distribution_signfor AS lds ON lds.reservation_id = ldr.id |
|
|
|
|
<where> |
|
|
|
|
ldr.reservation_status != 40 |
|
|
|
|
AND ldr.is_deleted = 0 |
|
|
|
|
AND lds.is_deleted = 0 |
|
|
|
|
AND lds.signing_status = 2 |
|
|
|
|
AND DATE_FORMAT(lds.signing_time, "%y%m%d" ) = DATE_FORMAT( #{param.dayStr}, "%y%m%d" ) |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
AND ldr.warehouse_id IN |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
</select> |
|
|
|
|
<select id="findClerkSignforNumByMonth" resultType="java.lang.Integer"> |
|
|
|
|
SELECT |
|
|
|
|
count( 1 ) |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_reservation AS ldr |
|
|
|
|
LEFT JOIN logpm_distribution_signfor AS lds ON lds.reservation_id = ldr.id |
|
|
|
|
<where> |
|
|
|
|
ldr.reservation_status != 40 |
|
|
|
|
AND ldr.is_deleted = 0 |
|
|
|
|
AND lds.is_deleted = 0 |
|
|
|
|
AND lds.signing_status = 2 |
|
|
|
|
AND DATE_FORMAT(lds.signing_time, "%y%m%d" ) = DATE_FORMAT( #{param.dayStr}, "%y%m%d" ) |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
AND ldr.warehouse_id IN |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
</select> |
|
|
|
|
<select id="findPlanNumByDay" resultType="java.lang.Integer"> |
|
|
|
|
SELECT |
|
|
|
|
count( 1 ) |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_reservation |
|
|
|
|
<where> |
|
|
|
|
reservation_status != 40 |
|
|
|
|
AND is_deleted = 0 |
|
|
|
|
<if test="param.warehouseIds != null"> |
|
|
|
|
AND warehouse_id IN |
|
|
|
|
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
|
|