Commit 64277d6b authored by chenhao's avatar chenhao

修改分页查询时顶级父节点查所有的列表

parent 55893207
......@@ -29,7 +29,7 @@ public interface FireStationMapper extends BaseMapper<FireStation> {
+ "<if test='par.bizCompanyCode!=null'> and a.biz_company_code like CONCAT('',#{par.bizCompanyCode},'%') </if>"
+ "<if test='par.address!=null'> and a.address like CONCAT('',#{par.address},'%') </if>"
+ "<if test='par.bizOrgCode != null'> and a.biz_org_code like CONCAT(#{par.bizOrgCode},'%') </if>"
+"<if test='nodeIds != null' > AND where_building_id` in <foreach collection='nodeIds' item='buildingId' open='(' close=')' separator=','> #{buildingId} </foreach></if>"
+"<if test='nodeIds != null' > AND where_building_id in <foreach collection='nodeIds' item='buildingId' open='(' close=')' separator=','> #{buildingId} </foreach></if>"
+" order by a.rec_date desc limit #{pageNum},#{pageSize}"
+ "</script>")
List<FireStationDto>getFireStation(@Param("pageNum")int pageNum,@Param("pageSize")int pageSize,@Param("par")FireStationDto par,List<String> nodeIds);
......@@ -40,7 +40,7 @@ public interface FireStationMapper extends BaseMapper<FireStation> {
+ "<if test='par.bizCompanyCode!=null'> and cb_fire_station.biz_company_code like CONCAT('',#{par.bizCompanyCode},'%') </if>"
+ "<if test='par.address!=null'> and cb_fire_station.address like CONCAT('',#{par.address},'%') </if>"
+ "<if test='par.bizOrgCode != null'> and biz_org_code like CONCAT(#{par.bizOrgCode},'%') </if>"
+"<if test='nodeIds != null' > AND where_building_id` in <foreach collection='nodeIds' item='buildingId' open='(' close=')' separator=','> #{buildingId} </foreach></if>"
+"<if test='nodeIds != null' > AND where_building_id in <foreach collection='nodeIds' item='buildingId' open='(' close=')' separator=','> #{buildingId} </foreach></if>"
+ "</script>")
Map<String, Long> getFireStationCount(@Param("par")FireStationDto par,List<String> nodeIds);
......
......@@ -81,8 +81,12 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
@Override
public Page<FireStationDto> getFirefighters(int pageNum, int pageSize, FireStationDto par) {
List<FireStationDto> list = fireStationMapper.getFireStation((pageNum - 1) * pageSize, pageSize, par,getNodeAllnodeIds(par.getWhereBuildingId()));
Map<String, Long> num = fireStationMapper.getFireStationCount(par,getNodeAllnodeIds(par.getWhereBuildingId()));
List<String> ids=null;
if(!"-1".equals(par.getWhereBuildingId())) {
ids= getNodeAllnodeIds(par.getWhereBuildingId());
}
List<FireStationDto> list = fireStationMapper.getFireStation((pageNum - 1) * pageSize, pageSize, par,ids);
Map<String, Long> num = fireStationMapper.getFireStationCount(par,ids);
Page<FireStationDto> pageBean = new Page<>(pageNum, pageSize, num.get("num"));
return pageBean.setRecords(list);
}
......
......@@ -87,7 +87,10 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
*/
public IPage<KeySiteDto> getPageList(Page<KeySiteDto> page, String name, Long buildingId, String fireEnduranceRate,
String useNature, String fireFacilitiesInfo, String bizOrgCode) {
List<Long> ids =getNodeAllnodeIds(buildingId);
List<Long> ids =null;
if(buildingId.intValue()!= -1) {
ids =getNodeAllnodeIds(buildingId);
}
return keySiteMapper.getPageList(page, name, ids, fireEnduranceRate, useNature, fireFacilitiesInfo,
bizOrgCode);
}
......
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