Commit 910e54eb authored by KeYong's avatar KeYong

Merge remote-tracking branch 'origin/develop_dl_4.0' into develop_dl_4.0

parents d3e78a0d eedb8561
...@@ -147,6 +147,12 @@ public class Equipment extends BasicEntity { ...@@ -147,6 +147,12 @@ public class Equipment extends BasicEntity {
@Column(name="reserve_source") @Column(name="reserve_source")
private Integer reserveSource; private Integer reserveSource;
/**
* 排空时长(分钟)
*/
@Column(name="drain_duration")
private Double drainDuration;
public Equipment() { public Equipment() {
} }
......
...@@ -91,14 +91,15 @@ public class ContingencyPlanController extends BaseController { ...@@ -91,14 +91,15 @@ public class ContingencyPlanController extends BaseController {
@RequestParam(value = "editOrgName", required = false) String editOrgName, @RequestParam(value = "editOrgName", required = false) String editOrgName,
@RequestParam(value = "implementationTimeLeft", required = false) Long implementationTimeLeftStamp, @RequestParam(value = "implementationTimeLeft", required = false) Long implementationTimeLeftStamp,
@RequestParam(value = "implementationTimeRight", required = false) Long implementationTimeRightStamp, @RequestParam(value = "implementationTimeRight", required = false) Long implementationTimeRightStamp,
@RequestParam(value = "size") int size) { @RequestParam(value = "size") int size,
@RequestParam(value = "equipmentId", required = false) String equipmentId) {
if (current < 1 || size < 1) { if (current < 1 || size < 1) {
throw new YeeException("分页参数有误"); throw new YeeException("分页参数有误");
} }
Date implementationTimeLeft = implementationTimeLeftStamp == null ? null : new Date(implementationTimeLeftStamp); Date implementationTimeLeft = implementationTimeLeftStamp == null ? null : new Date(implementationTimeLeftStamp);
Date implementationTimeRight = implementationTimeRightStamp == null ? null : new Date(implementationTimeRightStamp); Date implementationTimeRight = implementationTimeRightStamp == null ? null : new Date(implementationTimeRightStamp);
Page page = new Page(current, size); Page page = new Page(current, size);
return CommonResponseUtil2.success(contingencyPlanService.pageFilter(page, planName, classifyId, planRange, editOrgName, implementationTimeLeft, implementationTimeRight)); return CommonResponseUtil2.success(contingencyPlanService.pageFilter(page, planName, classifyId, planRange, editOrgName, implementationTimeLeft, implementationTimeRight, equipmentId));
} }
/** /**
......
...@@ -38,13 +38,13 @@ public interface PlanDetailMapper { ...@@ -38,13 +38,13 @@ public interface PlanDetailMapper {
* 筛选预案获得总数 * 筛选预案获得总数
* @return * @return
*/ */
Integer filterCount(@Param("planName") String planName, @Param("classifyId") List<Long> classifyId, @Param("planRange") List<String> planRange, @Param("editOrgName") String editOrgName, @Param("implementationTimeLeft") Date implementationTimeLeft, @Param("implementationTimeRight") Date implementationTimeRight); Integer filterCount(@Param("planName") String planName, @Param("classifyId") List<Long> classifyId, @Param("planRange") List<String> planRange, @Param("editOrgName") String editOrgName, @Param("implementationTimeLeft") Date implementationTimeLeft, @Param("implementationTimeRight") Date implementationTimeRight, @Param("equipmentId") String equipmentId);
/** /**
* 筛选预案获得分页记录 * 筛选预案获得分页记录
* @return * @return
*/ */
List<PlanDetailVo> filterList(@Param("planName") String planName, @Param("classifyId") List<Long> classifyId, @Param("planRange") List<String> planRange, @Param("editOrgName") String editOrgName, @Param("implementationTimeLeft") Date implementationTimeLeft, @Param("implementationTimeRight") Date implementationTimeRight, @Param("start") int start, @Param("size") int size); List<PlanDetailVo> filterList(@Param("planName") String planName, @Param("classifyId") List<Long> classifyId, @Param("planRange") List<String> planRange, @Param("editOrgName") String editOrgName, @Param("implementationTimeLeft") Date implementationTimeLeft, @Param("implementationTimeRight") Date implementationTimeRight, @Param("start") int start, @Param("size") int size, @Param("equipmentId") String equipmentId);
List<String> getRuleIdByEquipment(@Param("id") Long id); List<String> getRuleIdByEquipment(@Param("id") Long id);
......
...@@ -644,7 +644,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService { ...@@ -644,7 +644,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
@Override @Override
public Page<PlanDetailVo> pageFilter(Page page, String planName, Long public Page<PlanDetailVo> pageFilter(Page page, String planName, Long
classifyId, List<String> planRange, String editOrgName, Date implementationTimeLeft, Date classifyId, List<String> planRange, String editOrgName, Date implementationTimeLeft, Date
implementationTimeRight) { implementationTimeRight, String equipmentId) {
List<Long> classifyIdList = new ArrayList<>(); List<Long> classifyIdList = new ArrayList<>();
if (classifyId != null) { if (classifyId != null) {
Collection<PlanClassifyTreeVo> classifyTreeList = planClassifyTreeService.getAllChildIncludeMe(classifyId); Collection<PlanClassifyTreeVo> classifyTreeList = planClassifyTreeService.getAllChildIncludeMe(classifyId);
...@@ -653,7 +653,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService { ...@@ -653,7 +653,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
allChildren.forEach(e -> classifyIdList.add(e.getId())); allChildren.forEach(e -> classifyIdList.add(e.getId()));
} }
} }
int total = planDetailMapper.filterCount(planName, classifyIdList, planRange, editOrgName, implementationTimeLeft, implementationTimeRight); int total = planDetailMapper.filterCount(planName, classifyIdList, planRange, editOrgName, implementationTimeLeft, implementationTimeRight, equipmentId);
page.setTotal(total); page.setTotal(total);
long start = (page.getCurrent() - 1) * page.getSize(); long start = (page.getCurrent() - 1) * page.getSize();
if (total == 0) { if (total == 0) {
...@@ -663,7 +663,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService { ...@@ -663,7 +663,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
page.setCurrent(1); page.setCurrent(1);
start = 0; start = 0;
} }
List<PlanDetailVo> planList = planDetailMapper.filterList(planName, classifyIdList, planRange, editOrgName, implementationTimeLeft, implementationTimeRight, (int) start, (int) page.getSize()); List<PlanDetailVo> planList = planDetailMapper.filterList(planName, classifyIdList, planRange, editOrgName, implementationTimeLeft, implementationTimeRight, (int) start, (int) page.getSize(), equipmentId);
// 查询并插入绑定数据的信息 // 查询并插入绑定数据的信息
fillBindingInfo(planList); fillBindingInfo(planList);
page.setRecords(planList); page.setRecords(planList);
......
...@@ -96,7 +96,7 @@ public interface IContingencyPlanService { ...@@ -96,7 +96,7 @@ public interface IContingencyPlanService {
* @param implementationTimeRight 实施时间右界限 * @param implementationTimeRight 实施时间右界限
* @return Page * @return Page
*/ */
Page<PlanDetailVo> pageFilter(Page page, String planName, Long classifyId, List<String> planRange, String editOrgName, Date implementationTimeLeft, Date implementationTimeRight); Page<PlanDetailVo> pageFilter(Page page, String planName, Long classifyId, List<String> planRange, String editOrgName, Date implementationTimeLeft, Date implementationTimeRight, String equipmentId);
/** /**
* 查询预案使用的文档ID * 查询预案使用的文档ID
......
...@@ -21,32 +21,36 @@ ...@@ -21,32 +21,36 @@
count(1) count(1)
FROM FROM
c_plan_detail cpd c_plan_detail cpd
left join c_plan_equipment as cpe on cpd.id = cpe.plan_id and cpe.is_delete = 0
<where> <where>
<if test="planName != null and planName.length > 0"> <if test="planName != null and planName.length > 0">
AND plan_name LIKE concat('%', #{planName}, '%') AND cpd.plan_name LIKE concat('%', #{planName}, '%')
</if> </if>
<if test="classifyId != null and classifyId.size > 0"> <if test="classifyId != null and classifyId.size > 0">
AND classify_id IN AND cpd.classify_id IN
<foreach collection="classifyId" separator="," item="cid" open="(" close=")"> <foreach collection="classifyId" separator="," item="cid" open="(" close=")">
#{cid} #{cid}
</foreach> </foreach>
</if> </if>
<if test="planRange != null and planRange.size > 0"> <if test="planRange != null and planRange.size > 0">
AND plan_range IN AND cpd.plan_range IN
<foreach collection="planRange" separator="," item="pr" open="(" close=")"> <foreach collection="planRange" separator="," item="pr" open="(" close=")">
#{pr} #{pr}
</foreach> </foreach>
</if> </if>
<if test="editOrgName != null and editOrgName.length > 0"> <if test="editOrgName != null and editOrgName.length > 0">
AND edit_org_name LIKE concat('%', #{editOrgName}, '%') AND cpd.edit_org_name LIKE concat('%', #{editOrgName}, '%')
</if> </if>
<if test="implementationTimeLeft != null"> <if test="implementationTimeLeft != null">
AND implementation_time <![CDATA[ >= ]]> #{implementationTimeLeft} AND cpd.implementation_time <![CDATA[ >= ]]> #{implementationTimeLeft}
</if> </if>
<if test="implementationTimeRight != null"> <if test="implementationTimeRight != null">
AND implementation_time <![CDATA[ < ]]> #{implementationTimeRight} AND cpd.implementation_time <![CDATA[ < ]]> #{implementationTimeRight}
</if>
<if test="equipmentId != null and equipmentId != ''">
AND cpe.fire_equipment_id = #{equipmentId}
</if> </if>
AND is_delete = 0 AND cpd.is_delete = 0
</where> </where>
</select> </select>
...@@ -102,6 +106,9 @@ ...@@ -102,6 +106,9 @@
<if test="implementationTimeRight != null"> <if test="implementationTimeRight != null">
AND cpd.implementation_time <![CDATA[ < ]]> #{implementationTimeRight} AND cpd.implementation_time <![CDATA[ < ]]> #{implementationTimeRight}
</if> </if>
<if test="equipmentId != null and equipmentId != ''">
AND cpe.fire_equipment_id = #{equipmentId}
</if>
AND cpd.is_delete = 0 AND cpd.is_delete = 0
</where> </where>
ORDER BY cpd.create_date DESC ORDER BY cpd.create_date DESC
......
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