Commit b2dd9ac7 by zhiwj

代码结构调整

parent c8fb17c7
......@@ -9,6 +9,7 @@ import com.gic.store.entity.TabClerk;
import com.gic.store.service.ClerkService;
import com.gic.store.service.StoreService;
import org.apache.commons.lang3.StringUtils;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -101,8 +102,11 @@ public class ClerkServiceImpl implements ClerkService {
@Override
public List<TabClerk> listClerkByStoreInfoId(Integer enterpriseId, List<Integer> storeInfoIdList, String search) {
// list 如果太大, 让 mybatis 解析 会打满内存
String storeInfoIds = storeInfoIdList.stream().map(Object::toString).collect(Collectors.joining(","));
return tabClerkMapper.listClerkByStoreInfoId(enterpriseId, null, "(" + storeInfoIds + ")", search, null, 1);
String storeInfoIds = null;
if (CollectionUtils.isNotEmpty(storeInfoIdList)) {
storeInfoIds = "(" + storeInfoIdList.stream().map(Object::toString).collect(Collectors.joining(",")) + ")";
}
return tabClerkMapper.listClerkByStoreInfoId(enterpriseId, null, storeInfoIds, search, null, 1);
}
@Override
......@@ -112,8 +116,12 @@ public class ClerkServiceImpl implements ClerkService {
@Override
public List<TabClerk> listClerkByStoreInfoId(Integer enterpriseId, List<Integer> storeInfoIdList, String search, Integer clerkType) {
String storeInfoIds = storeInfoIdList.stream().map(Object::toString).collect(Collectors.joining(","));
return tabClerkMapper.listClerkByStoreInfoId(enterpriseId, null, "(" + storeInfoIds + ")", search, clerkType, null);
// list 如果太大, 让 mybatis 解析 会打满内存
String storeInfoIds = null;
if (CollectionUtils.isNotEmpty(storeInfoIdList)) {
storeInfoIds = "(" + storeInfoIdList.stream().map(Object::toString).collect(Collectors.joining(",")) + ")";
}
return tabClerkMapper.listClerkByStoreInfoId(enterpriseId, null, storeInfoIds, search, clerkType, null);
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment