Commit 7f656595 authored by 钱坤's avatar 钱坤

相似基金查询废弃分页查询,直接用topN

parent a9b18f31
...@@ -1724,11 +1724,12 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1724,11 +1724,12 @@ public class ProductServiceImpl implements ProductService, Constant {
//查询同类基金 //查询同类基金
FundInfo fundInfo = fundInfoMapper.selectByPrimaryKey(fundId); FundInfo fundInfo = fundInfoMapper.selectByPrimaryKey(fundId);
PageMethod.startPage(1, 10); // 使用分页查询会先count再limit查询,浪费资源,这里取top 10即可,所以直接limit 10好了
// PageMethod.startPage(1, 10);
FundCountExample example = new FundCountExample(); FundCountExample example = new FundCountExample();
example.createCriteria().andSubstrategyEqualTo(fundInfo.getSubstrategy()).andIdNotEqualTo(fundId) example.createCriteria().andSubstrategyEqualTo(fundInfo.getSubstrategy()).andIdNotEqualTo(fundId)
.andDataSourcesEqualTo(Constant.ONE_NUM).andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init); .andDataSourcesEqualTo(Constant.ONE_NUM).andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init);
example.setOrderByClause("ret_1y desc"); example.setOrderByClause("ret_1y desc limit 10");
List<FundCount> fundCounts = fundCountMapper.selectByExample(example); List<FundCount> fundCounts = fundCountMapper.selectByExample(example);
......
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