diff --git a/coolstore-partner-dao/src/main/java/com/cool/store/dao/ShopStageRemarkInfoDAO.java b/coolstore-partner-dao/src/main/java/com/cool/store/dao/ShopStageRemarkInfoDAO.java index ca80061a3..b92e8cec4 100644 --- a/coolstore-partner-dao/src/main/java/com/cool/store/dao/ShopStageRemarkInfoDAO.java +++ b/coolstore-partner-dao/src/main/java/com/cool/store/dao/ShopStageRemarkInfoDAO.java @@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import tk.mybatis.mapper.entity.Example; +import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -32,7 +33,7 @@ public class ShopStageRemarkInfoDAO { } public ShopStageRemarkInfoDO getByShopIdAndStage(Long shopId, Integer shopSubStageStatus) { if (Objects.isNull(shopId) || Objects.isNull(shopSubStageStatus)){ - return null; + return new ShopStageRemarkInfoDO(); } Example example = new Example(ShopStageRemarkInfoDO.class); example.createCriteria().andEqualTo("shopId", shopId).andEqualTo("shopSubStageStatus", shopSubStageStatus); @@ -44,7 +45,7 @@ public class ShopStageRemarkInfoDAO { } public ShopStageRemarkInfoDO getByLineIdAndStage(Long lineId, Integer workflowSubStageStatus) { if (Objects.isNull(lineId) || Objects.isNull(workflowSubStageStatus)){ - return null; + return new ShopStageRemarkInfoDO(); } Example example = new Example(ShopStageRemarkInfoDO.class); example.createCriteria().andEqualTo("lineId", lineId).andEqualTo("workflowSubStageStatus", workflowSubStageStatus); @@ -57,19 +58,27 @@ public class ShopStageRemarkInfoDAO { public List getByShopIdsAndStage(List shopIds, List shopSubStageStatusList) { if (CollectionUtils.isEmpty(shopIds) || CollectionUtils.isEmpty(shopSubStageStatusList)){ - return null; + return new ArrayList<>(); } Example example = new Example(ShopStageRemarkInfoDO.class); example.createCriteria().andIn("shopId", shopIds).andIn("shopSubStageStatus", shopSubStageStatusList); - return shopStageRemarkInfoMapper.selectByExample(example); + List result = shopStageRemarkInfoMapper.selectByExample(example); + if (CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } + return result ; } public List getByLineIdsAndStage(List lineIds, List workflowSubStageStatusList) { if (CollectionUtils.isEmpty(lineIds) || CollectionUtils.isEmpty(workflowSubStageStatusList)){ - return null; + return new ArrayList<>(); } Example example = new Example(ShopStageRemarkInfoDO.class); example.createCriteria().andIn("lineId", lineIds).andIn("workflowSubStageStatus", workflowSubStageStatusList); - return shopStageRemarkInfoMapper.selectByExample(example); + List result = shopStageRemarkInfoMapper.selectByExample(example); + if (CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } + return result ; } }