¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.mapper.StandardTemplateMapper; |
| | | import com.ruoyi.basic.pojo.StandardTemplate; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.basic.service.StandardTemplateService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_template(æ 忍¡æ¿)ãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2024-03-11 13:47:52 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class StandardTemplateServiceImpl extends ServiceImpl<StandardTemplateMapper, StandardTemplate> |
| | | implements StandardTemplateService{ |
| | | |
| | | private StandardTemplateMapper standardTemplateMapper; |
| | | |
| | | @Override |
| | | public IPage<StandardTemplate> selectStandardTemplatePageList(Page page, StandardTemplate standardTemplate) { |
| | | return standardTemplateMapper.selectStandardTemplatePageList(page, QueryWrappers.queryWrappers(standardTemplate)); |
| | | } |
| | | |
| | | @Override |
| | | public int addStandardTemplate(StandardTemplate standardTemplate) { |
| | | return standardTemplateMapper.insert(standardTemplate); |
| | | } |
| | | |
| | | @Override |
| | | public int upStandardTemplate(StandardTemplate standardTemplate) { |
| | | if(standardTemplate.getThing().equals("")){ |
| | | standardTemplate.setThing(null); |
| | | } |
| | | return standardTemplateMapper.updateById(standardTemplate); |
| | | } |
| | | |
| | | @Override |
| | | public int delStandardTemplate(Integer id) { |
| | | return standardTemplateMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<StandardTemplate> getStandardTemplate() { |
| | | return standardTemplateMapper.selectList(Wrappers.<StandardTemplate>lambdaQuery().select(StandardTemplate::getId,StandardTemplate::getName)); |
| | | } |
| | | |
| | | @Override |
| | | public String getStandTempThingById(Integer templateId) { |
| | | StandardTemplate standardTemplate = standardTemplateMapper.selectById(templateId); |
| | | if(standardTemplate==null){ |
| | | return null; |
| | | }else{ |
| | | return standardTemplate.getThing(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public String getStandTempNameById(Integer templateId) { |
| | | StandardTemplate standardTemplate = standardTemplateMapper.selectById(templateId); |
| | | if(standardTemplate==null){ |
| | | return null; |
| | | }else{ |
| | | return standardTemplate.getName(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public StandardTemplate getStandTempIdByName(String name) { |
| | | return standardTemplateMapper.getStandTempIdByName(name); |
| | | } |
| | | } |