Commit ada880eb authored by lisong's avatar lisong

添加预案信息相关接口

parent 12a60975
...@@ -22,7 +22,7 @@ public interface ContingencyInstanceInfoMapper extends BaseMapper<ContingencyIns ...@@ -22,7 +22,7 @@ public interface ContingencyInstanceInfoMapper extends BaseMapper<ContingencyIns
List<ContingencyInstanceInfo> selectDisposalListPage(@Param("current") int current, @Param("size") int size, @Param("orgCode") String orgCode); List<ContingencyInstanceInfo> selectDisposalListPage(@Param("current") int current, @Param("size") int size, @Param("orgCode") String orgCode);
List<ContingencyPlanInstance> selectDisposalActionPage(@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);
} }
...@@ -86,8 +86,4 @@ public interface IContingencyPlanInstanceRepository extends BaseDao<ContingencyP ...@@ -86,8 +86,4 @@ public interface IContingencyPlanInstanceRepository extends BaseDao<ContingencyP
List<ContingencyPlanInstance> findByBatchNo(String batchNo); List<ContingencyPlanInstance> findByBatchNo(String batchNo);
@Query(value = "SELECT * FROM `contingency_plan_instance`" +
" WHERE if(:?1 is not null or :?1 != '', record_type= ?1) " + " if(:?2 is not null or :?2 != '', and runstate = ?2) ", nativeQuery = true)
List<ContingencyPlanInstance> selectDisposalActionPage(String type, int status);
} }
...@@ -508,7 +508,7 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -508,7 +508,7 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
page.setCurrent(1); page.setCurrent(1);
start = 0; start = 0;
} }
List<ContingencyPlanInstance> list = contingencyInstanceInfoMapper.selectDisposalActionPage(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);
} }
......
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
where is_delete = 0 and org_code = #{orgCode} where is_delete = 0 and org_code = #{orgCode}
</select> </select>
<select id="selectDisposalActionPage" resultType="com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance"> <select id="selectDisposalActionPage" resultType="com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance">
select * from contingency_plan_instance <where> select * from contingency_plan_instance
<where>
<if test="batchNo != null and batchNo != ''"> <if test="batchNo != null and batchNo != ''">
batch_no = #{batchNo} batch_no = #{batchNo}
</if> </if>
...@@ -44,9 +45,7 @@ ...@@ -44,9 +45,7 @@
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and runstate = #{status} and runstate = #{status}
</if> </if>
<if test="list != null and list.size() >0"> <if test="list != null and list.size() >0">
<foreach collection="list" item="role" index="index" open="and (" close=") " separator="or"> <foreach collection="list" item="role" index="index" open="and (" close=") " separator="or">
...@@ -54,10 +53,11 @@ ...@@ -54,10 +53,11 @@
</foreach> </foreach>
</if> </if>
</where> </where>
LIMIT #{current}, #{size}
</select> </select>
<select id="selectCountDisposalActionPage" resultType="java.lang.Integer"> <select id="selectCountDisposalActionPage" resultType="java.lang.Integer">
select count(1) from contingency_plan_instance <where> select count(1) from contingency_plan_instance
<where>
<if test="batchNo != null and batchNo != ''"> <if test="batchNo != null and batchNo != ''">
batch_no = #{batchNo} batch_no = #{batchNo}
</if> </if>
...@@ -66,9 +66,7 @@ ...@@ -66,9 +66,7 @@
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and runstate = #{status} and runstate = #{status}
</if> </if>
<if test="list != null and list.size() >0"> <if test="list != null and list.size() >0">
<foreach collection="list" item="role" index="index" open="and (" close=") " separator="or"> <foreach collection="list" item="role" index="index" open="and (" close=") " separator="or">
......
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