| | |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectSkuWithMaterialPage" resultType="com.ruoyi.production.dto.ProductMaterialSkuDto"> |
| | | SELECT |
| | | sku.id AS skuId, |
| | | sku.material_id AS materialId, |
| | | sku.material_code AS materialCode, |
| | | sku.specification AS specification, |
| | | sku.supply_type AS supplyType, |
| | | m.material_name AS materialName, |
| | | m.base_unit AS baseUnit |
| | | FROM product_material_sku sku |
| | | LEFT JOIN product_material m ON sku.material_id = m.id |
| | | <where> |
| | | <if test="dto.materialId != null"> |
| | | AND sku.material_id = #{dto.materialId} |
| | | </if> |
| | | <if test="dto.specification != null and dto.specification != ''"> |
| | | AND sku.specification LIKE CONCAT('%', #{dto.specification}, '%') |
| | | </if> |
| | | <if test="dto.materialCode != null and dto.materialCode != ''"> |
| | | AND sku.material_code LIKE CONCAT('%', #{dto.materialCode}, '%') |
| | | </if> |
| | | |
| | | <if test="type != null and type == 1 and dto.materialName != null and dto.materialName != ''"> |
| | | AND m.material_name LIKE CONCAT('%', #{dto.materialName}, '%') |
| | | </if> |
| | | </where> |
| | | ORDER BY sku.id ASC |
| | | </select> |
| | | |
| | | </mapper> |