Authored by FengRuwei

添加自定义url开关

@@ -23,6 +23,8 @@ public class JavaApiInfo { @@ -23,6 +23,8 @@ public class JavaApiInfo {
23 23
24 private Integer apiErrorCheck; 24 private Integer apiErrorCheck;
25 25
  26 + private Integer apiUrlCustom;
  27 +
26 @Override 28 @Override
27 public String toString() { 29 public String toString() {
28 return ReflectionToStringBuilder.toString(this); 30 return ReflectionToStringBuilder.toString(this);
@@ -11,9 +11,10 @@ @@ -11,9 +11,10 @@
11 <result column="api_req_method" property="apiReqMethod" jdbcType="INTEGER"/> 11 <result column="api_req_method" property="apiReqMethod" jdbcType="INTEGER"/>
12 <result column="api_warn_trigger" property="apiWarnTrigger" jdbcType="INTEGER"/> 12 <result column="api_warn_trigger" property="apiWarnTrigger" jdbcType="INTEGER"/>
13 <result column="api_error_check" property="apiErrorCheck" jdbcType="INTEGER"/> 13 <result column="api_error_check" property="apiErrorCheck" jdbcType="INTEGER"/>
  14 + <result column="api_url_custom" property="apiUrlCustom" jdbcType="INTEGER"/>
14 </resultMap> 15 </resultMap>
15 <sql id="Base_Column_List"> 16 <sql id="Base_Column_List">
16 - service_id, service_type, api_name, api_url, api_data, api_toggle, api_req_method,api_warn_trigger,api_error_check 17 + service_id, service_type, api_name, api_url, api_data, api_toggle, api_req_method,api_warn_trigger,api_error_check,api_url_custom
17 </sql> 18 </sql>
18 <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer"> 19 <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
19 select 20 select
@@ -28,10 +29,11 @@ @@ -28,10 +29,11 @@
28 <insert id="insert" parameterType="com.model.JavaApiInfo"> 29 <insert id="insert" parameterType="com.model.JavaApiInfo">
29 insert into java_api_info (service_id, service_type, api_name, 30 insert into java_api_info (service_id, service_type, api_name,
30 api_url, api_data, api_toggle, 31 api_url, api_data, api_toggle,
31 - api_req_method,api_warn_trigger,api_error_check) 32 + api_req_method,api_warn_trigger,api_error_check,api_url_custom)
32 values (#{serviceId,jdbcType=INTEGER}, #{serviceType,jdbcType=INTEGER}, #{apiName,jdbcType=VARCHAR}, 33 values (#{serviceId,jdbcType=INTEGER}, #{serviceType,jdbcType=INTEGER}, #{apiName,jdbcType=VARCHAR},
33 #{apiUrl,jdbcType=VARCHAR}, #{apiData,jdbcType=VARCHAR}, #{apiToggle,jdbcType=INTEGER}, 34 #{apiUrl,jdbcType=VARCHAR}, #{apiData,jdbcType=VARCHAR}, #{apiToggle,jdbcType=INTEGER},
34 - #{apiReqMethod,jdbcType=INTEGER},#{apiWarnTrigger,jdbcType=INTEGER},#{apiErrorCheck,jdbcType=INTEGER}) 35 + #{apiReqMethod,jdbcType=INTEGER},#{apiWarnTrigger,jdbcType=INTEGER},
  36 + #{apiErrorCheck,jdbcType=INTEGER},#{apiUrlCustom,jdbcType=INTEGER})
35 </insert> 37 </insert>
36 <insert id="insertSelective" parameterType="com.model.JavaApiInfo"> 38 <insert id="insertSelective" parameterType="com.model.JavaApiInfo">
37 insert into java_api_info 39 insert into java_api_info
@@ -63,6 +65,9 @@ @@ -63,6 +65,9 @@
63 <if test="apiErrorCheck != null"> 65 <if test="apiErrorCheck != null">
64 api_error_check, 66 api_error_check,
65 </if> 67 </if>
  68 + <if test="apiUrlCustom != null">
  69 + api_url_custom,
  70 + </if>
66 </trim> 71 </trim>
67 <trim prefix="values (" suffix=")" suffixOverrides=","> 72 <trim prefix="values (" suffix=")" suffixOverrides=",">
68 <if test="serviceId != null"> 73 <if test="serviceId != null">
@@ -92,6 +97,9 @@ @@ -92,6 +97,9 @@
92 <if test="apiErrorCheck != null"> 97 <if test="apiErrorCheck != null">
93 #{apiErrorCheck,jdbcType=INTEGER}, 98 #{apiErrorCheck,jdbcType=INTEGER},
94 </if> 99 </if>
  100 + <if test="apiUrlCustom != null">
  101 + #{apiUrlCustom,jdbcType=INTEGER},
  102 + </if>
95 </trim> 103 </trim>
96 </insert> 104 </insert>
97 <update id="updateByPrimaryKeySelective" parameterType="com.model.JavaApiInfo"> 105 <update id="updateByPrimaryKeySelective" parameterType="com.model.JavaApiInfo">
@@ -121,6 +129,9 @@ @@ -121,6 +129,9 @@
121 <if test="apiErrorCheck != null"> 129 <if test="apiErrorCheck != null">
122 api_error_check=#{apiErrorCheck,jdbcType=INTEGER}, 130 api_error_check=#{apiErrorCheck,jdbcType=INTEGER},
123 </if> 131 </if>
  132 + <if test="apiUrlCustom != null">
  133 + api_url_custom=#{apiUrlCustom,jdbcType=INTEGER},
  134 + </if>
124 </set> 135 </set>
125 where service_id = #{serviceId,jdbcType=INTEGER} 136 where service_id = #{serviceId,jdbcType=INTEGER}
126 </update> 137 </update>
@@ -133,7 +144,8 @@ @@ -133,7 +144,8 @@
133 api_toggle = #{apiToggle,jdbcType=INTEGER}, 144 api_toggle = #{apiToggle,jdbcType=INTEGER},
134 api_req_method = #{apiReqMethod,jdbcType=INTEGER}, 145 api_req_method = #{apiReqMethod,jdbcType=INTEGER},
135 api_warn_trigger= #{apiWarnTrigger,jdbcType=INTEGER}, 146 api_warn_trigger= #{apiWarnTrigger,jdbcType=INTEGER},
136 - api_error_check=#{apiErrorCheck,jdbcType=INTEGER} 147 + api_error_check=#{apiErrorCheck,jdbcType=INTEGER},
  148 + api_url_custom=#{apiUrlCustom,jdbcType=INTEGER}
137 where service_id = #{serviceId,jdbcType=INTEGER} 149 where service_id = #{serviceId,jdbcType=INTEGER}
138 </update> 150 </update>
139 151
@@ -154,10 +166,10 @@ @@ -154,10 +166,10 @@
154 and service_type = #{params.serviceType,jdbcType=INTEGER} 166 and service_type = #{params.serviceType,jdbcType=INTEGER}
155 </if> 167 </if>
156 <if test="params.apiName != null and params.apiName != ''"> 168 <if test="params.apiName != null and params.apiName != ''">
157 - and api_name like CONCAT('%',#{params.apiName,jdbcType=VARCHAR},'%' ) 169 + and api_name like CONCAT('%',#{params.apiName,jdbcType=VARCHAR},'%' )
158 </if> 170 </if>
159 <if test="params.apiUrl != null and params.apiUrl != ''"> 171 <if test="params.apiUrl != null and params.apiUrl != ''">
160 - and api_url like CONCAT('%',#{params.apiUrl,jdbcType=VARCHAR},'%' ) 172 + and api_url like CONCAT('%',#{params.apiUrl,jdbcType=VARCHAR},'%' )
161 </if> 173 </if>
162 <if test="params.apiData != null"> 174 <if test="params.apiData != null">
163 and api_data = #{params.apiData,jdbcType=VARCHAR} 175 and api_data = #{params.apiData,jdbcType=VARCHAR}
@@ -166,10 +178,10 @@ @@ -166,10 +178,10 @@
166 and api_toggle = #{params.apiToggle,jdbcType=INTEGER} 178 and api_toggle = #{params.apiToggle,jdbcType=INTEGER}
167 </if> 179 </if>
168 <if test="params.apiReqMethod != null and params.apiReqMethod !=2 "> 180 <if test="params.apiReqMethod != null and params.apiReqMethod !=2 ">
169 - and api_req_method = #{params.apiReqMethod,jdbcType=INTEGER} 181 + and api_req_method = #{params.apiReqMethod,jdbcType=INTEGER}
170 </if> 182 </if>
171 <if test="params.apiWarnTrigger != null"> 183 <if test="params.apiWarnTrigger != null">
172 - and api_warn_trigger = #{params.apiWarnTrigger,jdbcType=INTEGER} 184 + and api_warn_trigger = #{params.apiWarnTrigger,jdbcType=INTEGER}
173 </if> 185 </if>
174 </select> 186 </select>
175 187
@@ -177,7 +189,8 @@ @@ -177,7 +189,8 @@
177 select 189 select
178 <include refid="Base_Column_List"/>,statics.err_num 190 <include refid="Base_Column_List"/>,statics.err_num
179 from java_api_info info 191 from java_api_info info
180 - left JOIN (SELECT count(api_id) err_num,api_id FROM `java_api_info_statics` where is_exception=1 GROUP BY api_id ) as statics 192 + left JOIN (SELECT count(api_id) err_num,api_id FROM `java_api_info_statics` where is_exception=1 GROUP BY api_id
  193 + ) as statics
181 on info.service_id=statics.api_id 194 on info.service_id=statics.api_id
182 where 195 where
183 1=1 196 1=1
@@ -185,22 +198,22 @@ @@ -185,22 +198,22 @@
185 and info.service_type = #{params.serviceType,jdbcType=INTEGER} 198 and info.service_type = #{params.serviceType,jdbcType=INTEGER}
186 </if> 199 </if>
187 <if test="params.apiName != null and params.apiName != ''"> 200 <if test="params.apiName != null and params.apiName != ''">
188 - and info.api_name like CONCAT('%',#{params.apiName,jdbcType=VARCHAR},'%' ) 201 + and info.api_name like CONCAT('%',#{params.apiName,jdbcType=VARCHAR},'%' )
189 </if> 202 </if>
190 <if test="params.apiUrl != null and params.apiUrl != ''"> 203 <if test="params.apiUrl != null and params.apiUrl != ''">
191 - and info.api_url like CONCAT('%',#{params.apiUrl,jdbcType=VARCHAR},'%' ) 204 + and info.api_url like CONCAT('%',#{params.apiUrl,jdbcType=VARCHAR},'%' )
192 </if> 205 </if>
193 <if test="params.apiData != null"> 206 <if test="params.apiData != null">
194 - and info.api_data = #{params.apiData,jdbcType=VARCHAR} 207 + and info.api_data = #{params.apiData,jdbcType=VARCHAR}
195 </if> 208 </if>
196 <if test="params.apiToggle != null"> 209 <if test="params.apiToggle != null">
197 - and info.api_toggle = #{params.apiToggle,jdbcType=INTEGER} 210 + and info.api_toggle = #{params.apiToggle,jdbcType=INTEGER}
198 </if> 211 </if>
199 <if test="params.apiReqMethod != null and params.apiReqMethod !=2 "> 212 <if test="params.apiReqMethod != null and params.apiReqMethod !=2 ">
200 - and info.api_req_method = #{params.apiReqMethod,jdbcType=INTEGER} 213 + and info.api_req_method = #{params.apiReqMethod,jdbcType=INTEGER}
201 </if> 214 </if>
202 <if test="params.apiWarnTrigger != null"> 215 <if test="params.apiWarnTrigger != null">
203 - and info.api_warn_trigger = #{params.apiWarnTrigger,jdbcType=INTEGER} 216 + and info.api_warn_trigger = #{params.apiWarnTrigger,jdbcType=INTEGER}
204 </if> 217 </if>
205 ORDER BY info.api_toggle desc , statics.err_num desc 218 ORDER BY info.api_toggle desc , statics.err_num desc
206 limit #{startIndex},#{pageSize} 219 limit #{startIndex},#{pageSize}