This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
enderbyendera-realtime-prot…/src/main/resources/mappers/TemplateMapper.xml
松岳 陈 06886de328 1. 增加jackson配置,缩减json数据长度
2. ExceptionHandler添加SaTokenException检查,用于校验登陆
3. ResponseResult添加invalid和unauthorized静态方法
4. Task模块添加单查询,多查询,更新路由
5. Template添加两个JsonProperty
6. Template模块添加query路由
7.
2024-01-03 22:53:02 +08:00

39 lines
2.0 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.realtime.protection.server.defense.template.TemplateMapper">
<insert id="newTemplate" useGeneratedKeys="true" keyProperty="templateId">
INSERT INTO t_strategy_template(strategy_template_name,
has_protect_object_ip, has_protect_object_port,
has_peer_ip, has_peer_port,
has_protocol, has_url, has_dns,
strategy_template_create_user_id,
strategy_template_create_username, strategy_template_create_depart,
default_op)
VALUE (#{template.templateName},
#{template.hasProtectObjectIP}, #{template.hasProtectObjectPort},
#{template.hasPeerIP}, #{template.hasPeerPort},
#{template.hasProtocol}, #{template.hasURL}, #{template.hasDNS},
0,
#{template.templateName}, #{template.templateName},
#{template.defaultOp})
</insert>
<resultMap id="templateMap" type="com.realtime.protection.configuration.entity.defense.template.Template">
<id column="strategy_template_id" property="templateId"/>
<result column="strategy_template_name" property="templateName"/>
<result column="strategy_template_used_times" property="templateUsedTimes"/>
<result column="strategy_template_running_tasks" property="templateRunningTasks"/>
</resultMap>
<select id="queryTemplates" resultMap="templateMap">
SELECT * FROM t_strategy_template
<where>
<if test="template_name != null">
AND strategy_template_name LIKE CONCAT('%', #{template_name}, '%')
</if>
</where>
LIMIT ${(page - 1) * page_size}, #{page_size}
</select>
</mapper>