Commit d034e375 authored by KeYong's avatar KeYong

更新

parent 740b18f0
......@@ -42,4 +42,6 @@ public interface ContingencyPlanInstanceMapper extends BaseMapper<ContingencyPla
List<Map<String, Object>> getWaterInfo(@Param("current") Integer current, @Param("size") Integer size, @Param("bizOrgCode") String bizOrgCode);
long countWater(@Param("bizOrgCode") String bizOrgCode);
Integer getPlanInstanceCountByCondition(@Param("category") String category, @Param("recordType") String recordType, @Param("batchNo") String batchNo);
}
......@@ -157,7 +157,11 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
int count = repository.countByBatchNo(instanceNo);
planInstance.setSort(++count);
ContingencyPlanInstance contingencyPlanInstance = contingencyInstance.updateExtendColumn(planInstance);
ContingencyPlanInstance instance = this.repository.save(contingencyPlanInstance);
Integer num = contingencyPlanInstanceMapper.getPlanInstanceCountByCondition(contingencyPlanInstance.getCategory(), contingencyPlanInstance.getRecordType(), contingencyPlanInstance.getBatchNo());
ContingencyPlanInstance instance = new ContingencyPlanInstance();
if (0 == num) {
instance = this.repository.save(contingencyPlanInstance);
}
// 异步数据同步之消息发送
// contingencyPlanInstanceDataSync(instance);
return instance;
......
......@@ -389,4 +389,10 @@
levelStatus DESC,sequence_nbr DESC
) b
</select>
<select id="getPlanInstanceCountByCondition" resultType="java.lang.Integer">
select count(1) from
contingency_plan_instance
where category = #{category} AND record_type = #{recordType} AND batch_no = #{batchNo} AND is_delete = 0
</select>
</mapper>
\ No newline at end of file
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