| | |
| | | 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.sale_ledger_product_id = slp.id and slp.type = 1 |
| | | left join sales_ledger_product slp on po.sales_ledger_product_id = slp.id and slp.type = 1 |
| | | where qi.product_main_id = #{productMainId} |
| | | |
| | | |
| | |
| | | <if test="req.productCategory != null and req.productCategory != ''"> |
| | | AND slp.product_category = #{req.productCategory} |
| | | </if> |
| | | <!-- 按产品大类分组聚合 --> |
| | | GROUP BY slp.product_category |
| | | <!-- 按产品大类排序 --> |
| | | GROUP BY slp.product_category, slp.specification_model, sl.supplier_name |
| | | ORDER BY slp.product_category |
| | | </select> |
| | | <select id="selectProductBomStructure" resultType="com.ruoyi.sales.dto.LossProductModelDto"> |