| | |
| | | <if test="params.productName != null and params.productName != ''"> |
| | | and p.product_name like concat('%',#{params.productName},'%') |
| | | </if> |
| | | <if test="params.model != null and params.model != ''"> |
| | | and pm.model like concat('%',#{params.model},'%') |
| | | </if> |
| | | <if test="params.batchNo != null and params.batchNo != ''"> |
| | | and sir.batch_no like concat('%',#{params.batchNo},'%') |
| | | </if> |
| | | <if test="params.type != null and params.type != ''"> |
| | | and sir.type = #{params.type} |
| | | </if> |
| | |
| | | LEFT JOIN purchase_ledger pl |
| | | ON pl.id = IF(sir.record_type = 7, sir.record_id, qi.purchase_ledger_id) |
| | | -- 产品关联不动 |
| | | LEFT JOIN sales_ledger_product slp ON pl.id = slp.product_id |
| | | LEFT JOIN sales_ledger_product slp ON pl.id = slp.sales_ledger_id |
| | | LEFT JOIN product_model pm ON sir.product_model_id = pm.id |
| | | LEFT JOIN product p ON pm.product_id = p.id |
| | | -- 条件 |
| | |
| | | <if test="req.inboundBatches != null and req.inboundBatches != ''"> |
| | | AND sir.inbound_batches LIKE CONCAT('%',#{req.inboundBatches},'%') |
| | | </if> |
| | | <if test="req.supplierId != null"> |
| | | AND pl.supplier_id = #{req.supplierId} |
| | | </if> |
| | | <if test="req.supplierName != null and req.supplierName != ''"> |
| | | AND pl.supplier_name LIKE CONCAT('%',#{req.supplierName},'%') |
| | | </if> |