| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="selectSalesLedgerProductByMainId" resultType="com.ruoyi.sales.pojo.SalesLedgerProduct"> |
| | | select slp.* |
| | | from quality_inspect qi |
| | | left join production_product_main ppm on qi.product_main_id = ppm.id |
| | | left join product_work_order pwo on ppm.work_order_id = pwo.id |
| | | left join product_order po on pwo.product_order_id = po.id |
| | | left join sales_ledger_product slp on po.product_model_id = slp.id |
| | | where qi.product_main_id = #{productMainId} |
| | | |
| | | |
| | | </select> |
| | | <select id="listPage" resultType="com.ruoyi.sales.dto.SalesLedgerProductDto"> |
| | | select slp.*, |
| | | sl.project_name, |
| | | sl.customer_name, |
| | | sl.sales_contract_no, |
| | | sl.customer_contract_no |
| | | from sales_ledger_product slp |
| | | left join sales_ledger sl on slp.sales_ledger_id = sl.id |
| | | <where> |
| | | slp.type = 1 |
| | | <if test="req.salesContractNo != null and req.salesContractNo != '' "> |
| | | AND sl.sales_contract_no like concat('%',#{req.salesContractNo},'%') |
| | | </if> |
| | | <if test="req.customerContractNo != null and req.customerContractNo != '' "> |
| | | AND sl.customer_contract_no like concat('%',#{req.customerContractNo},'%') |
| | | </if> |
| | | <if test="req.projectName != null and req.projectName != '' "> |
| | | AND sl.project_name like concat('%',#{req.projectName},'%') |
| | | </if> |
| | | <if test="req.customerName != null and req.customerName != '' "> |
| | | AND sl.customer_name like concat('%',#{req.customerName},'%') |
| | | </if> |
| | | <if test="req.productCategory != null and req.productCategory != '' "> |
| | | AND slp.product_category like concat('%',#{req.productCategory},'%') |
| | | </if> |
| | | <if test="req.status != null and req.status "> |
| | | AND slp.pending_invoice_total > 0 |
| | | </if> |
| | | </where> |
| | | order by slp.register_date desc |
| | | </select> |
| | | <select id="listPagePurchaseLedger" resultType="com.ruoyi.sales.dto.SalesLedgerProductDto"> |
| | | select slp.*, |
| | | sl.project_name, |
| | | sl.customer_name, |
| | | sl.sales_contract_no, |
| | | sl.customer_contract_no |
| | | from sales_ledger_product slp |
| | | left join purchase_ledger sl on slp.sales_ledger_id = sl.id |
| | | <where> |
| | | slp.type = 2 |
| | | <if test="req.purchaseContractNumber != null and req.purchaseContractNumber != '' "> |
| | | AND sl.purchase_contract_number like concat('%',#{req.purchaseContractNumber},'%') |
| | | </if> |
| | | <if test="req.customerContractNo != null and req.customerContractNo != '' "> |
| | | AND sl.customer_contract_no like concat('%',#{req.customerContractNo},'%') |
| | | </if> |
| | | <if test="req.projectName != null and req.projectName != '' "> |
| | | AND sl.project_name like concat('%',#{req.projectName},'%') |
| | | </if> |
| | | <if test="req.customerName != null and req.customerName != '' "> |
| | | AND sl.customer_name like concat('%',#{req.customerName},'%') |
| | | </if> |
| | | <if test="req.productCategory != null and req.productCategory != '' "> |
| | | AND slp.product_category like concat('%',#{req.productCategory},'%') |
| | | </if> |
| | | <if test="req.status != null and req.status "> |
| | | AND slp.pending_invoice_total > 0 |
| | | </if> |
| | | </where> |
| | | order by slp.register_date desc |
| | | </select> |
| | | </mapper> |