IP类配置加入新字段ratelimit

This commit is contained in:
wangxin
2018-06-21 14:51:43 +08:00
parent 35fc8862ca
commit 16b4b22504
2 changed files with 34 additions and 5 deletions

View File

@@ -65,6 +65,25 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
@Expose
@SerializedName("protocolId")
protected Integer protocolId ;
/**
* 限速比例
*/
protected Integer ratelimit ;
/**
* ratelimit
* @return ratelimit
*/
public Integer getRatelimit() {
return ratelimit;
}
/**
* @param ratelimit the ratelimit to set
*/
public void setRatelimit(Integer ratelimit) {
this.ratelimit = ratelimit;
}
/**
* ipType
* @return ipType

View File

@@ -34,6 +34,7 @@
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="ratelimit" property="ratelimit" jdbcType="INTEGER" />
</resultMap>
@@ -48,7 +49,7 @@
DIRECTION,PROTOCOL,PROTOCOL_ID,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID,RATELIMIT
</sql>
<sql id="BaseIpCfg_Column_List_with_id_alias" >
<choose>
@@ -58,7 +59,7 @@
${page.alias}.DIRECTION as direction,${page.alias}.PROTOCOL as protocol,${page.alias}.PROTOCOL_ID as protocolId,${page.alias}.ACTION as action,${page.alias}.IS_VALID as isValid,${page.alias}.IS_AUDIT as isAudit,
${page.alias}.CREATOR_ID as creatorId,${page.alias}.CREATE_TIME AS createTime,${page.alias}.EDITOR_ID as editorId,${page.alias}.EDIT_TIME AS editTime,${page.alias}.AUDITOR_ID as auditorId,${page.alias}.AUDIT_TIME AS auditTime,
${page.alias}.SERVICE_ID as serviceId,${page.alias}.REQUEST_ID AS requestId,${page.alias}.COMPILE_ID AS compileId,${page.alias}.IS_AREA_EFFECTIVE as isAreaEffective,${page.alias}.classify,
${page.alias}.ATTRIBUTE AS attribute,${page.alias}.LABLE AS lable,${page.alias}.AREA_EFFECTIVE_IDS AS areaEffectiveIds,${page.alias}.FUNCTION_ID AS functionId
${page.alias}.ATTRIBUTE AS attribute,${page.alias}.LABLE AS lable,${page.alias}.AREA_EFFECTIVE_IDS AS areaEffectiveIds,${page.alias}.FUNCTION_ID AS functionId,${page.alias}.RATELIMIT AS ratelimit
</when>
<otherwise>
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc,r.CFG_REGION_CODE as cfgRegionCode,r.CFG_TYPE as cfgType, r.IP_TYPE as ipType,
@@ -66,7 +67,7 @@
r.DIRECTION as direction,r.PROTOCOL as protocol,r.PROTOCOL_ID as protocolId,r.ACTION as action,r.IS_VALID as isValid,r.IS_AUDIT as isAudit,
r.CREATOR_ID as creatorId,r.CREATE_TIME AS createTime,r.EDITOR_ID as editorId,r.EDIT_TIME AS editTime,r.AUDITOR_ID as auditorId,r.AUDIT_TIME AS auditTime,
r.SERVICE_ID as serviceId,r.REQUEST_ID AS requestId,r.COMPILE_ID AS compileId,r.IS_AREA_EFFECTIVE as isAreaEffective,r.classify,
r.ATTRIBUTE AS attribute,r.LABLE AS lable,r.AREA_EFFECTIVE_IDS AS areaEffectiveIds,r.FUNCTION_ID as functionId
r.ATTRIBUTE AS attribute,r.LABLE AS lable,r.AREA_EFFECTIVE_IDS AS areaEffectiveIds,r.FUNCTION_ID as functionId,r.RATELIMIT AS ratelimit
</otherwise>
</choose>
</sql>
@@ -80,7 +81,7 @@
AUDITOR_ID,AUDIT_TIME,SERVICE_ID,
REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,
CLASSIFY,ATTRIBUTE,LABLE,
AREA_EFFECTIVE_IDS,FUNCTION_ID
AREA_EFFECTIVE_IDS,FUNCTION_ID,RATELIMIT
</sql>
<sql id="BaseIpCfg_Value_List" >
#{cfgDesc,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER},#{cfgType,jdbcType=VARCHAR},
@@ -92,7 +93,7 @@
#{auditorId,jdbcType=INTEGER},#{auditTime,jdbcType=TIMESTAMP},#{serviceId,jdbcType=INTEGER},
#{requestId,jdbcType=INTEGER},#{compileId,jdbcType=INTEGER},#{isAreaEffective,jdbcType=INTEGER},
#{classify,jdbcType=VARCHAR},#{attribute,jdbcType=VARCHAR},#{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR}, #{functionId,jdbcType=INTEGER}
#{areaEffectiveIds,jdbcType=VARCHAR}, #{functionId,jdbcType=INTEGER}, #{ratelimit,jdbcType=INTEGER}
</sql>
<select id="getById" resultMap="BaseIpMap" parameterType="java.lang.Long" >
SELECT
@@ -259,6 +260,9 @@
<if test="functionId != null">
AND ${page.alias}.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
</if>
<if test="ratelimit != null">
AND ${page.alias}.RATELIMIT=#{ratelimit,jdbcType=INTEGER}
</if>
</when>
<otherwise>
<if test="cfgId != null">
@@ -360,6 +364,9 @@
<if test="functionId != null">
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
</if>
<if test="ratelimit != null">
AND r.RATELIMIT=#{ratelimit,jdbcType=INTEGER}
</if>
</otherwise>
</choose>
<!-- 数据范围过滤 -->
@@ -506,6 +513,9 @@
<if test="functionId != null">
FUNCTION_ID=#{functionId,jdbcType=INTEGER}
</if>
<if test="ratelimit != null">
RATELIMIT=#{ratelimit,jdbcType=INTEGER}
</if>
</trim>
</set>
where cfg_id = #{cfgId,jdbcType=BIGINT}