1. 更新防护对象和模板的查询,添加更多筛选条件
This commit is contained in:
@@ -51,8 +51,35 @@
|
||||
protect_object_port, protect_object_url, protect_object_protocol, protect_object_audit_status
|
||||
FROM t_protect_object
|
||||
<where>
|
||||
<if test="proobj_name != null">protect_object_name LIKE CONCAT('%', #{proobj_name}, '%')</if>
|
||||
<if test="proobj_id != null">protect_object_id = #{proobj_id}</if>
|
||||
<if test="proobj_name != null">AND protect_object_name LIKE CONCAT('%', #{proobj_name}, '%')</if>
|
||||
<if test="proobj_id != null">AND protect_object_id = #{proobj_id}</if>
|
||||
<if test="proobj_system_name != null">
|
||||
AND protect_object_system_name LIKE CONCAT('%', #{proobj_system_name}, '%')
|
||||
</if>
|
||||
<if test="proobj_ip != null">
|
||||
AND protect_object_id IN (
|
||||
SELECT protect_object_id FROM t_protect_object_inet_addr_view tpo_view
|
||||
WHERE tpo_view.protect_object_ip LIKE CONCAT('%', #{proobj_ip}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="proobj_port_min != null">
|
||||
AND protect_object_port > #{proobj_port_min}
|
||||
</if>
|
||||
<if test="proobj_port_max != null">
|
||||
AND protect_object_port < #{proobj_port_max}
|
||||
</if>
|
||||
<if test="proobj_url != null">
|
||||
AND protect_object_url LIKE CONCAT('%', #{proobj_url}, '%')
|
||||
</if>
|
||||
<if test="proobj_protocol != null">
|
||||
AND protect_object_protocol = #{proobj_protocol}
|
||||
</if>
|
||||
<if test="proobj_username != null">
|
||||
AND protect_object_create_username = #{proobj_username}
|
||||
</if>
|
||||
<if test="proobj_audit_status != null">
|
||||
AND protect_object_audit_status = #{proobj_audit_status}
|
||||
</if>
|
||||
</where>
|
||||
LIMIT ${(page-1) * page_size}, #{page_size}
|
||||
</select>
|
||||
@@ -69,11 +96,39 @@
|
||||
FROM t_protect_object
|
||||
WHERE protect_object_id = #{proobj_id}
|
||||
</select>
|
||||
|
||||
<select id="queryProtectObjectsTotalNum" resultType="java.lang.Integer">
|
||||
SELECT COUNT(protect_object_id) FROM t_protect_object
|
||||
<where>
|
||||
<if test="proobj_name != null">protect_object_name LIKE CONCAT('%', #{proobj_name}, '%')</if>
|
||||
<if test="proobj_id != null">protect_object_id = #{proobj_id}</if>
|
||||
<if test="proobj_name != null">AND protect_object_name LIKE CONCAT('%', #{proobj_name}, '%')</if>
|
||||
<if test="proobj_id != null">AND protect_object_id = #{proobj_id}</if>
|
||||
<if test="proobj_system_name != null">
|
||||
AND protect_object_system_name LIKE CONCAT('%', #{proobj_system_name}, '%')
|
||||
</if>
|
||||
<if test="proobj_ip != null">
|
||||
AND protect_object_id IN (
|
||||
SELECT protect_object_id FROM t_protect_object_inet_addr_view tpo_view
|
||||
WHERE tpo_view.protect_object_ip LIKE CONCAT('%', #{proobj_ip}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="proobj_port_min != null">
|
||||
AND protect_object_port >= #{proobj_port_min}
|
||||
</if>
|
||||
<if test="proobj_port_max != null">
|
||||
AND protect_object_port <= #{proobj_port_max}
|
||||
</if>
|
||||
<if test="proobj_url != null">
|
||||
AND protect_object_url LIKE CONCAT('%', #{proobj_url}, '%')
|
||||
</if>
|
||||
<if test="proobj_protocol != null">
|
||||
AND protect_object_protocol = #{proobj_protocol}
|
||||
</if>
|
||||
<if test="proobj_username != null">
|
||||
AND protect_object_create_username = #{proobj_username}
|
||||
</if>
|
||||
<if test="proobj_audit_status != null">
|
||||
AND protect_object_audit_status = #{proobj_audit_status}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user