(SELECT SUM(storage_number) from jg_warehousing_storage_product where product_id = a.product_id and warehousing_storage_id = d.id) storageNumber
(SELECT SUM(storage_number) from jg_warehousing_storage_product where product_id = a.product_id and warehousing_storage_id = d.id and ord_ln = a.ord_ln) storageNumber
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id
@ -243,7 +243,7 @@
c.code businessCode,
d.document_no docmentNo,
f.cargo_name warehouseName,
(SELECT SUM(storage_number) from jg_warehousing_storage_product where product_id = a.product_id and warehousing_storage_id = d.id) storageNumber
(SELECT SUM(storage_number) from jg_warehousing_storage_product where product_id = a.product_id and warehousing_storage_id = d.id and ord_ln = a.ord_ln) storageNumber
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id
@ -284,15 +284,12 @@
a.ord_ln ordLn,
c.code businessCode,
d.document_no docmentNo,
f.cargo_name warehouseName,
(SELECT SUM(outbound_number) from jg_warehousing_outbound_product where product_id = a.product_id and warehousing_outbound_id = d.id) storageNumber
(SELECT SUM(outbound_number) from jg_warehousing_outbound_product where product_id = a.product_id and warehousing_outbound_id = d.id and ord_ln = a.ord_ln) storageNumber
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id
LEFT JOIN jg_business_order c on a.business_order_id = c.id
LEFT JOIN jg_warehousing_outbound d on c.code = d.business_order_no
LEFT JOIN jg_warehousing_outbound_product e on (e.warehousing_outbound_id = d.id and e.product_id = a.product_id and e.ord_ln = a.ord_ln)
LEFT JOIN jg_business_cargo f on e.outbound_area_id = f.id
WHERE
a.business_order_id IN (
SELECT
@ -369,14 +366,12 @@
c.code businessCode,
d.document_no docmentNo,
f.cargo_name warehouseName,
(SELECT SUM(outbound_number) from jg_warehousing_outbound_product where product_id = a.product_id and warehousing_outbound_id = d.id) storageNumber
(SELECT SUM(outbound_number) from jg_warehousing_outbound_product where product_id = a.product_id and warehousing_outbound_id = d.id and ord_ln = a.ord_ln) storageNumber
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id
LEFT JOIN jg_business_order c on a.business_order_id = c.id
LEFT JOIN jg_warehousing_outbound d on c.code = d.business_order_no
LEFT JOIN jg_warehousing_outbound_product e on (e.warehousing_outbound_id = d.id and e.product_id = a.product_id and e.ord_ln = a.ord_ln)
LEFT JOIN jg_business_cargo f on e.outbound_area_id = f.id
WHERE
a.business_order_id IN (
SELECT
@ -411,7 +406,7 @@
c.code businessCode,
d.document_no docmentNo,
f.cargo_name warehouseName,
(SELECT SUM(outbound_number) from jg_warehousing_outbound_product where product_id = a.product_id and warehousing_outbound_id = d.id) storageNumber
(SELECT SUM(outbound_number) from jg_warehousing_outbound_product where product_id = a.product_id and warehousing_outbound_id = d.id and ord_ln = a.ord_ln) storageNumber
IS NULL LEFT JOIN base_user i1 ON i1.f_Id = a.f_last_modify_user_id
AND i1.f_delete_mark
${ew.customSqlSegment}
<iftest="cwsettlementPagination.keyword != null and cwsettlementPagination.keyword != ''">
AND (a.settlement_sum = #{cwsettlementPagination.keyword} OR a.settlement_subject_name like concat('%',#{cwsettlementPagination.keyword},'%') OR e.contract_name like concat('%',#{cwsettlementPagination.keyword},'%'))
</if>
GROUP BY
a.id
<iftest="cwsettlementPagination.sidx != null and cwsettlementPagination.sidx != ''">
cwsettlementQueryWrapper.inSql("a.id","SELECT settlement_id FROM jg_cw_settlement_subject WHERE subject_id = " +cwsettlementPagination.getSubjectId());
cwsettlementQueryWrapper.inSql("a.id","SELECT settlement_id FROM jg_cw_settlement_subject WHERE subject_id = '" +cwsettlementPagination.getSubjectId()+"'");
cwsettlementQueryWrapper.inSql("a.id","SELECT settlement_id FROM jg_cw_settlement_contract WHERE contract_id = " +cwsettlementPagination.getContractId());
cwsettlementQueryWrapper.inSql("a.id","SELECT settlement_id FROM jg_cw_settlement_contract WHERE contract_id = '" +cwsettlementPagination.getContractId()+"'");
}
@ -976,19 +976,22 @@ public class CwsettlementServiceImpl extends ServiceImpl<CwsettlementMapper, Cws