Commit 9dcc48d3 by zhangkb

修改分页查询不进行实体转换

parent b2749988
...@@ -92,12 +92,12 @@ public class IndScorecardService { ...@@ -92,12 +92,12 @@ public class IndScorecardService {
public List<IndScorecard> getAll(){ public List<IndScorecard> getAll(){
List<IndScorecard> scorecards = indScorecardMapper.selectAll(); List<IndScorecard> scorecards = indScorecardMapper.selectAll();
List<IndScorecard> result = new ArrayList<>(); // List<IndScorecard> result = new ArrayList<>();
for(IndScorecard scorecard : scorecards) { // for(IndScorecard scorecard : scorecards) {
IndScorecard scorecard1 = this.changeJson(scorecard); // IndScorecard scorecard1 = this.changeJson(scorecard);
result.add(scorecard1); // result.add(scorecard1);
} // }
return result; return scorecards;
} }
public IndScorecard findById(Integer id) { public IndScorecard findById(Integer id) {
...@@ -110,12 +110,12 @@ public class IndScorecardService { ...@@ -110,12 +110,12 @@ public class IndScorecardService {
public List<IndScorecard> findByIdList(List<Integer> ids) throws Exception{ public List<IndScorecard> findByIdList(List<Integer> ids) throws Exception{
List<IndScorecard> scorecards = indScorecardMapper.findByIdList(ids); List<IndScorecard> scorecards = indScorecardMapper.findByIdList(ids);
List<IndScorecard> result = new ArrayList<>(); // List<IndScorecard> result = new ArrayList<>();
for(IndScorecard scorecard : scorecards) { // for(IndScorecard scorecard : scorecards) {
IndScorecard scorecard1 = this.changeJson(scorecard); // IndScorecard scorecard1 = this.changeJson(scorecard);
result.add(scorecard1); // result.add(scorecard1);
} // }
return result; return scorecards;
} }
public Map<String,Object> getByCatalogId(Integer catalogId,int page,int rows){ public Map<String,Object> getByCatalogId(Integer catalogId,int page,int rows){
...@@ -125,13 +125,13 @@ public class IndScorecardService { ...@@ -125,13 +125,13 @@ public class IndScorecardService {
int start = (page-1)*rows; int start = (page-1)*rows;
count = indScorecardMapper.countByCatalogId(catalogId); count = indScorecardMapper.countByCatalogId(catalogId);
List<IndScorecard> datas = indScorecardMapper.findByCatalogId(catalogId,start,rows); List<IndScorecard> datas = indScorecardMapper.findByCatalogId(catalogId,start,rows);
List<IndScorecard> resultDatas = new ArrayList<>(); // List<IndScorecard> resultDatas = new ArrayList<>();
for(IndScorecard data : datas) { // for(IndScorecard data : datas) {
IndScorecard data1 = this.changeJson(data); // IndScorecard data1 = this.changeJson(data);
resultDatas.add(data1); // resultDatas.add(data1);
} // }
result.put("count", count); result.put("count", count);
result.put("data", resultDatas); result.put("data", datas);
return result; return result;
} }
......
...@@ -77,13 +77,13 @@ public class ScoreRuleService { ...@@ -77,13 +77,13 @@ public class ScoreRuleService {
int start = (page-1)*rows; int start = (page-1)*rows;
count = scoreRuleMapper.countByCatalogId(catalogId); count = scoreRuleMapper.countByCatalogId(catalogId);
List<ScoreRule> datas = scoreRuleMapper.findByCatalogId(catalogId, start, rows); List<ScoreRule> datas = scoreRuleMapper.findByCatalogId(catalogId, start, rows);
List<ScoreRule> resultDatas = new ArrayList<>(); // List<ScoreRule> resultDatas = new ArrayList<>();
for(ScoreRule data : datas) { // for(ScoreRule data : datas) {
ScoreRule data1 = this.changeJson(data); // ScoreRule data1 = this.changeJson(data);
resultDatas.add(data1); // resultDatas.add(data1);
} // }
result.put("count", count); result.put("count", count);
result.put("data", resultDatas); result.put("data", datas);
return result; return result;
} }
......
...@@ -69,13 +69,13 @@ public class ShortboardRuleService { ...@@ -69,13 +69,13 @@ public class ShortboardRuleService {
int start = (page-1)*rows; int start = (page-1)*rows;
count = shortboardRuleMapper.countByCatalogId(catalogId); count = shortboardRuleMapper.countByCatalogId(catalogId);
List<ShortboardRule> datas = shortboardRuleMapper.findByCatalogId(catalogId, start, rows); List<ShortboardRule> datas = shortboardRuleMapper.findByCatalogId(catalogId, start, rows);
List<ShortboardRule> resultDatas = new ArrayList<>(); // List<ShortboardRule> resultDatas = new ArrayList<>();
for(ShortboardRule data : datas) { // for(ShortboardRule data : datas) {
ShortboardRule data1 = this.changeJson(data); // ShortboardRule data1 = this.changeJson(data);
resultDatas.add(data1); // resultDatas.add(data1);
} // }
result.put("count", count); result.put("count", count);
result.put("data", resultDatas); result.put("data", datas);
return result; return result;
} }
......
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