package com.yuanchu.mom.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.yuanchu.mom.mapper.TechnicalModelMapper; import com.yuanchu.mom.pojo.TechnicalModel; import com.yuanchu.mom.pojo.dto.TechnicalModelDto; import com.yuanchu.mom.service.TechnicalModelService; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; import java.util.Map; /** * 技术指标维护表(TechnicalModel)表服务实现类 * * @author zss * @since 2023-08-28 16:09:19 */ @Service public class TechnicalModelServiceImpl extends ServiceImpl implements TechnicalModelService { @Resource TechnicalModelMapper technicalModelMapper; //查询技术指标维护列表-->左边二级展示工序和工艺 @Override public List> selectAllTechTem(Integer type, String message) { return technicalModelMapper.selectAllTechTem(type, message); } //查询技术指标维护列表-->右边展示该工艺下的检验项目 @Override public List> selectAllTechNam(Integer id) { return technicalModelMapper.selectAllTechNam(id); } //新增技术指标维护-->选择工序和工艺 @Override public List> chooseTechFath(Integer type) { return technicalModelMapper.chooseTechFath(type); } //新增技术指标维护-->选择项目父类 @Override public List chooseProFath(Integer id) { return technicalModelMapper.chooseProFath(id); } //新增技术指标维护 @Override public void addTechMode(TechnicalModelDto technicalModelDto) { TechnicalModel technicalModel = TechnicalModel.builder() .techTemId(technicalModelDto.getTechTemId()) .father(technicalModelDto.getFather()) .name(technicalModelDto.getName()) .unit(technicalModelDto.getUnit()) .build(); technicalModelMapper.insert(technicalModel); } //根据id查询详情 @Override public List> selecTechById(Integer id) { return technicalModelMapper.selecTechById(id); } //编辑 @Override public void writeTechById(Integer id,TechnicalModelDto technicalModelDto) { TechnicalModel technicalModel = new TechnicalModel(); BeanUtils.copyProperties(technicalModelDto, technicalModel); technicalModel.setId(id); technicalModelMapper.updateById(technicalModel); } //删除 @Override public void delTechById(Integer id) { TechnicalModel technicalModel = new TechnicalModel(); technicalModel.setState(0); technicalModel.setId(id); technicalModelMapper.updateById(technicalModel); } //批量删除 @Override public void delAllTech(String ids) { technicalModelMapper.delAllTech(ids); } }