| | |
| | | AND T1.type = #{salesLedgerProduct.type} |
| | | </if> |
| | | </where> |
| | | ORDER BY T1.register_date DESC |
| | | ORDER BY T1.register_date ASC,T1.id ASC |
| | | </select> |
| | | |
| | | <select id="selectSalesLedgerProductByMainId" resultType="com.ruoyi.sales.pojo.SalesLedgerProduct"> |
| | |
| | | resultType="com.ruoyi.purchase.dto.ProcurementBusinessSummaryStatisticsDto"> |
| | | SELECT |
| | | COALESCE(SUM(slp.tax_inclusive_total_price), 0) AS purchaseTotalAmount, |
| | | COALESCE(COUNT(DISTINCT slp.product_category), 0) AS productCategoryCount, |
| | | COALESCE(COUNT(DISTINCT slp.product_model_id), 0) AS productCategoryCount, |
| | | COALESCE(SUM(rop.allocated_return_amount), 0) AS returnTotalAmount |
| | | FROM sales_ledger_product slp |
| | | LEFT JOIN purchase_ledger sl ON slp.sales_ledger_id = sl.id |