Commit 1f6e5ee9 authored by maoying's avatar maoying

解决冲突

parents 5eb576ec a2e8b014
...@@ -63,6 +63,11 @@ public class Equipment extends BasicEntity { ...@@ -63,6 +63,11 @@ public class Equipment extends BasicEntity {
@Column(name="drain_duration") @Column(name="drain_duration")
private String drainDuration; private String drainDuration;
/**
* 分类
*/
@Column(name="category")
private String category;
public String getFireTruckRoute() { public String getFireTruckRoute() {
return fireTruckRoute; return fireTruckRoute;
......
...@@ -92,6 +92,8 @@ public class ContingencyPlanController extends BaseController { ...@@ -92,6 +92,8 @@ public class ContingencyPlanController extends BaseController {
@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,
@RequestParam(value = "category", required = false) String category,
@RequestParam(value = "planRuleNo", required = false) String planRuleNo) { @RequestParam(value = "planRuleNo", required = false) String planRuleNo) {
if (current < 1 || size < 1) { if (current < 1 || size < 1) {
throw new YeeException("分页参数有误"); throw new YeeException("分页参数有误");
...@@ -99,7 +101,7 @@ public class ContingencyPlanController extends BaseController { ...@@ -99,7 +101,7 @@ public class ContingencyPlanController extends BaseController {
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, planRuleNo)); return CommonResponseUtil2.success(contingencyPlanService.pageFilter(page, planName, classifyId, planRange, editOrgName, implementationTimeLeft, implementationTimeRight, equipmentId, category, planRuleNo));
} }
/** /**
......
...@@ -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, @Param("category") String category);
/** /**
* 筛选预案获得分页记录 * 筛选预案获得分页记录
* @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, @Param("category") String category);
List<String> getRuleIdByEquipment(@Param("id") Long id); List<String> getRuleIdByEquipment(@Param("id") Long id);
......
...@@ -40,6 +40,7 @@ import org.springframework.transaction.support.TransactionSynchronization; ...@@ -40,6 +40,7 @@ import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager; import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.component.emq.EmqxListener; import org.typroject.tyboot.component.emq.EmqxListener;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
...@@ -761,8 +762,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService { ...@@ -761,8 +762,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, String equipmentId, String category, String planRuleNo) {
implementationTimeRight, String planRuleNo) {
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);
...@@ -771,7 +771,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService { ...@@ -771,7 +771,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, category);
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) {
...@@ -781,7 +781,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService { ...@@ -781,7 +781,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, category);
// 查询并插入绑定数据的信息 // 查询并插入绑定数据的信息
fillBindingInfo(planList, planRuleNo); fillBindingInfo(planList, planRuleNo);
page.setRecords(planList); page.setRecords(planList);
......
...@@ -7,6 +7,7 @@ import com.yeejoin.amos.fas.dao.entity.PlanOperationRecord; ...@@ -7,6 +7,7 @@ import com.yeejoin.amos.fas.dao.entity.PlanOperationRecord;
import com.yeejoin.amos.fas.exception.YeeException; import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.feign.privilege.model.RoleModel; import com.yeejoin.amos.feign.privilege.model.RoleModel;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
...@@ -98,7 +99,7 @@ public interface IContingencyPlanService { ...@@ -98,7 +99,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, String planRuleNo); Page<PlanDetailVo> pageFilter(Page page, String planName, Long classifyId, List<String> planRange, String editOrgName, Date implementationTimeLeft, Date implementationTimeRight, String equipmentId, String category, String planRuleNo);
/** /**
* 查询预案使用的文档ID * 查询预案使用的文档ID
......
...@@ -1125,4 +1125,29 @@ ...@@ -1125,4 +1125,29 @@
ADD COLUMN `plan_rule_no` varchar(5) NULL DEFAULT 1 COMMENT '预案规则执行号默认1执行第一个预案,自动化可执行2第二个'; ADD COLUMN `plan_rule_no` varchar(5) NULL DEFAULT 1 COMMENT '预案规则执行号默认1执行第一个预案,自动化可执行2第二个';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="keyong" id="1723705299-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="f_equipment" columnName="drain_duration" />
</not>
</preConditions>
<comment>修改f_equipment表结构</comment>
<sql>
ALTER TABLE `f_equipment` ADD COLUMN `drain_duration` double DEFAULT NULL COMMENT '排空时长(分钟)';
</sql>
</changeSet>
<changeSet author="zs" id="20240903-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="f_equipment" columnName="category" />
</not>
</preConditions>
<comment>修改f_equipment表结构</comment>
<sql>
ALTER TABLE `f_equipment` ADD COLUMN `category` varchar(255) DEFAULT NULL COMMENT '分类';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -21,32 +21,40 @@ ...@@ -21,32 +21,40 @@
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
left join f_equipment c on c.id = cpe.fire_equipment_id
<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 test="category != null and category != ''">
AND c.category = #{category}
</if> </if>
AND is_delete = 0 AND cpd.is_delete = 0
</where> </where>
</select> </select>
...@@ -55,22 +63,30 @@ ...@@ -55,22 +63,30 @@
cpd.id AS id, cpd.id AS id,
cpd.id AS zid, cpd.id AS zid,
cpd.create_date createDate cpd.create_date createDate
, plan_name planName , cpd.plan_name planName
, code , cpd.code
, classify_id classifyId , cpd.classify_id classifyId
, plan_range planRange , cpd.plan_range planRange
, edit_org_name editOrgName , cpd.edit_org_name editOrgName
, edition , cpd.edition
, implementation_time implementationTime , cpd.implementation_time implementationTime
, cpd.remark , cpd.remark
<<<<<<< HEAD
, status , status
, sec_status , sec_status
, creator , creator
, reviser , reviser
, update_time updateTime , update_time updateTime
, org_code orgCode , org_code orgCode
=======
, cpd.status
, cpd.creator
, cpd.reviser
, cpd.update_time updateTime
, cpd.org_code orgCode
>>>>>>> a2e8b014fb000a9d8d31d5aeef64cdccbc0c46b3
, cpd.is_delete isDelete , cpd.is_delete isDelete
, input_time inputTime , cpd.input_time inputTime
, (SELECT classify_name FROM c_plan_classify_tree cpct WHERE id = cpd.classify_id) classifyName , (SELECT classify_name FROM c_plan_classify_tree cpct WHERE id = cpd.classify_id) classifyName
, (SELECT count(1) FROM c_plan_operation_record cpor WHERE plan_id = cpd.id) executionTimes , (SELECT count(1) FROM c_plan_operation_record cpor WHERE plan_id = cpd.id) executionTimes
,fpp.picture ,fpp.picture
...@@ -78,6 +94,7 @@ ...@@ -78,6 +94,7 @@
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 left join c_plan_equipment as cpe on cpd.id = cpe.plan_id and cpe.is_delete = 0
left join f_preplan_picture as fpp on fpp.equipment_id = cpe.fire_equipment_id and fpp.`type` =5 left join f_preplan_picture as fpp on fpp.equipment_id = cpe.fire_equipment_id and fpp.`type` =5
left join f_equipment c on c.id = cpe.fire_equipment_id
<where> <where>
<if test="planName != null and planName.length > 0"> <if test="planName != null and planName.length > 0">
AND cpd.plan_name LIKE concat('%', #{planName}, '%') AND cpd.plan_name LIKE concat('%', #{planName}, '%')
...@@ -103,6 +120,12 @@ ...@@ -103,6 +120,12 @@
<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>
<if test="category != null and category != ''">
AND c.category = #{category}
</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