Commit 1dbf52c5 authored by 田涛's avatar 田涛

bug修复

parent 38af93cf
......@@ -192,6 +192,7 @@ public class ContingencyPlanController extends BaseController {
@ApiParam(value = "启动时间右边界") @RequestParam(value = "startTimeRight", required = false) Long startTimeRightStamp,
@ApiParam(value = "执行方式") @RequestParam(value = "executionType", required = false) Integer executionType,
@ApiParam(value = "运行模式") @RequestParam(value = "planPattern", required = false) Integer planPattern,
@ApiParam(value = "预案id") @RequestParam(value = "planId", required = false) Long planId,
@ApiParam(value = "预案名称") @RequestParam(value = "planName", required = false) String planName) {
Date startTimeLeft = startTimeLeftStamp == null ? null : new Date(startTimeLeftStamp);
Date startTimeRight = startTimeRightStamp == null ? null : new Date(startTimeRightStamp);
......@@ -199,7 +200,7 @@ public class ContingencyPlanController extends BaseController {
throw new YeeException("分页参数有误");
}
Page page = new Page(current, pageSize);
return CommonResponseUtil2.success(contingencyPlanService.recordListByPage(page, planName, classifyId, startTimeLeft, startTimeRight, executionType, planPattern));
return CommonResponseUtil2.success(contingencyPlanService.recordListByPage(page, planId, planName, classifyId, startTimeLeft, startTimeRight, executionType, planPattern));
}
@ApiOperation(value = "第一次查看预案记录")
......
......@@ -271,9 +271,10 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
}
@Override
public Page recordListByPage(Page page, String planName, List<Long> classifyId, Date startTimeLeft, Date startTimeRight, Integer executionType, Integer planPattern) {
public Page recordListByPage(Page page, Long planId, String planName, List<Long> classifyId, Date startTimeLeft, Date startTimeRight, Integer executionType, Integer planPattern) {
Map<String, Object> params = new HashMap<>();
params.put("planName", planName);
params.put("planId", planId);
params.put("start", (int) ((page.getCurrent() - 1) * page.getSize()));
params.put("size", (int) page.getSize());
params.put("classifyId", classifyId);
......
......@@ -114,6 +114,6 @@ public interface IContingencyPlanService {
List<HashMap<String,Object>> getRecordList(String batchNo);
Page recordListByPage(Page page, String planName, List<Long> classifyId, Date startTimeLeft, Date startTimeRight, Integer executionType, Integer planPattern);
Page recordListByPage(Page page, Long planId, String planName, List<Long> classifyId, Date startTimeLeft, Date startTimeRight, Integer executionType, Integer planPattern);
}
......@@ -9,6 +9,9 @@
LEFT JOIN c_plan_detail cpd ON
cpor.plan_id = cpd.id
<where>
<if test="planId != null">
AND cpor.plan_id = #{planId}
</if>
<if test="planName != null and planName.length > 0">
AND cpd.plan_name LIKE CONCAT('%', #{planName},'%')
</if>
......@@ -49,12 +52,15 @@
, cpd.plan_name planName
, (SELECT classify_name FROM c_plan_classify_tree cpct WHERE id = cpd.classify_id) classifyName
, cpd.plan_range planRange
, TIMESTAMPDIFF(SECOND, cpor.start_time, ifnull(cpor.end_time, now())) spendTime
, TIMESTAMPDIFF(SECOND, cpor.start_time, cpor.end_time) spendTime
FROM
c_plan_operation_record cpor
LEFT JOIN c_plan_detail cpd ON
cpor.plan_id = cpd.id
<where>
<if test="planId != null">
AND cpor.plan_id = #{planId}
</if>
<if test="planName != null and planName.length > 0">
AND cpd.plan_name LIKE CONCAT('%', #{planName},'%')
</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