| | |
| | | s.create_user, |
| | | s.update_user, |
| | | s.tenant_id, |
| | | s.shipping_document, |
| | | s.is_reconciled, |
| | | s.statement_archiving_status, |
| | | s.is_settled, |
| | | s.settlement_archiving_status, |
| | | s.is_invoiced, |
| | | s.project_id, |
| | | sl.project_name as projectName, |
| | | sl.sales_contract_no, |
| | | pm.model as specification_model, |
| | | pm.unit, |
| | | p.product_name, |
| | | sl.customer_name, |
| | | spd.totalQuantity, |
| | | sor.outboundBatches |
| | | sor.outboundBatches, |
| | | rm_agg.returnNos |
| | | FROM shipping_info s |
| | | LEFT JOIN (select shipping_info_id,sum(quantity) totalQuantity from shipping_product_detail GROUP BY shipping_info_id) spd ON spd.shipping_info_id = s.id |
| | | LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id |
| | |
| | | from stock_out_record |
| | | where record_type='13'and approval_status=1 |
| | | group by record_id)sor on sor.record_id= s.id |
| | | left join (select shipping_id, GROUP_CONCAT(DISTINCT return_no SEPARATOR ',') AS returnNos |
| | | from return_management |
| | | group by shipping_id) rm_agg on rm_agg.shipping_id = s.id |
| | | WHERE 1=1 |
| | | <if test="req.salesContractNo != null and req.salesContractNo != ''"> |
| | | AND sl.sales_contract_no LIKE CONCAT('%',#{req.salesContractNo},'%') |
| | |
| | | </if> |
| | | <if test="req.expressNumber != null and req.expressNumber != ''"> |
| | | AND s.express_number LIKE CONCAT('%',#{req.expressNumber},'%') |
| | | </if> |
| | | <if test="req.projectId != null"> |
| | | AND s.project_id = #{req.projectId} |
| | | </if> |
| | | <if test="req.beginShippingDate != null and req.beginShippingDate != ''"> |
| | | AND DATE(s.shipping_date) >= DATE(#{req.beginShippingDate}) |
| | | </if> |
| | | <if test="req.endShippingDate != null and req.endShippingDate != ''"> |
| | | AND DATE(s.shipping_date) <= DATE(#{req.endShippingDate}) |
| | | </if> |
| | | order by create_time DESC |
| | | </select> |
| | |
| | | s.create_user, |
| | | s.update_user, |
| | | s.tenant_id, |
| | | s.shipping_document, |
| | | s.is_reconciled, |
| | | s.statement_archiving_status, |
| | | s.is_settled, |
| | | s.settlement_archiving_status, |
| | | s.is_invoiced, |
| | | s.project_id, |
| | | sl.project_name as projectName, |
| | | sl.sales_contract_no, |
| | | sl.customer_name |
| | | FROM shipping_info s |
| | | LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id |
| | | WHERE 1=1 |
| | | <if test="req.salesContractNo != null and req.salesContractNo != ''"> |
| | | AND sl.sales_contract_no LIKE CONCAT('%',#{req.salesContractNo},'%') |
| | | </if> |
| | | <if test="req.shippingCarNumber != null and req.shippingCarNumber != ''"> |
| | | AND s.shipping_car_number LIKE CONCAT('%',#{req.shippingCarNumber},'%') |
| | | </if> |
| | | <if test="req.shippingNo != null and req.shippingNo != ''"> |
| | | AND s.shipping_no LIKE CONCAT('%',#{req.shippingNo},'%') |
| | | </if> |
| | | <if test="req.expressNumber != null and req.expressNumber != ''"> |
| | | AND s.express_number LIKE CONCAT('%',#{req.expressNumber},'%') |
| | | </if> |
| | | <if test="req.projectId != null"> |
| | | AND s.project_id = #{req.projectId} |
| | | </if> |
| | | <if test="req.beginShippingDate != null and req.beginShippingDate != ''"> |
| | | AND DATE(s.shipping_date) >= DATE(#{req.beginShippingDate}) |
| | | </if> |
| | | <if test="req.endShippingDate != null and req.endShippingDate != ''"> |
| | | AND DATE(s.shipping_date) <= DATE(#{req.endShippingDate}) |
| | | </if> |
| | | order by create_time DESC |
| | | </select> |
| | | <select id="getReturnManagementDtoById" resultType="com.ruoyi.procurementrecord.bean.vo.ShippingProductVo"> |
| | | SELECT distinct |