Loading censoft-rongtong/src/main/java/com/censoft/censoftrongtong/controller/RiskPlanInherentListController.java +2 −32 Original line number Diff line number Diff line Loading @@ -52,39 +52,9 @@ public class RiskPlanInherentListController extends BaseController @GetMapping("/list") public TableDataInfo list(RiskPlanInherentList riskPlanInherentList) { PageDomain pageDomain = TableSupport.buildPageRequest(); Integer pageNum = pageDomain.getPageNum(); Integer pageSize = pageDomain.getPageSize(); List<String> listBuilds=new ArrayList<>(); List<RiskPlanInherentList> listRs=new ArrayList<>(); if(riskPlanInherentList.getPlanId()!=null){ RiskPlan riskPlan=riskPlanService.selectRiskPlanById(riskPlanInherentList.getPlanId()); listBuilds= Arrays.asList(riskPlan.getBuildingIds().split(",")); } riskPlanInherentList.setPlanId(null);//查询所有 startPage(); List<RiskPlanInherentList> list = riskPlanInherentListService.selectRiskPlanInherentListList(riskPlanInherentList); //筛选任务关联楼栋风险信息 if (listBuilds.size()>0) { for (RiskPlanInherentList planInherentList : list) { if (listBuilds.contains(planInherentList.getBuildingId())) { listRs.add(planInherentList); } } } int num = listRs.size(); listRs = listRs.stream() .skip((pageNum - 1) * pageSize) .limit(pageSize) .collect(Collectors.toList()); TableDataInfo rspData = new TableDataInfo(); rspData.setCode(HttpStatus.SUCCESS); rspData.setRows(listRs); rspData.setTotal(num); return rspData; return getDataTable(list); } Loading censoft-rongtong/src/main/resources/mapper/system/RiskPlanInherentListMapper.xml +2 −1 Original line number Diff line number Diff line Loading @@ -96,10 +96,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN ledger_building lb ON lb.id = lf.building_id LEFT JOIN sys_dict_data sdd ON sdd.dict_label = rpil.LEVEL AND dict_type = 'risk_plan_level' LEFT JOIN risk_plan rp ON FIND_IN_SET( lb.id, rp.building_ids ) <where> <if test="userId != null "> and rpil.user_id = #{userId}</if> <if test="roomId != null "> and rpil.room_id = #{roomId}</if> <if test="planId != null "> and rpil.plan_id = #{planId}</if> <if test="planId != null "> and rp.id = #{planId}</if> <if test="name != null and name != ''"> and rpil.name like concat('%', #{name}, '%')</if> <if test="pointType != null and pointType != ''"> and rpil.point_type = #{pointType}</if> <if test="specialEquipment != null "> and rpil.special_equipment = #{specialEquipment}</if> Loading Loading
censoft-rongtong/src/main/java/com/censoft/censoftrongtong/controller/RiskPlanInherentListController.java +2 −32 Original line number Diff line number Diff line Loading @@ -52,39 +52,9 @@ public class RiskPlanInherentListController extends BaseController @GetMapping("/list") public TableDataInfo list(RiskPlanInherentList riskPlanInherentList) { PageDomain pageDomain = TableSupport.buildPageRequest(); Integer pageNum = pageDomain.getPageNum(); Integer pageSize = pageDomain.getPageSize(); List<String> listBuilds=new ArrayList<>(); List<RiskPlanInherentList> listRs=new ArrayList<>(); if(riskPlanInherentList.getPlanId()!=null){ RiskPlan riskPlan=riskPlanService.selectRiskPlanById(riskPlanInherentList.getPlanId()); listBuilds= Arrays.asList(riskPlan.getBuildingIds().split(",")); } riskPlanInherentList.setPlanId(null);//查询所有 startPage(); List<RiskPlanInherentList> list = riskPlanInherentListService.selectRiskPlanInherentListList(riskPlanInherentList); //筛选任务关联楼栋风险信息 if (listBuilds.size()>0) { for (RiskPlanInherentList planInherentList : list) { if (listBuilds.contains(planInherentList.getBuildingId())) { listRs.add(planInherentList); } } } int num = listRs.size(); listRs = listRs.stream() .skip((pageNum - 1) * pageSize) .limit(pageSize) .collect(Collectors.toList()); TableDataInfo rspData = new TableDataInfo(); rspData.setCode(HttpStatus.SUCCESS); rspData.setRows(listRs); rspData.setTotal(num); return rspData; return getDataTable(list); } Loading
censoft-rongtong/src/main/resources/mapper/system/RiskPlanInherentListMapper.xml +2 −1 Original line number Diff line number Diff line Loading @@ -96,10 +96,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN ledger_building lb ON lb.id = lf.building_id LEFT JOIN sys_dict_data sdd ON sdd.dict_label = rpil.LEVEL AND dict_type = 'risk_plan_level' LEFT JOIN risk_plan rp ON FIND_IN_SET( lb.id, rp.building_ids ) <where> <if test="userId != null "> and rpil.user_id = #{userId}</if> <if test="roomId != null "> and rpil.room_id = #{roomId}</if> <if test="planId != null "> and rpil.plan_id = #{planId}</if> <if test="planId != null "> and rp.id = #{planId}</if> <if test="name != null and name != ''"> and rpil.name like concat('%', #{name}, '%')</if> <if test="pointType != null and pointType != ''"> and rpil.point_type = #{pointType}</if> <if test="specialEquipment != null "> and rpil.special_equipment = #{specialEquipment}</if> Loading