Browse Source

化验公表项映射

Zhaops 6 years ago
parent
commit
aa1fe4195c

+ 6 - 2
icssman-service/src/main/java/com/diagbot/facade/LisMappingFacade.java

@@ -78,8 +78,12 @@ public class LisMappingFacade extends LisMappingServiceImpl {
 
         QueryWrapper<LisMapping> lisMappingQueryWrapper = new QueryWrapper<>();
         lisMappingQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("meal_name", lisMappingVO.getMealName())
-                .eq("item_name", lisMappingVO.getItemName());
+                .eq("meal_name", lisMappingVO.getMealName());
+        if (StringUtil.isBlank(lisMappingVO.getItemName())) {
+            lisMappingQueryWrapper.and(i -> i.isNull("item_name").or(j -> j.eq("item_name", "")));
+        } else {
+            lisMappingQueryWrapper.eq("item_name", lisMappingVO.getItemName());
+        }
         List<LisMapping> lisMappingList = this.list(lisMappingQueryWrapper);
         if (lisMappingList.size() > 1) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "存在多条映射关系,请删除重复映射");