|
|
|
@ -99,406 +99,266 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getWarehousingstorageList1" resultType="jnpf.entity.CwaccountvoucherEntity">
|
|
|
|
|
SELECT b.document_no orderId,
|
|
|
|
|
c.order_no orderNo,
|
|
|
|
|
c.voucher_code voucherCode,
|
|
|
|
|
c.id voucherId,
|
|
|
|
|
c.document_type documentType,
|
|
|
|
|
c.voucher_type voucherType,
|
|
|
|
|
c.pound_code poundCode,
|
|
|
|
|
d.driver_name driverName,
|
|
|
|
|
e.id vehicleId,
|
|
|
|
|
e.vehicle_number vehicleName,
|
|
|
|
|
c.poundlist_time poundlistTime,
|
|
|
|
|
f.product_id productId,
|
|
|
|
|
f.spec spec,
|
|
|
|
|
f.unit unit,
|
|
|
|
|
IFNULL(f.gross_weight,0) grossWeight,
|
|
|
|
|
IFNULL(f.tare_weight,0) tareWeight,
|
|
|
|
|
IFNULL(f.buckle_weight,0) buckleWeight,
|
|
|
|
|
IFNULL(f.net_weight,0) netWeight,
|
|
|
|
|
-- subtotal_weight小计重量
|
|
|
|
|
IFNULL(j.tax_rate,13) rate,
|
|
|
|
|
IFNULL(j.price_rate,0) contractPrice,
|
|
|
|
|
f.unit settlementUnit,
|
|
|
|
|
k.name productName,
|
|
|
|
|
IFNULL(ROUND(c.purchase_amount / f.net_weight, 6),0) settlementPrice,
|
|
|
|
|
m.business_price businessPrice,
|
|
|
|
|
m.tax tax,
|
|
|
|
|
m.tax_count taxCount,
|
|
|
|
|
m.not_tax_price notTaxPrice,
|
|
|
|
|
m.not_tax_count notTaxCount
|
|
|
|
|
from jg_warehousing_storage_poundlist a
|
|
|
|
|
LEFT JOIN jg_warehousing_storage b on a.warehousing_storage_id = b.id
|
|
|
|
|
LEFT JOIN jg_voucher c on a.voucher_id = c.id
|
|
|
|
|
LEFT JOIN jg_voucher_vehicle d on a.voucher_id = d.voucher_id
|
|
|
|
|
LEFT JOIN jg_vehicle e on e.id = d.vehicle_id
|
|
|
|
|
LEFT JOIN jg_voucher_product f on c.id = f.voucher_id
|
|
|
|
|
LEFT JOIN jg_warehousing_notification g on g.id = b.warehousing_id
|
|
|
|
|
LEFT JOIN jg_business_order h on g.business_id = h.id
|
|
|
|
|
LEFT JOIN jg_contract i on h.contract_id = i.id
|
|
|
|
|
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
|
|
|
|
|
LEFT JOIN jg_product k on f.product_id = k.id
|
|
|
|
|
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
|
|
|
|
|
where a.warehousing_storage_id in
|
|
|
|
|
SELECT
|
|
|
|
|
product_id productId,
|
|
|
|
|
b.spec spec,
|
|
|
|
|
a.inventory_unit_id inventoryUnitId,
|
|
|
|
|
a.sales_main_unit_id purchaseUnitId,
|
|
|
|
|
a.sales_main_unit_id settlementUnit,
|
|
|
|
|
a.business_num settlementSum,
|
|
|
|
|
a.business_price settlementPrice,
|
|
|
|
|
a.tax_count settlementSubtotal,
|
|
|
|
|
a.tax rate,
|
|
|
|
|
a.not_tax_price settlementPriceNo,
|
|
|
|
|
a.not_tax_count settlementSubtotalNo,
|
|
|
|
|
a.tax_count settlementTotal,
|
|
|
|
|
a.not_tax_count settlementTotalNo
|
|
|
|
|
FROM
|
|
|
|
|
jg_business_order_product_relational a
|
|
|
|
|
LEFT JOIN jg_product b ON a.product_id = b.id
|
|
|
|
|
WHERE
|
|
|
|
|
a.business_order_id IN (
|
|
|
|
|
SELECT
|
|
|
|
|
id
|
|
|
|
|
FROM
|
|
|
|
|
jg_business_order
|
|
|
|
|
WHERE
|
|
|
|
|
CODE IN ( SELECT business_order_no FROM jg_warehousing_storage WHERE id IN
|
|
|
|
|
<foreach item="item" index="index" collection="storageIdList"
|
|
|
|
|
open="(" separator="," close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
))
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getWarehousingstorageList2" resultType="jnpf.entity.CwaccountvoucherEntity">
|
|
|
|
|
SELECT b.document_no orderId,
|
|
|
|
|
c.order_no orderNo,
|
|
|
|
|
c.voucher_code voucherCode,
|
|
|
|
|
c.id voucherId,
|
|
|
|
|
c.document_type documentType,
|
|
|
|
|
c.voucher_type voucherType,
|
|
|
|
|
c.pound_code poundCode,
|
|
|
|
|
d.driver_name driverName,
|
|
|
|
|
e.id vehicleId,
|
|
|
|
|
e.vehicle_number vehicleName,
|
|
|
|
|
c.poundlist_time poundlistTime,
|
|
|
|
|
f.product_id productId,
|
|
|
|
|
f.spec spec,
|
|
|
|
|
f.unit unit,
|
|
|
|
|
IFNULL(f.gross_weight,0) grossWeight,
|
|
|
|
|
IFNULL(f.tare_weight,0) tareWeight,
|
|
|
|
|
IFNULL(f.buckle_weight,0) buckleWeight,
|
|
|
|
|
IFNULL(f.net_weight,0) netWeight,
|
|
|
|
|
-- subtotal_weight小计重量
|
|
|
|
|
IFNULL(j.tax_rate,13) rate,
|
|
|
|
|
IFNULL(j.price_rate,0) contractPrice,
|
|
|
|
|
f.unit settlementUnit,
|
|
|
|
|
k.name productName,
|
|
|
|
|
IFNULL(ROUND(c.sale_amount / f.net_weight, 6),0) settlementPrice,
|
|
|
|
|
c.business_order_id businessOrderId,
|
|
|
|
|
m.business_price businessPrice,
|
|
|
|
|
m.tax tax,
|
|
|
|
|
m.tax_count taxCount,
|
|
|
|
|
m.not_tax_price notTaxPrice,
|
|
|
|
|
m.not_tax_count notTaxCount
|
|
|
|
|
from jg_warehousing_storage_poundlist a
|
|
|
|
|
LEFT JOIN jg_warehousing_storage b on a.warehousing_storage_id = b.id
|
|
|
|
|
LEFT JOIN jg_voucher c on a.voucher_id = c.id
|
|
|
|
|
LEFT JOIN jg_voucher_vehicle d on a.voucher_id = d.voucher_id
|
|
|
|
|
LEFT JOIN jg_vehicle e on e.id = d.vehicle_id
|
|
|
|
|
LEFT JOIN jg_voucher_product f on c.id = f.voucher_id
|
|
|
|
|
LEFT JOIN jg_warehousing_notification g on g.id = b.warehousing_id
|
|
|
|
|
LEFT JOIN jg_return_cargo_order p ON g.business_id = p.id
|
|
|
|
|
LEFT JOIN jg_business_order h on p.business_id = h.id
|
|
|
|
|
LEFT JOIN jg_contract i on h.contract_id = i.id
|
|
|
|
|
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
|
|
|
|
|
LEFT JOIN jg_product k on f.product_id = k.id
|
|
|
|
|
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
|
|
|
|
|
where a.warehousing_storage_id in
|
|
|
|
|
SELECT
|
|
|
|
|
product_id productId,
|
|
|
|
|
b.spec spec,
|
|
|
|
|
a.inventory_unit_id inventoryUnitId,
|
|
|
|
|
a.sales_main_unit_id purchaseUnitId,
|
|
|
|
|
a.sales_main_unit_id settlementUnit,
|
|
|
|
|
a.business_num settlementSum,
|
|
|
|
|
a.business_price settlementPrice,
|
|
|
|
|
a.tax_count settlementSubtotal,
|
|
|
|
|
a.tax rate,
|
|
|
|
|
a.not_tax_price settlementPriceNo,
|
|
|
|
|
a.not_tax_count settlementSubtotalNo,
|
|
|
|
|
a.tax_count settlementTotal,
|
|
|
|
|
a.not_tax_count settlementTotalNo
|
|
|
|
|
FROM
|
|
|
|
|
jg_business_order_product_relational a
|
|
|
|
|
LEFT JOIN jg_product b ON a.product_id = b.id
|
|
|
|
|
WHERE
|
|
|
|
|
a.business_order_id IN (
|
|
|
|
|
SELECT
|
|
|
|
|
id
|
|
|
|
|
FROM
|
|
|
|
|
jg_business_order
|
|
|
|
|
WHERE
|
|
|
|
|
CODE IN ( SELECT business_order_no FROM jg_warehousing_storage WHERE id IN
|
|
|
|
|
<foreach item="item" index="index" collection="storageIdList"
|
|
|
|
|
open="(" separator="," close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
))
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getWarehousingstorageList3" resultType="jnpf.entity.CwaccountvoucherEntity">
|
|
|
|
|
SELECT b.document_no orderId,
|
|
|
|
|
c.order_no orderNo,
|
|
|
|
|
c.voucher_code voucherCode,
|
|
|
|
|
c.id voucherId,
|
|
|
|
|
c.document_type documentType,
|
|
|
|
|
c.voucher_type voucherType,
|
|
|
|
|
c.pound_code poundCode,
|
|
|
|
|
d.driver_name driverName,
|
|
|
|
|
e.id vehicleId,
|
|
|
|
|
e.vehicle_number vehicleName,
|
|
|
|
|
c.poundlist_time poundlistTime,
|
|
|
|
|
f.product_id productId,
|
|
|
|
|
f.spec spec,
|
|
|
|
|
f.unit unit,
|
|
|
|
|
IFNULL(f.gross_weight,0) grossWeight,
|
|
|
|
|
IFNULL(f.tare_weight,0) tareWeight,
|
|
|
|
|
IFNULL(f.buckle_weight,0) buckleWeight,
|
|
|
|
|
IFNULL(f.net_weight,0) netWeight,
|
|
|
|
|
-- subtotal_weight小计重量
|
|
|
|
|
IFNULL(j.tax_rate,13) rate,
|
|
|
|
|
IFNULL(j.price_rate,0) contractPrice,
|
|
|
|
|
f.unit settlementUnit,
|
|
|
|
|
k.name productName,
|
|
|
|
|
IFNULL(ROUND(c.sale_amount / f.net_weight, 6),0) settlementPrice,
|
|
|
|
|
c.business_order_id businessOrderId,
|
|
|
|
|
m.business_price businessPrice,
|
|
|
|
|
m.tax tax,
|
|
|
|
|
m.tax_count taxCount,
|
|
|
|
|
m.not_tax_price notTaxPrice,
|
|
|
|
|
m.not_tax_count notTaxCount
|
|
|
|
|
from jg_warehousing_storage_poundlist a
|
|
|
|
|
LEFT JOIN jg_warehousing_storage b on a.warehousing_storage_id = b.id
|
|
|
|
|
LEFT JOIN jg_voucher c on a.voucher_id = c.id
|
|
|
|
|
LEFT JOIN jg_voucher_vehicle d on a.voucher_id = d.voucher_id
|
|
|
|
|
LEFT JOIN jg_vehicle e on e.id = d.vehicle_id
|
|
|
|
|
LEFT JOIN jg_voucher_product f on c.id = f.voucher_id
|
|
|
|
|
LEFT JOIN jg_receipt_order g ON b.warehousing_id = g.id
|
|
|
|
|
LEFT JOIN jg_return_cargo_order p ON g.business_id = p.id
|
|
|
|
|
LEFT JOIN jg_business_order h on p.business_id = h.id
|
|
|
|
|
LEFT JOIN jg_contract i on h.contract_id = i.id
|
|
|
|
|
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
|
|
|
|
|
LEFT JOIN jg_product k on f.product_id = k.id
|
|
|
|
|
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
|
|
|
|
|
where a.warehousing_storage_id in
|
|
|
|
|
SELECT
|
|
|
|
|
product_id productId,
|
|
|
|
|
b.spec spec,
|
|
|
|
|
a.inventory_unit_id inventoryUnitId,
|
|
|
|
|
a.sales_main_unit_id purchaseUnitId,
|
|
|
|
|
a.sales_main_unit_id settlementUnit,
|
|
|
|
|
a.business_num settlementSum,
|
|
|
|
|
a.business_price settlementPrice,
|
|
|
|
|
a.tax_count settlementSubtotal,
|
|
|
|
|
a.tax rate,
|
|
|
|
|
a.not_tax_price settlementPriceNo,
|
|
|
|
|
a.not_tax_count settlementSubtotalNo,
|
|
|
|
|
a.tax_count settlementTotal,
|
|
|
|
|
a.not_tax_count settlementTotalNo
|
|
|
|
|
FROM
|
|
|
|
|
jg_business_order_product_relational a
|
|
|
|
|
LEFT JOIN jg_product b ON a.product_id = b.id
|
|
|
|
|
WHERE
|
|
|
|
|
a.business_order_id IN (
|
|
|
|
|
SELECT
|
|
|
|
|
id
|
|
|
|
|
FROM
|
|
|
|
|
jg_business_order
|
|
|
|
|
WHERE
|
|
|
|
|
CODE IN ( SELECT business_order_no FROM jg_warehousing_storage WHERE id IN
|
|
|
|
|
<foreach item="item" index="index" collection="storageIdList"
|
|
|
|
|
open="(" separator="," close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
))
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getWarehousingstorageList4" resultType="jnpf.entity.CwaccountvoucherEntity">
|
|
|
|
|
SELECT b.document_no orderId,
|
|
|
|
|
c.order_no orderNo,
|
|
|
|
|
c.voucher_code voucherCode,
|
|
|
|
|
c.id voucherId,
|
|
|
|
|
c.document_type documentType,
|
|
|
|
|
c.voucher_type voucherType,
|
|
|
|
|
c.pound_code poundCode,
|
|
|
|
|
d.driver_name driverName,
|
|
|
|
|
e.id vehicleId,
|
|
|
|
|
e.vehicle_number vehicleName,
|
|
|
|
|
c.poundlist_time poundlistTime,
|
|
|
|
|
f.product_id productId,
|
|
|
|
|
l.spec spec,
|
|
|
|
|
f.unit unit,
|
|
|
|
|
IFNULL(f.gross_weight,0) grossWeight,
|
|
|
|
|
IFNULL(f.tare_weight,0) tareWeight,
|
|
|
|
|
IFNULL(f.buckle_weight,0) buckleWeight,
|
|
|
|
|
IFNULL(f.net_weight,0) netWeight,
|
|
|
|
|
-- subtotal_weight小计重量
|
|
|
|
|
IFNULL(j.tax_rate,13) rate,
|
|
|
|
|
IFNULL(j.price_rate,0) contractPrice,
|
|
|
|
|
f.unit settlementUnit,
|
|
|
|
|
k.name productName,
|
|
|
|
|
IFNULL(ROUND(c.purchase_amount / f.net_weight, 6),0) settlementPrice,
|
|
|
|
|
m.business_price businessPrice,
|
|
|
|
|
m.tax tax,
|
|
|
|
|
m.tax_count taxCount,
|
|
|
|
|
m.not_tax_price notTaxPrice,
|
|
|
|
|
m.not_tax_count notTaxCount
|
|
|
|
|
from jg_warehousing_storage_poundlist a
|
|
|
|
|
LEFT JOIN jg_warehousing_storage b on a.warehousing_storage_id = b.id
|
|
|
|
|
LEFT JOIN jg_voucher c on a.voucher_id = c.id
|
|
|
|
|
LEFT JOIN jg_voucher_vehicle d on a.voucher_id = d.voucher_id
|
|
|
|
|
LEFT JOIN jg_vehicle e on e.id = d.vehicle_id
|
|
|
|
|
LEFT JOIN jg_voucher_product f on c.id = f.voucher_id
|
|
|
|
|
LEFT JOIN jg_receipt_order g ON b.warehousing_id = g.id
|
|
|
|
|
LEFT JOIN jg_business_order h on g.business_id = h.id
|
|
|
|
|
LEFT JOIN jg_contract i on h.contract_id = i.id
|
|
|
|
|
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
|
|
|
|
|
LEFT JOIN jg_product k on f.product_id = k.id
|
|
|
|
|
LEFT JOIN jg_warehousing_storage_product l on l.warehousing_storage_id = b.id
|
|
|
|
|
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
|
|
|
|
|
where a.warehousing_storage_id in
|
|
|
|
|
SELECT
|
|
|
|
|
product_id productId,
|
|
|
|
|
b.spec spec,
|
|
|
|
|
a.inventory_unit_id inventoryUnitId,
|
|
|
|
|
a.sales_main_unit_id purchaseUnitId,
|
|
|
|
|
a.sales_main_unit_id settlementUnit,
|
|
|
|
|
a.business_num settlementSum,
|
|
|
|
|
a.business_price settlementPrice,
|
|
|
|
|
a.tax_count settlementSubtotal,
|
|
|
|
|
a.tax rate,
|
|
|
|
|
a.not_tax_price settlementPriceNo,
|
|
|
|
|
a.not_tax_count settlementSubtotalNo,
|
|
|
|
|
a.tax_count settlementTotal,
|
|
|
|
|
a.not_tax_count settlementTotalNo
|
|
|
|
|
FROM
|
|
|
|
|
jg_business_order_product_relational a
|
|
|
|
|
LEFT JOIN jg_product b ON a.product_id = b.id
|
|
|
|
|
WHERE
|
|
|
|
|
a.business_order_id IN (
|
|
|
|
|
SELECT
|
|
|
|
|
id
|
|
|
|
|
FROM
|
|
|
|
|
jg_business_order
|
|
|
|
|
WHERE
|
|
|
|
|
CODE IN ( SELECT business_order_no FROM jg_warehousing_storage WHERE id IN
|
|
|
|
|
<foreach item="item" index="index" collection="storageIdList"
|
|
|
|
|
open="(" separator="," close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
GROUP BY a.id
|
|
|
|
|
))
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getWarehousingstorageList5" resultType="jnpf.entity.CwaccountvoucherEntity">
|
|
|
|
|
SELECT b.document_no orderId,
|
|
|
|
|
c.order_no orderNo,
|
|
|
|
|
c.voucher_code voucherCode,
|
|
|
|
|
c.id voucherId,
|
|
|
|
|
c.document_type documentType,
|
|
|
|
|
c.voucher_type voucherType,
|
|
|
|
|
c.pound_code poundCode,
|
|
|
|
|
d.driver_name driverName,
|
|
|
|
|
e.id vehicleId,
|
|
|
|
|
e.vehicle_number vehicleName,
|
|
|
|
|
c.poundlist_time poundlistTime,
|
|
|
|
|
f.product_id productId,
|
|
|
|
|
f.spec spec,
|
|
|
|
|
f.unit unit,
|
|
|
|
|
IFNULL(f.gross_weight,0) grossWeight,
|
|
|
|
|
IFNULL(f.tare_weight,0) tareWeight,
|
|
|
|
|
IFNULL(f.buckle_weight,0) buckleWeight,
|
|
|
|
|
IFNULL(f.net_weight,0) netWeight,
|
|
|
|
|
-- subtotal_weight小计重量
|
|
|
|
|
IFNULL(j.tax_rate,13) rate,
|
|
|
|
|
IFNULL(j.price_rate,0) contractPrice,
|
|
|
|
|
f.unit settlementUnit,
|
|
|
|
|
k.name productName,
|
|
|
|
|
IFNULL(ROUND(c.sale_amount / f.net_weight, 6),0) settlementPrice,
|
|
|
|
|
c.business_order_id businessOrderId,
|
|
|
|
|
m.business_price businessPrice,
|
|
|
|
|
m.tax tax,
|
|
|
|
|
m.tax_count taxCount,
|
|
|
|
|
m.not_tax_price notTaxPrice,
|
|
|
|
|
m.not_tax_count notTaxCount
|
|
|
|
|
from jg_warehousing_outbound_poundlist a
|
|
|
|
|
LEFT JOIN jg_warehousing_outbound b on a.warehousing_outbound_id = b.id
|
|
|
|
|
LEFT JOIN jg_voucher c on a.voucher_id = c.id
|
|
|
|
|
LEFT JOIN jg_voucher_vehicle d on a.voucher_id = d.voucher_id
|
|
|
|
|
LEFT JOIN jg_vehicle e on e.id = d.vehicle_id
|
|
|
|
|
LEFT JOIN jg_voucher_product f on c.id = f.voucher_id
|
|
|
|
|
LEFT JOIN jg_warehousing_notification g on g.id = b.warehousing_id
|
|
|
|
|
LEFT JOIN jg_business_order h on g.business_id = h.id
|
|
|
|
|
LEFT JOIN jg_contract i on h.contract_id = i.id
|
|
|
|
|
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
|
|
|
|
|
LEFT JOIN jg_product k on f.product_id = k.id
|
|
|
|
|
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
|
|
|
|
|
where a.warehousing_outbound_id in
|
|
|
|
|
SELECT
|
|
|
|
|
product_id productId,
|
|
|
|
|
b.spec spec,
|
|
|
|
|
a.inventory_unit_id inventoryUnitId,
|
|
|
|
|
a.sales_main_unit_id purchaseUnitId,
|
|
|
|
|
a.sales_main_unit_id settlementUnit,
|
|
|
|
|
a.business_num settlementSum,
|
|
|
|
|
a.business_price settlementPrice,
|
|
|
|
|
a.tax_count settlementSubtotal,
|
|
|
|
|
a.tax rate,
|
|
|
|
|
a.not_tax_price settlementPriceNo,
|
|
|
|
|
a.not_tax_count settlementSubtotalNo,
|
|
|
|
|
a.tax_count settlementTotal,
|
|
|
|
|
a.not_tax_count settlementTotalNo
|
|
|
|
|
FROM
|
|
|
|
|
jg_business_order_product_relational a
|
|
|
|
|
LEFT JOIN jg_product b ON a.product_id = b.id
|
|
|
|
|
WHERE
|
|
|
|
|
a.business_order_id IN (
|
|
|
|
|
SELECT
|
|
|
|
|
id
|
|
|
|
|
FROM
|
|
|
|
|
jg_business_order
|
|
|
|
|
WHERE
|
|
|
|
|
CODE IN ( SELECT business_order_no FROM jg_warehousing_outbound WHERE id IN
|
|
|
|
|
<foreach item="item" index="index" collection="storageIdList"
|
|
|
|
|
open="(" separator="," close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
))
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getWarehousingstorageList6" resultType="jnpf.entity.CwaccountvoucherEntity">
|
|
|
|
|
SELECT b.document_no orderId,
|
|
|
|
|
c.order_no orderNo,
|
|
|
|
|
c.voucher_code voucherCode,
|
|
|
|
|
c.id voucherId,
|
|
|
|
|
c.document_type documentType,
|
|
|
|
|
c.voucher_type voucherType,
|
|
|
|
|
c.pound_code poundCode,
|
|
|
|
|
d.driver_name driverName,
|
|
|
|
|
e.id vehicleId,
|
|
|
|
|
e.vehicle_number vehicleName,
|
|
|
|
|
c.poundlist_time poundlistTime,
|
|
|
|
|
f.product_id productId,
|
|
|
|
|
f.spec spec,
|
|
|
|
|
f.unit unit,
|
|
|
|
|
IFNULL(f.gross_weight,0) grossWeight,
|
|
|
|
|
IFNULL(f.tare_weight,0) tareWeight,
|
|
|
|
|
IFNULL(f.buckle_weight,0) buckleWeight,
|
|
|
|
|
IFNULL(f.net_weight,0) netWeight,
|
|
|
|
|
-- subtotal_weight小计重量
|
|
|
|
|
IFNULL(j.tax_rate,13) rate,
|
|
|
|
|
IFNULL(j.price_rate,0) contractPrice,
|
|
|
|
|
f.unit settlementUnit,
|
|
|
|
|
k.name productName,
|
|
|
|
|
IFNULL(ROUND(c.purchase_amount / f.net_weight, 6),0) settlementPrice,
|
|
|
|
|
m.business_price businessPrice,
|
|
|
|
|
m.tax tax,
|
|
|
|
|
m.tax_count taxCount,
|
|
|
|
|
m.not_tax_price notTaxPrice,
|
|
|
|
|
m.not_tax_count notTaxCount
|
|
|
|
|
from jg_warehousing_outbound_poundlist a
|
|
|
|
|
LEFT JOIN jg_warehousing_outbound b on a.warehousing_outbound_id = b.id
|
|
|
|
|
LEFT JOIN jg_voucher c on a.voucher_id = c.id
|
|
|
|
|
LEFT JOIN jg_voucher_vehicle d on a.voucher_id = d.voucher_id
|
|
|
|
|
LEFT JOIN jg_vehicle e on e.id = d.vehicle_id
|
|
|
|
|
LEFT JOIN jg_voucher_product f on c.id = f.voucher_id
|
|
|
|
|
LEFT JOIN jg_warehousing_notification g on g.id = b.warehousing_id
|
|
|
|
|
LEFT JOIN jg_return_cargo_order p ON p.id = g.business_id
|
|
|
|
|
LEFT JOIN jg_business_order h on p.business_id = h.id
|
|
|
|
|
LEFT JOIN jg_contract i on h.contract_id = i.id
|
|
|
|
|
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
|
|
|
|
|
LEFT JOIN jg_product k on f.product_id = k.id
|
|
|
|
|
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
|
|
|
|
|
where a.warehousing_outbound_id in
|
|
|
|
|
SELECT
|
|
|
|
|
product_id productId,
|
|
|
|
|
b.spec spec,
|
|
|
|
|
a.inventory_unit_id inventoryUnitId,
|
|
|
|
|
a.sales_main_unit_id purchaseUnitId,
|
|
|
|
|
a.sales_main_unit_id settlementUnit,
|
|
|
|
|
a.business_num settlementSum,
|
|
|
|
|
a.business_price settlementPrice,
|
|
|
|
|
a.tax_count settlementSubtotal,
|
|
|
|
|
a.tax rate,
|
|
|
|
|
a.not_tax_price settlementPriceNo,
|
|
|
|
|
a.not_tax_count settlementSubtotalNo,
|
|
|
|
|
a.tax_count settlementTotal,
|
|
|
|
|
a.not_tax_count settlementTotalNo
|
|
|
|
|
FROM
|
|
|
|
|
jg_business_order_product_relational a
|
|
|
|
|
LEFT JOIN jg_product b ON a.product_id = b.id
|
|
|
|
|
WHERE
|
|
|
|
|
a.business_order_id IN (
|
|
|
|
|
SELECT
|
|
|
|
|
id
|
|
|
|
|
FROM
|
|
|
|
|
jg_business_order
|
|
|
|
|
WHERE
|
|
|
|
|
CODE IN ( SELECT business_order_no FROM jg_warehousing_outbound WHERE id IN
|
|
|
|
|
<foreach item="item" index="index" collection="storageIdList"
|
|
|
|
|
open="(" separator="," close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
))
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getWarehousingstorageList7" resultType="jnpf.entity.CwaccountvoucherEntity">
|
|
|
|
|
SELECT b.document_no orderId,
|
|
|
|
|
c.order_no orderNo,
|
|
|
|
|
c.voucher_code voucherCode,
|
|
|
|
|
c.id voucherId,
|
|
|
|
|
c.document_type documentType,
|
|
|
|
|
c.voucher_type voucherType,
|
|
|
|
|
c.pound_code poundCode,
|
|
|
|
|
d.driver_name driverName,
|
|
|
|
|
e.id vehicleId,
|
|
|
|
|
e.vehicle_number vehicleName,
|
|
|
|
|
c.poundlist_time poundlistTime,
|
|
|
|
|
f.product_id productId,
|
|
|
|
|
l.spec spec,
|
|
|
|
|
f.unit unit,
|
|
|
|
|
IFNULL(f.gross_weight,0) grossWeight,
|
|
|
|
|
IFNULL(f.tare_weight,0) tareWeight,
|
|
|
|
|
IFNULL(f.buckle_weight,0) buckleWeight,
|
|
|
|
|
IFNULL(f.net_weight,0) netWeight,
|
|
|
|
|
-- subtotal_weight小计重量
|
|
|
|
|
IFNULL(j.tax_rate,13) rate,
|
|
|
|
|
IFNULL(j.price_rate,0) contractPrice,
|
|
|
|
|
f.unit settlementUnit,
|
|
|
|
|
k.name productName,
|
|
|
|
|
IFNULL(ROUND(c.sale_amount / f.net_weight, 6),0) settlementPrice,
|
|
|
|
|
c.business_order_id businessOrderId,
|
|
|
|
|
m.business_price businessPrice,
|
|
|
|
|
m.tax tax,
|
|
|
|
|
m.tax_count taxCount,
|
|
|
|
|
m.not_tax_price notTaxPrice,
|
|
|
|
|
m.not_tax_count notTaxCount
|
|
|
|
|
from jg_warehousing_outbound_poundlist a
|
|
|
|
|
LEFT JOIN jg_warehousing_outbound b on a.warehousing_outbound_id = b.id
|
|
|
|
|
LEFT JOIN jg_voucher c on a.voucher_id = c.id
|
|
|
|
|
LEFT JOIN jg_voucher_vehicle d on a.voucher_id = d.voucher_id
|
|
|
|
|
LEFT JOIN jg_vehicle e on e.id = d.vehicle_id
|
|
|
|
|
LEFT JOIN jg_voucher_product f on c.id = f.voucher_id
|
|
|
|
|
LEFT JOIN jg_delivery_order g ON b.warehousing_id = g.id
|
|
|
|
|
LEFT JOIN jg_business_order h on g.business_id = h.id
|
|
|
|
|
LEFT JOIN jg_contract i on h.contract_id = i.id
|
|
|
|
|
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
|
|
|
|
|
LEFT JOIN jg_product k on f.product_id = k.id
|
|
|
|
|
LEFT JOIN jg_warehousing_outbound_product l on l.warehousing_outbound_id = b.id
|
|
|
|
|
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
|
|
|
|
|
where a.warehousing_outbound_id in
|
|
|
|
|
SELECT
|
|
|
|
|
product_id productId,
|
|
|
|
|
b.spec spec,
|
|
|
|
|
a.inventory_unit_id inventoryUnitId,
|
|
|
|
|
a.sales_main_unit_id purchaseUnitId,
|
|
|
|
|
a.sales_main_unit_id settlementUnit,
|
|
|
|
|
a.business_num settlementSum,
|
|
|
|
|
a.business_price settlementPrice,
|
|
|
|
|
a.tax_count settlementSubtotal,
|
|
|
|
|
a.tax rate,
|
|
|
|
|
a.not_tax_price settlementPriceNo,
|
|
|
|
|
a.not_tax_count settlementSubtotalNo,
|
|
|
|
|
a.tax_count settlementTotal,
|
|
|
|
|
a.not_tax_count settlementTotalNo
|
|
|
|
|
FROM
|
|
|
|
|
jg_business_order_product_relational a
|
|
|
|
|
LEFT JOIN jg_product b ON a.product_id = b.id
|
|
|
|
|
WHERE
|
|
|
|
|
a.business_order_id IN (
|
|
|
|
|
SELECT
|
|
|
|
|
id
|
|
|
|
|
FROM
|
|
|
|
|
jg_business_order
|
|
|
|
|
WHERE
|
|
|
|
|
CODE IN ( SELECT business_order_no FROM jg_warehousing_outbound WHERE id IN
|
|
|
|
|
<foreach item="item" index="index" collection="storageIdList"
|
|
|
|
|
open="(" separator="," close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
GROUP BY a.id
|
|
|
|
|
))
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getWarehousingstorageList8" resultType="jnpf.entity.CwaccountvoucherEntity">
|
|
|
|
|
SELECT b.document_no orderId,
|
|
|
|
|
c.order_no orderNo,
|
|
|
|
|
c.voucher_code voucherCode,
|
|
|
|
|
c.id voucherId,
|
|
|
|
|
c.document_type documentType,
|
|
|
|
|
c.voucher_type voucherType,
|
|
|
|
|
c.pound_code poundCode,
|
|
|
|
|
d.driver_name driverName,
|
|
|
|
|
e.id vehicleId,
|
|
|
|
|
e.vehicle_number vehicleName,
|
|
|
|
|
c.poundlist_time poundlistTime,
|
|
|
|
|
f.product_id productId,
|
|
|
|
|
f.spec spec,
|
|
|
|
|
f.unit unit,
|
|
|
|
|
IFNULL(f.gross_weight,0) grossWeight,
|
|
|
|
|
IFNULL(f.tare_weight,0) tareWeight,
|
|
|
|
|
IFNULL(f.buckle_weight,0) buckleWeight,
|
|
|
|
|
IFNULL(f.net_weight,0) netWeight,
|
|
|
|
|
-- subtotal_weight小计重量
|
|
|
|
|
IFNULL(j.tax_rate,13) rate,
|
|
|
|
|
IFNULL(j.price_rate,0) contractPrice,
|
|
|
|
|
f.unit settlementUnit,
|
|
|
|
|
k.name productName,
|
|
|
|
|
IFNULL(ROUND(c.purchase_amount / f.net_weight, 6),0) settlementPrice,
|
|
|
|
|
m.business_price businessPrice,
|
|
|
|
|
m.tax tax,
|
|
|
|
|
m.tax_count taxCount,
|
|
|
|
|
m.not_tax_price notTaxPrice,
|
|
|
|
|
m.not_tax_count notTaxCount
|
|
|
|
|
from jg_warehousing_outbound_poundlist a
|
|
|
|
|
LEFT JOIN jg_warehousing_outbound b on a.warehousing_outbound_id = b.id
|
|
|
|
|
LEFT JOIN jg_voucher c on a.voucher_id = c.id
|
|
|
|
|
LEFT JOIN jg_voucher_vehicle d on a.voucher_id = d.voucher_id
|
|
|
|
|
LEFT JOIN jg_vehicle e on e.id = d.vehicle_id
|
|
|
|
|
LEFT JOIN jg_voucher_product f on c.id = f.voucher_id
|
|
|
|
|
LEFT JOIN jg_delivery_order g ON b.warehousing_id = g.id
|
|
|
|
|
LEFT JOIN jg_return_cargo_order p ON p.id = g.business_id
|
|
|
|
|
LEFT JOIN jg_business_order h on p.business_id = h.id
|
|
|
|
|
LEFT JOIN jg_contract i on h.contract_id = i.id
|
|
|
|
|
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
|
|
|
|
|
LEFT JOIN jg_product k on f.product_id = k.id
|
|
|
|
|
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
|
|
|
|
|
where a.warehousing_outbound_id in
|
|
|
|
|
SELECT
|
|
|
|
|
product_id productId,
|
|
|
|
|
b.spec spec,
|
|
|
|
|
a.inventory_unit_id inventoryUnitId,
|
|
|
|
|
a.sales_main_unit_id purchaseUnitId,
|
|
|
|
|
a.sales_main_unit_id settlementUnit,
|
|
|
|
|
a.business_num settlementSum,
|
|
|
|
|
a.business_price settlementPrice,
|
|
|
|
|
a.tax_count settlementSubtotal,
|
|
|
|
|
a.tax rate,
|
|
|
|
|
a.not_tax_price settlementPriceNo,
|
|
|
|
|
a.not_tax_count settlementSubtotalNo,
|
|
|
|
|
a.tax_count settlementTotal,
|
|
|
|
|
a.not_tax_count settlementTotalNo
|
|
|
|
|
FROM
|
|
|
|
|
jg_business_order_product_relational a
|
|
|
|
|
LEFT JOIN jg_product b ON a.product_id = b.id
|
|
|
|
|
WHERE
|
|
|
|
|
a.business_order_id IN (
|
|
|
|
|
SELECT
|
|
|
|
|
id
|
|
|
|
|
FROM
|
|
|
|
|
jg_business_order
|
|
|
|
|
WHERE
|
|
|
|
|
CODE IN ( SELECT business_order_no FROM jg_warehousing_outbound WHERE id IN
|
|
|
|
|
<foreach item="item" index="index" collection="storageIdList"
|
|
|
|
|
open="(" separator="," close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
))
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|
|
|
|
|