Commit 76ac4874 authored by 吴俊凯's avatar 吴俊凯

预案执行记录分页查询

parent 494b5d5a
......@@ -33,12 +33,12 @@ public class ContingencyPlanController extends BaseController {
}
@ApiOperation(value = "预案启动记录分页列表")
@RequestMapping(value = "/recordList", method = RequestMethod.POST)
@RequestMapping(value = "/recordList", method = RequestMethod.GET)
public ResponseModel recordList(
@ApiParam(value = "预案名称") @RequestParam(required = false) String planName,
@RequestParam int pageNumber,
@RequestParam int pageSize) {
Page page = contingencyPlanService.recordListByPage(planName,pageNumber,pageSize);
@RequestParam int current,
@RequestParam int pageSize,
@ApiParam(value = "预案名称") @RequestParam(required = false) String planName) {
Page page = contingencyPlanService.recordListByPage(current,pageSize,planName);
return CommonResponseUtil2.success(page);
}
}
......@@ -13,7 +13,6 @@ import com.yeejoin.amos.fas.core.enums.NumberEnum;
import com.yeejoin.amos.fas.core.enums.ReserveEnum;
import com.yeejoin.amos.fas.dao.entity.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import java.util.*;
......@@ -34,10 +33,8 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
private IRiskSourceService riskSourceService;
@Autowired
private IPlanOperationRecordDao planOperationRecordDao;
@Qualifier("IEquipmentFireEquipmentDao")
@Autowired
private IEquipmentFireEquipmentDao equipmentFireEquipmentDao;
@Qualifier("iEquipmentDao")
@Autowired
private IEquipmentDao equipmentDao;
@Autowired
......@@ -108,10 +105,10 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
}
@Override
public Page recordListByPage(String planName, int pageNumber, int pageSize) {
public Page recordListByPage(int current, int pageSize,String planName) {
Map<String,Object> params = new HashMap<>();
params.put("planName",planName);
params.put("pageNumber",pageNumber);
params.put("offset",(current-1)*pageSize);
params.put("pageSize",pageSize);
List<HashMap<String,Object>> result = planOperationRecordMapper.PlanOperationRecordListByPage(params);
Integer count = planOperationRecordMapper.PlanOperationRecordListByCount(params);
......@@ -119,7 +116,7 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
page.setRecords(result);
page.setTotal(count);
page.setSize(pageSize);
page.setPages(pageNumber);
page.setCurrent(current);
return page;
}
......
......@@ -14,5 +14,5 @@ public interface ContingencyPlanService {
ContingencyPlanParamVo equipmentScene(Long equipmentId);
Page recordListByPage (String planName, int pageNumber, int pageSize);
Page recordListByPage (int current, int pageSize,String planName);
}
......@@ -17,18 +17,12 @@
<where>
<if test="planName !=null and planName != ''"> ( detail.plan_name like concat(concat("%",#{planName}),"%"))</if>
</where>
limit #{pageNumber} * #{pageSize},
limit #{offset},#{pageSize}
</select>
<select id="PlanOperationRecordListByCount" parameterType="hashmap" resultType="java.lang.Integer">
SELECT
record.batch_No AS batchNo,
detail.plan_name AS planName,
original.fire_Equipment_Name AS fireEquipmentName,
record.start_time AS startTime,
TIMESTAMPDIFF(second,record.start_time,record.end_time) as executionTime,
record.plan_pattern as planPattern,
'' AS executionType
COUNT(*)
FROM
`c_plan_operation_record` record
LEFT JOIN c_plan_detail detail ON detail.id = record.plan_id
......@@ -36,6 +30,5 @@
<where>
<if test="planName !=null and planName != ''"> ( detail.plan_name like concat(concat("%",#{planName}),"%"))</if>
</where>
limit #{pageNumber} * #{pageSize},
</select>
</mapper>
\ No newline at end of file
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