Commit 19a3f8e7 authored by lisong's avatar lisong

添加预案信息相关接口

parent ada880eb
...@@ -25,4 +25,7 @@ public interface ContingencyInstanceInfoMapper extends BaseMapper<ContingencyIns ...@@ -25,4 +25,7 @@ public interface ContingencyInstanceInfoMapper extends BaseMapper<ContingencyIns
List<ContingencyPlanInstance> selectDisposalActionPage(@Param("current") int current, @Param("size") int size,@Param("type") String type, @Param("status") String status,@Param("list") List<String> roles ,@Param("batchNo") String batchNo); List<ContingencyPlanInstance> selectDisposalActionPage(@Param("current") int current, @Param("size") int size,@Param("type") String type, @Param("status") String status,@Param("list") List<String> roles ,@Param("batchNo") String batchNo);
int selectCountDisposalActionPage(@Param("type") String type, @Param("status") String status,@Param("list") List<String> roles ,@Param("batchNo") String batchNo); int selectCountDisposalActionPage(@Param("type") String type, @Param("status") String status,@Param("list") List<String> roles ,@Param("batchNo") String batchNo);
List<ContingencyPlanInstance> selectDisposalActionList(@Param("type") String type, @Param("status") String status,@Param("list") List<String> roles ,@Param("batchNo") String batchNo);
} }
...@@ -471,8 +471,6 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -471,8 +471,6 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Override @Override
public Page<ContingencyPlanInstance> selectDisposalActionPage(int current, int size, String disposalId, List<RoleModel> roleModelList, int dataType) { public Page<ContingencyPlanInstance> selectDisposalActionPage(int current, int size, String disposalId, List<RoleModel> roleModelList, int dataType) {
List<String> roles = new ArrayList<>(); List<String> roles = new ArrayList<>();
String type = "OPERATE"; String type = "OPERATE";
String status = ""; String status = "";
Page<ContingencyPlanInstance> page = new Page<>(current, size); Page<ContingencyPlanInstance> page = new Page<>(current, size);
...@@ -494,9 +492,9 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -494,9 +492,9 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
// } // }
int total = 0; int total = 0;
if (ObjectUtils.isEmpty(status)){ if (ObjectUtils.isEmpty(status)) {
total = contingencyInstanceInfoMapper.selectCountDisposalActionPage(type, null, roles, disposalId); total = contingencyInstanceInfoMapper.selectCountDisposalActionPage(type, null, roles, disposalId);
}else { } else {
total = contingencyInstanceInfoMapper.selectCountDisposalActionPage(type, status, roles, disposalId); total = contingencyInstanceInfoMapper.selectCountDisposalActionPage(type, status, roles, disposalId);
} }
...@@ -508,11 +506,36 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -508,11 +506,36 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
page.setCurrent(1); page.setCurrent(1);
start = 0; start = 0;
} }
List<ContingencyPlanInstance> list = contingencyInstanceInfoMapper.selectDisposalActionPage((int)start, size, type, status, roles, disposalId); List<ContingencyPlanInstance> list = contingencyInstanceInfoMapper.selectDisposalActionPage((int) start, size, type, status, roles, disposalId);
page.setRecords(list); page.setRecords(list);
page.setTotal(total); page.setTotal(total);
} }
return page; return page;
} }
@Override
public List<ContingencyPlanInstance> selectDisposalActionList(int current, int size, String disposalId, List<RoleModel> roleModelList, int dataType) {
List<String> roles = new ArrayList<>();
String type = "OPERATE";
String status = "";
Page<ContingencyPlanInstance> page = new Page<>(current, size);
if ("1".equals(String.valueOf(dataType))) {
for (RoleModel roleModel : roleModelList) {
roles.add(roleModel.getRoleName());
}
// 根据当前用户预案角色、未执行动作
status = "1";
} else if ("2".equals(String.valueOf(dataType))) {
// 当前用户预案角色、全部动作数据
for (RoleModel roleModel : roleModelList) {
roles.add(roleModel.getRoleName());
}
}
// else {
// // 当前预案全部动作
//
// }
return contingencyInstanceInfoMapper.selectDisposalActionList(type, status, roles, disposalId);
}
} }
...@@ -101,4 +101,7 @@ public interface IPlanVisual3dService { ...@@ -101,4 +101,7 @@ public interface IPlanVisual3dService {
Page<ContingencyPlanInstance> getPlaneRecordByNew(Integer pageNum, Integer size, String batchNo); Page<ContingencyPlanInstance> getPlaneRecordByNew(Integer pageNum, Integer size, String batchNo);
void replyMessage(AgencyUserModel user, ContingencyPlanInstance dto); void replyMessage(AgencyUserModel user, ContingencyPlanInstance dto);
List<ContingencyPlanInstance> selectDisposalActionList(int current, int size, String disposalId , List<RoleModel> roleModelList, int dataType);
} }
...@@ -76,5 +76,25 @@ ...@@ -76,5 +76,25 @@
</where> </where>
</select> </select>
<select id="selectDisposalActionList" resultType="com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance">
select * from contingency_plan_instance
<where>
<if test="batchNo != null and batchNo != ''">
batch_no = #{batchNo}
</if>
<if test="type != null and type != ''">
and record_type = #{type}
</if>
<if test="status != null and status != ''">
and runstate = #{status}
</if>
<if test="list != null and list.size() >0">
<foreach collection="list" item="role" index="index" open="and (" close=") " separator="or">
role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
</select>
</mapper> </mapper>
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