| | |
| | | */ |
| | | private BigDecimal thickness; |
| | | |
| | | private Long topParentProductId; |
| | | } |
| | |
| | | * 厚度 |
| | | */ |
| | | private BigDecimal thickness; |
| | | |
| | | private Long topParentProductId; |
| | | } |
| | |
| | | <if test="params.productName != null and params.productName != ''"> |
| | | and p.product_name like concat('%',#{params.productName},'%') |
| | | </if> |
| | | <if test="params.topParentProductId != null and params.topParentProductId > 0"> |
| | | and p.id in ( |
| | | WITH RECURSIVE product_tree AS ( |
| | | SELECT id FROM product WHERE id = #{params.topParentProductId} |
| | | UNION ALL |
| | | SELECT p2.id FROM product p2 INNER JOIN product_tree pt ON p2.parent_id = pt.id |
| | | ) |
| | | SELECT id FROM product_tree |
| | | ) |
| | | </if> |
| | | <if test="params.salesContractNo != null and params.salesContractNo != ''"> |
| | | and ( |
| | | (sir.record_type IN ('6', '7', '18', '19', '20') and pl.purchase_contract_number like concat('%',#{params.salesContractNo},'%')) |
| | |
| | | <if test="params.productName != null and params.productName != ''"> |
| | | and p.product_name like concat('%',#{params.productName},'%') |
| | | </if> |
| | | <if test="params.topParentProductId != null and params.topParentProductId > 0"> |
| | | and p.id in ( |
| | | WITH RECURSIVE product_tree AS ( |
| | | SELECT id FROM product WHERE id = #{params.topParentProductId} |
| | | UNION ALL |
| | | SELECT p2.id FROM product p2 INNER JOIN product_tree pt ON p2.parent_id = pt.id |
| | | ) |
| | | SELECT id FROM product_tree |
| | | ) |
| | | </if> |
| | | <if test="params.salesContractNo != null and params.salesContractNo != ''"> |
| | | and ( |
| | | (sir.record_type IN ('6', '7', '18', '19', '20') and pl.purchase_contract_number like concat('%',#{params.salesContractNo},'%')) |
| | |
| | | <if test="params.productName != null and params.productName != ''"> |
| | | and p.product_name like concat('%',#{params.productName},'%') |
| | | </if> |
| | | <if test="params.topParentProductId != null and params.topParentProductId > 0"> |
| | | and p.id in ( |
| | | WITH RECURSIVE product_tree AS ( |
| | | SELECT id FROM product WHERE id = #{params.topParentProductId} |
| | | UNION ALL |
| | | SELECT p2.id FROM product p2 INNER JOIN product_tree pt ON p2.parent_id = pt.id |
| | | ) |
| | | SELECT id FROM product_tree |
| | | ) |
| | | </if> |
| | | <if test="params.salesContractNo != null and params.salesContractNo != ''"> |
| | | and ( |
| | | (sor.record_type IN ('9', '16', '12') and pl.purchase_contract_number like concat('%',#{params.salesContractNo},'%')) |
| | |
| | | <if test="params.productName != null and params.productName != ''"> |
| | | and p.product_name like concat('%',#{params.productName},'%') |
| | | </if> |
| | | <if test="params.topParentProductId != null and params.topParentProductId > 0"> |
| | | and p.id in ( |
| | | WITH RECURSIVE product_tree AS ( |
| | | SELECT id FROM product WHERE id = #{params.topParentProductId} |
| | | UNION ALL |
| | | SELECT p2.id FROM product p2 INNER JOIN product_tree pt ON p2.parent_id = pt.id |
| | | ) |
| | | SELECT id FROM product_tree |
| | | ) |
| | | </if> |
| | | <if test="params.salesContractNo != null and params.salesContractNo != ''"> |
| | | and ( |
| | | (sor.record_type IN ('9', '16', '12') and pl.purchase_contract_number like concat('%',#{params.salesContractNo},'%')) |