package com.ruoyi.production.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.production.dto.ProductStructureDto; import com.ruoyi.production.mapper.ProductStructureMapper; import com.ruoyi.production.pojo.ProductStructure; import com.ruoyi.production.service.ProductStructureService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service @RequiredArgsConstructor @Slf4j public class ProductStructureServiceImpl extends ServiceImpl implements ProductStructureService { @Autowired private ProductStructureMapper productStructureMapper; @Override public List listByproductModelId(Long productModelId) { return productStructureMapper.listByproductModelId( productModelId); } @Override public Boolean addProductStructureDto(ProductStructureDto productStructureDto) { this.remove(new QueryWrapper().lambda().eq(ProductStructure::getProductModelId, productStructureDto.getProductModelId())); return this.saveBatch(productStructureDto.getProductStructureList()); } }