| | |
| | | FROM sales_ledger |
| | | GROUP BY customer_name |
| | | </select> |
| | | |
| | | <select id="listSalesLedgerAndShipped" resultType="com.ruoyi.sales.dto.SalesLedgerDto"> |
| | | select distinct sl.id as 'disId', sl.* from |
| | | sales_ledger sl |
| | | left join sales_ledger_product slp on sl.id = slp.sales_ledger_id |
| | | left join shipping_info si on slp.id = si.sales_ledger_product_id |
| | | where si.status = '已发货' |
| | | <if test="ew.customerName != null and ew.customerName != '' "> |
| | | and sl.customer_name like concat('%',#{ew.customerName},'%') |
| | | where si.status = '审核通过' |
| | | <if test="ew.customerId != null and ew.customerId != '' "> |
| | | and sl.customer_id = #{ew.customerId} |
| | | </if> |
| | | order by sl.execution_date desc |
| | | </select> |
| | | |
| | | <select id="selectPurchaseReportVoPage" resultType="com.ruoyi.purchase.vo.PurchaseReportVo"> |
| | | select sl.sales_contract_no customerContractNo, |
| | | c.customer_name, |
| | | sl.project_name, |
| | | sl.contract_amount contractAmount, |
| | | pl.contract_amount purchaseAmount, |
| | | sl.contract_amount-pl.contract_amount balance, |
| | | (sl.contract_amount-pl.contract_amount)/sl.contract_amount balanceRatio |
| | | from sales_ledger sl |
| | | left join purchase_ledger pl on sl.id = pl.sales_ledger_id |
| | | left join customer c on sl.customer_id = c.id |
| | | where 1=1 |
| | | <if test="customerName != null and customerName != '' "> |
| | | and c.customer_name like concat('%',#{customerName},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |