Commit 8637f028 authored by 周昊's avatar 周昊

1、修改固有风险清单列表接口

parent 447b7a2f
......@@ -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);
}
......
......@@ -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>
......
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