From a9015e429e40f83afdffd43552d34b82e67a75ff Mon Sep 17 00:00:00 2001 From: JYW <2013732181@qq.com> Date: 星期一, 29 四月 2024 17:34:10 +0800 Subject: [PATCH] 2024-04-29 自定义注解,给每个接口加上自定义注解 --- inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodListServiceImpl.java | 43 ++++++++++++++++++++++++++++++++++++------- 1 files changed, 36 insertions(+), 7 deletions(-) diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodListServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodListServiceImpl.java index a4f517f..69f8145 100644 --- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodListServiceImpl.java +++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodListServiceImpl.java @@ -2,11 +2,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yuanchu.mom.mapper.StandardMethodListMapper; import com.yuanchu.mom.mapper.StandardProductListMapper; import com.yuanchu.mom.pojo.StandardMethodList; import com.yuanchu.mom.pojo.StandardProductList; import com.yuanchu.mom.service.StandardMethodListService; -import com.yuanchu.mom.mapper.StandardMethodListMapper; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -77,23 +77,46 @@ @Override public Map<String, List<?>> selectsStandardMethodByFLSSM(String tree) { String[] trees = tree.split(" - "); + Map<String, List<?>> map = new HashMap<>(); + String str = ""; + List<StandardMethodList> standardMethodLists = new ArrayList<>(); + switch (trees.length){ + case 5: + str += "\"" + trees[2] + "\",\"" + trees[3] + "\",\"" + trees[4] + "\""; + break; + case 4: + str += "\"" + trees[2] + "\",\"" + trees[3] + "\""; + break; + case 3: + str += "\"" + trees[2] + "\""; + break; + default: + map.put("standardMethodList", null); + return map; + } + map.put("standardMethodList", standardMethodListMapper.selectStandardMethodLists(str)); + return map; + } + + @Override + public Map<String, List<?>> selectsStandardMethodByFLSSM2(String tree) { + String[] trees = tree.split(" - "); List<StandardMethodList> standardMethodLists = null; switch (trees.length){ case 5: - standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],trees[2],trees[3],trees[4]); -// standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getFactory, trees[0]).eq(StandardProductList::getLaboratory, trees[1]).eq(StandardProductList::getSampleType, trees[2]).eq(StandardProductList::getSample, trees[3]).eq(StandardProductList::getModel, trees[4])); + standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],trees[2],trees[3],trees[4]); break; case 4: - standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],trees[2],trees[3],null); + standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],trees[2],trees[3],null); break; case 3: - standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],trees[2],null,null); + standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],trees[2],null,null); break; case 2: - standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],null,null,null); + standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],null,null,null); break; case 1: - standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],null,null,null,null); + standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],null,null,null,null); break; } Map<String, List<?>> map = new HashMap<>(); @@ -107,6 +130,12 @@ standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id)); return standardMethodListMapper.deleteById(id); } + + @Override + public List<StandardMethodList> selectStandardMethodEnum() { + return standardMethodListMapper.selectList(Wrappers.<StandardMethodList>lambdaQuery().select(StandardMethodList::getId,StandardMethodList::getCode,StandardMethodList::getName)); + } + } -- Gitblit v1.9.3