| | |
| | | * @since 2026/03/11 16:35 |
| | | */ |
| | | public interface ProductMaterialMapper extends BaseMapper<ProductMaterial> { |
| | | |
| | | String selectProductModelIdByName(Long productModelId); |
| | | |
| | | } |
| | |
| | | void deleteProductMaterial(List<Long> ids); |
| | | |
| | | List<ProductMaterialGroupDto> productMaterialListByQuery(String materialName, Integer materialTypeId); |
| | | |
| | | String selectProductModelIdByName(Long productId); |
| | | |
| | | } |
| | |
| | | log.info("删除物料成功 ids={}", ids); |
| | | } |
| | | |
| | | @Override |
| | | public String selectProductModelIdByName(Long productId) { |
| | | return baseMapper.selectProductModelIdByName(productId); |
| | | } |
| | | |
| | | private void validateProductMaterial(ProductMaterial productMaterial, boolean requireId) { |
| | | if (productMaterial == null) { |
| | | throw new ServiceException("参数不能为空"); |
| | |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectProductModelIdByName" resultType="java.lang.String" parameterType="java.lang.Long"> |
| | | select pm.product_name |
| | | from product_material pm |
| | | left join product_material_sku pms on pms.product_id = pm.id |
| | | <where> |
| | | <choose> |
| | | <when test="productModelId != null"> |
| | | pms.id = #{productModelId} |
| | | </when> |
| | | <otherwise> |
| | | 1 = 0 |
| | | </otherwise> |
| | | </choose> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |