|
@@ -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, "存在多条映射关系,请删除重复映射");
|