| | |
| | | <if test="req.status != null and req.status "> |
| | | AND slp.pending_tickets_total > 0 |
| | | </if> |
| | | <if test="req.supplierNameOrContractNo != null and req.supplierNameOrContractNo != ''"> |
| | | AND (sl.supplier_name like concat('%',#{req.supplierNameOrContractNo},'%') or sl.purchase_contract_number like concat('%',#{req.supplierNameOrContractNo},'%')) |
| | | </if> |
| | | </where> |
| | | order by slp.register_date desc |
| | | </select> |
| | |
| | | FROM product_tree); |
| | | |
| | | </select> |
| | | |
| | | <select id="selectSalesLedgerProductTotals" resultType="com.ruoyi.sales.dto.SalesLedgerProductTotalsDto"> |
| | | SELECT |
| | | slp.sales_ledger_id AS salesLedgerId, |
| | | COALESCE(SUM(slp.quantity), 0) AS totalQuantity, |
| | | COALESCE(SUM(COALESCE(slp.settle_total_area, slp.actual_total_area, 0)), 0) AS totalArea |
| | | FROM sales_ledger_product slp |
| | | WHERE slp.sales_ledger_id IN |
| | | <foreach collection="salesLedgerIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | <if test="type != null"> |
| | | AND slp.type = #{type} |
| | | </if> |
| | | GROUP BY slp.sales_ledger_id |
| | | </select> |
| | | </mapper> |