Files
ai-security-xdr/haobang-security-dm/syslog-consumer-rule/target/classes/mapper/AnalysisWhereConditionMapper.xml
T
nanChen a360895292 1、新增功能探针联动处置、心跳在线检测
2、syslog-consumer模块拆分 syslog-consumer-rule模块实现日志数据消费、解析、泛化入库。
2026-05-28 14:30:06 +08:00

59 lines
2.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.common.mapper.AnalysisWhereConditionMapper">
<resultMap id="BaseResultMap" type="com.common.entity.AnalysisWhereCondition">
<id column="cond_id" property="condId" jdbcType="INTEGER"/>
<result column="rule_id" property="ruleId" jdbcType="VARCHAR"/>
<result column="logical_op" property="logicalOp" jdbcType="VARCHAR"/>
<result column="seq_num" property="seqNum" jdbcType="INTEGER"/>
<result column="parent_cond_id" property="parentCondId" jdbcType="INTEGER"/>
<result column="create_dept" property="createDept" jdbcType="BIGINT"/>
<result column="del_flag" property="delFlag" jdbcType="CHAR"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="create_by" property="createBy" jdbcType="BIGINT"/>
<result column="update_by" property="updateBy" jdbcType="BIGINT"/>
<result column="remark" property="remark" jdbcType="VARCHAR"/>
<result column="tenant_id" property="tenantId" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
cond_id, rule_id, logical_op, seq_num, parent_cond_id,
create_dept, del_flag, create_time, update_time,
create_by, update_by, remark, tenant_id
</sql>
<!-- 根据规则ID查询WHERE条件 -->
<select id="selectByRuleId" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM analysis_where_condition
WHERE rule_id = #{ruleId}::uuid
AND del_flag = '0'
ORDER BY seq_num ASC
</select>
<!-- 查询根节点条件(无父节点) -->
<select id="selectRootConditions" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM analysis_where_condition
WHERE rule_id = #{ruleId}::uuid
AND (parent_cond_id IS NULL OR parent_cond_id = 0)
AND del_flag = '0'
ORDER BY seq_num ASC
</select>
<!-- 查询指定条件的子条件 -->
<select id="selectChildConditions" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM analysis_where_condition
WHERE parent_cond_id = #{parentCondId}
AND del_flag = '0'
ORDER BY seq_num ASC
</select>
</mapper>