1、TaskCommandIndo删去了depart,使用taskCreateDepart,修改mapper也同步使用taskCreateDepart

2、新增静态规则批量审核功能,post请求body为id和auditStatus的Map,入库使用sqlSessionWrapper,test已通过
3、动态任务接收alertmessage,查询DynamicTaskInfos生成command时,新增关联t_strategy_template表,select查询新增查询局点dynamic_rule_range、事件类型strategy_template_name字段
This commit is contained in:
PushM
2024-04-17 22:04:29 +08:00
parent de6437b8b0
commit c6334cee56
12 changed files with 101 additions and 9 deletions

View File

@@ -20,6 +20,10 @@
<result column="task_end_time" property="endTime"/>
<result column="template_id" property="templateId"/>
<result column="dynamic_rule_range" property="distributePoint"/>
<result column="strategy_template_name" property="eventType"/>
<result column="dynamic_rule_protect_level" property="protectLevel"/>
<result column="task_status" property="taskStatus"/>
</resultMap>
@@ -149,12 +153,17 @@
t_task.task_end_time,
t_dr.template_id,
t_dr.dynamic_rule_range,
t_dr.dynamic_rule_protect_level,
t_task.task_status
t_task.task_status,
t_tmplate.strategy_template_name
from t_task
left join realtime_protection.t_dynamic_rule t_dr on
(t_task.task_id = t_dr.dynamic_rule_used_task_id and t_dr.dynamic_rule_id = #{dynamicRuleId})
left join realtime_protection.t_strategy_template t_tmplate on
( t_dr.template_id = t_tmplate.strategy_template_id )
where
t_task.task_id = #{taskId}
</select>

View File

@@ -9,7 +9,7 @@
MASK_SRC_IP, MASK_SRC_PORT, MASK_DST_IP, MASK_DST_PORT, MASK_PROTOCOL, VALID_TIME,
INVALID_TIME, IS_VALID, IS_JUDGED,
SEND_TIMES, SUCCESS_TIMES, CREATE_TIME, LAST_UPDATE, IS_DELETED)
values (#{info.UUID}, #{info.taskId}, #{info.taskAct}, #{info.taskName}, #{info.eventType}, #{info.department}, #{info.distributePoint},
values (#{info.UUID}, #{info.taskId}, #{info.taskAct}, #{info.taskName}, #{info.eventType}, #{info.taskCreateDepart}, #{info.distributePoint},
#{info.frequency},
DEFAULT,
#{info.fiveTupleWithMask.sourceIP}, #{info.fiveTupleWithMask.sourcePort},

View File

@@ -84,6 +84,20 @@
set static_rule_audit_status = #{auditStatus}
where static_rule_id = #{id}
</update>
<update id="updateAuditStatusByIdBatch">
update t_static_rule
set static_rule_audit_status = CASE static_rule_id
<foreach collection="idWithAuditStatusBatch" index="id" item="auditStatus" separator=" ">
WHEN #{id} THEN #{auditStatus}
</foreach>
ELSE static_rule_audit_status
END
WHERE static_rule_id IN
<foreach collection="idWithAuditStatusBatch" index="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<delete id="deleteStaticRules">
delete from t_static_rule
where static_rule_id in

View File

@@ -161,7 +161,7 @@
<result column="static_rule_id" property="ruleId"/>
<result column="task_act" property="taskAct"/>
<result column="task_create_depart" property="department"/>
<result column="task_create_depart" property="taskCreateDepart"/>
<result column="static_rule_range" property="distributePoint"/>
<result column="task_type" property="taskType"/>
<result column="static_rule_frequency" property="frequency"/>