Commit 26e3f637 by zhangkb

修改分页获取指标计分规则接口

parent 58bbef08
...@@ -15,7 +15,7 @@ public interface IndScorecardMapper extends BaseMapper<IndScorecard>{ ...@@ -15,7 +15,7 @@ public interface IndScorecardMapper extends BaseMapper<IndScorecard>{
public List<IndScorecard> findByCatalogId(@Param("catalogId")Integer catalogId, public List<IndScorecard> findByCatalogId(@Param("catalogId")Integer catalogId,
@Param("keyword")String keyword,@Param("start") int start,@Param("end") int end); @Param("keyword")String keyword,@Param("start") int start,@Param("end") int end);
public int countByCatalogId(@Param("catalogId")Integer catalogId); public int countByCatalogId(@Param("catalogId")Integer catalogId,@Param("keyword")String keyword);
public List<IndScorecard> findByIdList(@Param("ids")List<Integer> ids); public List<IndScorecard> findByIdList(@Param("ids")List<Integer> ids);
} }
...@@ -120,13 +120,13 @@ public class IndScorecardService { ...@@ -120,13 +120,13 @@ public class IndScorecardService {
public Map<String,Object> getByCatalogId(Integer catalogId,String keyword,int page,int rows){ public Map<String,Object> getByCatalogId(Integer catalogId,String keyword,int page,int rows){
Map<String,Object> result = new HashMap<>(); Map<String,Object> result = new HashMap<>();
int count = 0;
//计算start
int start = page*rows;
count = indScorecardMapper.countByCatalogId(catalogId);
if(StringUtils.isNotBlank(keyword)) { if(StringUtils.isNotBlank(keyword)) {
keyword = "%"+keyword+"%"; keyword = "%"+keyword+"%";
} }
int count = 0;
//计算start
int start = page*rows;
count = indScorecardMapper.countByCatalogId(catalogId,keyword);
List<IndScorecard> datas = indScorecardMapper.findByCatalogId(catalogId,keyword,start,rows); List<IndScorecard> datas = indScorecardMapper.findByCatalogId(catalogId,keyword,start,rows);
// List<IndScorecard> resultDatas = new ArrayList<>(); // List<IndScorecard> resultDatas = new ArrayList<>();
// for(IndScorecard data : datas) { // for(IndScorecard data : datas) {
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
select count(1) select count(1)
from drive_ind_score_card from drive_ind_score_card
where catalog_id = #{catalogId} where catalog_id = #{catalogId}
<if test="keyword!=null">
and card_name like #{keyword}
</if>
</select> </select>
<delete id="deleteByCatalogIdIn" parameterType="java.util.List"> <delete id="deleteByCatalogIdIn" parameterType="java.util.List">
......
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