This is an automated email from the ASF dual-hosted git repository. midnight2104 pushed a commit to branch midnight2104 in repository https://gitbox.apache.org/repos/asf/incubator-shenyu.git
commit 67c342a225ea75705851457ce394ae32729cc17c Author: LL2104 <[email protected]> AuthorDate: Wed Apr 13 12:36:29 2022 +0800 refactor shenyu-admin: format SQL to improve code readability. --- .../src/main/resources/mappers/plugin-sqlmap.xml | 95 ++++++------ .../src/main/resources/mappers/resouce-sqlmap.xml | 76 +++++----- .../src/main/resources/mappers/role-sqlmap.xml | 41 ++--- .../resources/mappers/rule-condition-sqlmap.xml | 91 +++++------ .../src/main/resources/mappers/rule-sqlmap.xml | 168 ++++++++++++--------- .../mappers/selector-condition-sqlmap.xml | 85 +++++------ .../src/main/resources/mappers/selector-sqlmap.xml | 162 ++++++++++---------- .../main/resources/mappers/shenyu-dict-sqlmap.xml | 109 ++++++------- .../main/resources/mappers/user-role-sqlmap.xml | 2 +- 9 files changed, 426 insertions(+), 403 deletions(-) diff --git a/shenyu-admin/src/main/resources/mappers/plugin-sqlmap.xml b/shenyu-admin/src/main/resources/mappers/plugin-sqlmap.xml index 93c9a6c63..08994ca16 100644 --- a/shenyu-admin/src/main/resources/mappers/plugin-sqlmap.xml +++ b/shenyu-admin/src/main/resources/mappers/plugin-sqlmap.xml @@ -44,7 +44,7 @@ SELECT <include refid="Base_Column_List"/> FROM plugin - WHERE id = #{id,jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </select> <select id="selectByIds" parameterType="java.util.List" resultMap="BaseResultMap"> @@ -61,7 +61,7 @@ SELECT <include refid="Base_Column_List"/> FROM plugin - WHERE name = #{name,jdbcType=VARCHAR} + WHERE name = #{name, jdbcType=VARCHAR} </select> <select id="selectByNames" parameterType="java.util.List" resultMap="BaseResultMap"> @@ -70,7 +70,7 @@ FROM plugin WHERE name IN <foreach item="name" collection="list" open="(" separator="," close=")"> - #{name,jdbcType=VARCHAR} + #{name, jdbcType=VARCHAR} </foreach> </select> @@ -82,13 +82,13 @@ <where> <if test="name != null and name != ''"> <bind name="nameLike" value="('%' + name + '%')"/> - AND name LIKE #{nameLike,jdbcType=VARCHAR} + AND name LIKE #{nameLike, jdbcType=VARCHAR} </if> <if test="enabled != null"> - AND enabled = #{enabled,jdbcType=TINYINT} + AND enabled = #{enabled, jdbcType=TINYINT} </if> </where> - ORDER BY sort ASC + ORDER BY sort ASC </select> <select id="countByQuery" parameterType="org.apache.shenyu.admin.model.query.PluginQuery" @@ -97,10 +97,10 @@ FROM plugin <where> <if test="name != null and name != ''"> - AND name = #{name,jdbcType=VARCHAR} + AND name = #{name, jdbcType=VARCHAR} </if> <if test="enabled != null"> - AND enabled = #{enabled,jdbcType=TINYINT} + AND enabled = #{enabled, jdbcType=TINYINT} </if> </where> </select> @@ -116,7 +116,8 @@ <include refid="Base_Column_List"/> FROM plugin WHERE name NOT IN - (SELECT title FROM resource) + (SELECT title + FROM resource) </select> <select id="existed" resultType="java.lang.Boolean"> @@ -140,7 +141,7 @@ open="(" separator="," close=")"> #{id} </foreach> - LIMIT 1 + LIMIT 1 </select> <insert id="insert" parameterType="org.apache.shenyu.admin.model.entity.PluginDO"> @@ -153,14 +154,14 @@ role, sort, enabled) - VALUES (#{id,jdbcType=VARCHAR}, - #{dateCreated,jdbcType=TIMESTAMP}, - #{dateUpdated,jdbcType=TIMESTAMP}, - #{name,jdbcType=VARCHAR}, - #{config,jdbcType=VARCHAR}, - #{role,jdbcType=VARCHAR}, - #{sort,jdbcType=INTEGER}, - #{enabled,jdbcType=TINYINT}) + VALUES (#{id, jdbcType=VARCHAR}, + #{dateCreated, jdbcType=TIMESTAMP}, + #{dateUpdated, jdbcType=TIMESTAMP}, + #{name, jdbcType=VARCHAR}, + #{config, jdbcType=VARCHAR}, + #{role, jdbcType=VARCHAR}, + #{sort, jdbcType=INTEGER}, + #{enabled, jdbcType=TINYINT}) </insert> <insert id="insertSelective" parameterType="org.apache.shenyu.admin.model.entity.PluginDO"> @@ -190,56 +191,56 @@ </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> - #{id,jdbcType=VARCHAR}, + #{id, jdbcType=VARCHAR}, <if test="dateCreated != null"> - #{dateCreated,jdbcType=TIMESTAMP}, + #{dateCreated, jdbcType=TIMESTAMP}, </if> <if test="dateUpdated != null"> - #{dateUpdated,jdbcType=TIMESTAMP}, + #{dateUpdated, jdbcType=TIMESTAMP}, </if> <if test="name != null"> - #{name,jdbcType=VARCHAR}, + #{name, jdbcType=VARCHAR}, </if> <if test="config != null"> - #{config,jdbcType=VARCHAR}, + #{config, jdbcType=VARCHAR}, </if> <if test="role != null"> - #{role,jdbcType=VARCHAR}, + #{role, jdbcType=VARCHAR}, </if> <if test="sort != null"> - #{sort,jdbcType=INTEGER}, + #{sort, jdbcType=INTEGER}, </if> <if test="enabled != null"> - #{enabled,jdbcType=TINYINT}, + #{enabled, jdbcType=TINYINT}, </if> </trim> </insert> <update id="update" parameterType="org.apache.shenyu.admin.model.entity.PluginDO"> UPDATE plugin - SET date_updated = #{dateUpdated,jdbcType=TIMESTAMP}, - name = #{name,jdbcType=VARCHAR}, - config = #{config,jdbcType=VARCHAR}, - role = #{role,jdbcType=VARCHAR}, - sort = #{sort,jdbcType=INTEGER}, - enabled = #{enabled,jdbcType=TINYINT} - WHERE id = #{id,jdbcType=VARCHAR} + SET date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, + name = #{name, jdbcType=VARCHAR}, + config = #{config, jdbcType=VARCHAR}, + role = #{role, jdbcType=VARCHAR}, + sort = #{sort, jdbcType=INTEGER}, + enabled = #{enabled, jdbcType=TINYINT} + WHERE id = #{id, jdbcType=VARCHAR} </update> <update id="updateEnable" parameterType="org.apache.shenyu.admin.model.entity.PluginDO"> UPDATE plugin - SET date_updated = #{dateUpdated,jdbcType=TIMESTAMP}, - enabled = #{enabled,jdbcType=TINYINT} - WHERE id = #{id,jdbcType=VARCHAR} + SET date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, + enabled = #{enabled, jdbcType=TINYINT} + WHERE id = #{id, jdbcType=VARCHAR} </update> <update id="updateEnableByIdSet"> UPDATE plugin - SET enabled = #{enabled,jdbcType=TINYINT} + SET enabled = #{enabled, jdbcType=TINYINT} WHERE id IN <foreach collection="idSet" item="id" index="index" open="(" separator="," close=")"> - #{id,jdbcType=VARCHAR} + #{id, jdbcType=VARCHAR} </foreach> </update> @@ -247,33 +248,33 @@ UPDATE plugin <set> <if test="dateCreated != null"> - date_created = #{dateCreated,jdbcType=TIMESTAMP}, + date_created = #{dateCreated, jdbcType=TIMESTAMP}, </if> <if test="dateUpdated != null"> - date_updated = #{dateUpdated,jdbcType=TIMESTAMP}, + date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, </if> <if test="name != null"> - name = #{name,jdbcType=VARCHAR}, + name = #{name, jdbcType=VARCHAR}, </if> <if test="config != null"> - config = #{config,jdbcType=VARCHAR}, + config = #{config, jdbcType=VARCHAR}, </if> <if test="role != null"> - role = #{role,jdbcType=VARCHAR}, + role = #{role, jdbcType=VARCHAR}, </if> <if test="sort != null"> - sort = #{sort,jdbcType=INTEGER}, + sort = #{sort, jdbcType=INTEGER}, </if> <if test="enabled != null"> - enabled = #{enabled,jdbcType=TINYINT}, + enabled = #{enabled, jdbcType=TINYINT}, </if> </set> - WHERE id = #{id,jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </update> <delete id="delete" parameterType="java.lang.String"> DELETE FROM plugin - WHERE id = #{id,jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </delete> <delete id="deleteByIds" parameterType="java.util.List"> diff --git a/shenyu-admin/src/main/resources/mappers/resouce-sqlmap.xml b/shenyu-admin/src/main/resources/mappers/resouce-sqlmap.xml index a15d210ef..2c57c5c66 100644 --- a/shenyu-admin/src/main/resources/mappers/resouce-sqlmap.xml +++ b/shenyu-admin/src/main/resources/mappers/resouce-sqlmap.xml @@ -95,7 +95,7 @@ FROM resource WHERE status = 1 <if test="title != null"> - AND title = #{title,jdbcType=VARCHAR} + AND title = #{title, jdbcType=VARCHAR} </if> </select> @@ -270,37 +270,37 @@ <insert id = "insertBatch"> INSERT INTO resource - ( - id, - parent_id, - title, - name, - url, - component, - resource_type, - sort, - icon, - is_leaf, - is_route, - perms, - status - ) - VALUES + ( + id, + parent_id, + title, + name, + url, + component, + resource_type, + sort, + icon, + is_leaf, + is_route, + perms, + status + ) + VALUES <foreach collection="resourceDOList" item="resourceDO" separator=","> ( - #{resourceDO.id,jdbcType=VARCHAR}, - #{resourceDO.parentId,jdbcType=VARCHAR}, - #{resourceDO.title,jdbcType=VARCHAR}, - #{resourceDO.name,jdbcType=VARCHAR}, - #{resourceDO.url,jdbcType=VARCHAR}, - #{resourceDO.component,jdbcType=VARCHAR}, - #{resourceDO.resourceType,jdbcType=INTEGER}, - #{resourceDO.sort,jdbcType=INTEGER}, - #{resourceDO.icon,jdbcType=VARCHAR}, - #{resourceDO.isLeaf,jdbcType=BOOLEAN}, - #{resourceDO.isRoute,jdbcType=INTEGER}, - #{resourceDO.perms,jdbcType=VARCHAR}, - #{resourceDO.status,jdbcType=VARCHAR} + #{resourceDO.id, jdbcType=VARCHAR}, + #{resourceDO.parentId, jdbcType=VARCHAR}, + #{resourceDO.title, jdbcType=VARCHAR}, + #{resourceDO.name, jdbcType=VARCHAR}, + #{resourceDO.url, jdbcType=VARCHAR}, + #{resourceDO.component, jdbcType=VARCHAR}, + #{resourceDO.resourceType, jdbcType=INTEGER}, + #{resourceDO.sort, jdbcType=INTEGER}, + #{resourceDO.icon, jdbcType=VARCHAR}, + #{resourceDO.isLeaf, jdbcType=BOOLEAN}, + #{resourceDO.isRoute, jdbcType=INTEGER}, + #{resourceDO.perms, jdbcType=VARCHAR}, + #{resourceDO.status, jdbcType=VARCHAR} ) </foreach> </insert> @@ -332,13 +332,13 @@ date_created = #{dateCreated, jdbcType=TIMESTAMP}, </if> <if test="dateUpdated != null"> - date_updated = #{dateUpdated,jdbcType=TIMESTAMP}, + date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, </if> <if test="parentId != null"> parent_id = #{parentId, jdbcType=VARCHAR}, </if> <if test="title != null"> - title = #{title,jdbcType=VARCHAR}, + title = #{title, jdbcType=VARCHAR}, </if> <if test="name != null"> name = #{name, jdbcType=VARCHAR}, @@ -353,13 +353,13 @@ resource_type = #{resourceType, jdbcType=INTEGER}, </if> <if test="sort != null"> - sort = #{sort,jdbcType=INTEGER}, + sort = #{sort, jdbcType=INTEGER}, </if> <if test="icon != null"> icon = #{icon, jdbcType=VARCHAR}, </if> <if test="isLeaf != null"> - is_leaf = #{isLeaf,jdbcType=BOOLEAN}, + is_leaf = #{isLeaf, jdbcType=BOOLEAN}, </if> <if test="isRoute != null"> is_route = #{isRoute, jdbcType=INTEGER}, @@ -376,9 +376,9 @@ <delete id="delete" parameterType="java.util.List"> DELETE FROM resource - WHERE id IN - <foreach item="id" collection="list" open="(" separator="," close=")"> - #{id,jdbcType=VARCHAR} - </foreach> + WHERE id IN + <foreach item="id" collection="list" open="(" separator="," close=")"> + #{id,jdbcType=VARCHAR} + </foreach> </delete> </mapper> diff --git a/shenyu-admin/src/main/resources/mappers/role-sqlmap.xml b/shenyu-admin/src/main/resources/mappers/role-sqlmap.xml index 7a74ca51b..c80bc2d49 100644 --- a/shenyu-admin/src/main/resources/mappers/role-sqlmap.xml +++ b/shenyu-admin/src/main/resources/mappers/role-sqlmap.xml @@ -38,7 +38,8 @@ SELECT <include refid="Base_Column_List"/> FROM role - WHERE id = #{id,jdbcType=VARCHAR} AND role_name != 'super' + WHERE id = #{id, jdbcType=VARCHAR} + AND role_name != 'super' </select> <select id="selectByQuery" parameterType="org.apache.shenyu.admin.model.query.RoleQuery" resultMap="BaseResultMap"> @@ -47,7 +48,7 @@ FROM role WHERE role_name != 'super' <if test="roleName != null"> - AND role_name = #{roleName,jdbcType=VARCHAR} + AND role_name = #{roleName, jdbcType=VARCHAR} </if> </select> @@ -55,7 +56,7 @@ SELECT <include refid="Base_Column_List"/> FROM role - WHERE role_name = #{roleName,jdbcType=VARCHAR} + WHERE role_name = #{roleName, jdbcType=VARCHAR} </select> <select id="countByQuery" parameterType="org.apache.shenyu.admin.model.query.RoleQuery" @@ -64,7 +65,7 @@ FROM role WHERE role_name != 'super' <if test="roleName != null"> - AND role_name = #{roleName,jdbcType=VARCHAR} + AND role_name = #{roleName, jdbcType=VARCHAR} </if> </select> @@ -115,18 +116,18 @@ </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> - #{id,jdbcType=VARCHAR}, + #{id, jdbcType=VARCHAR}, <if test="dateCreated != null"> - #{dateCreated,jdbcType=TIMESTAMP}, + #{dateCreated, jdbcType=TIMESTAMP}, </if> <if test="dateUpdated != null"> - #{dateUpdated,jdbcType=TIMESTAMP}, + #{dateUpdated, jdbcType=TIMESTAMP}, </if> <if test="roleName != null"> - #{roleName,jdbcType=VARCHAR}, + #{roleName, jdbcType=VARCHAR}, </if> <if test="description != null"> - #{description,jdbcType=VARCHAR}, + #{description, jdbcType=VARCHAR}, </if> </trim> </insert> @@ -134,37 +135,37 @@ <update id="update" parameterType="org.apache.shenyu.admin.model.entity.RoleDO"> UPDATE role SET - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - date_updated = #{dateUpdated,jdbcType=TIMESTAMP}, - role_name = #{roleName,jdbcType=VARCHAR}, - description = #{description,jdbcType=VARCHAR} - WHERE id = #{id,jdbcType=VARCHAR} + date_created = #{dateCreated, jdbcType=TIMESTAMP}, + date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, + role_name = #{roleName, jdbcType=VARCHAR}, + description = #{description, jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </update> <update id="updateSelective" parameterType="org.apache.shenyu.admin.model.entity.RoleDO"> UPDATE role <set> <if test="dateCreated != null"> - date_created = #{dateCreated,jdbcType=TIMESTAMP}, + date_created = #{dateCreated, jdbcType=TIMESTAMP}, </if> <if test="dateUpdated != null"> - date_updated = #{dateUpdated,jdbcType=TIMESTAMP}, + date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, </if> <if test="roleName != null"> - role_name = #{roleName,jdbcType=VARCHAR}, + role_name = #{roleName, jdbcType=VARCHAR}, </if> <if test="description != null"> - description = #{description,jdbcType=VARCHAR}, + description = #{description, jdbcType=VARCHAR}, </if> </set> - WHERE id = #{id,jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </update> <delete id="delete" parameterType="java.util.List"> DELETE FROM role WHERE id IN <foreach item="id" collection="list" open="(" separator="," close=")"> - #{id,jdbcType=VARCHAR} + #{id, jdbcType=VARCHAR} </foreach> </delete> </mapper> diff --git a/shenyu-admin/src/main/resources/mappers/rule-condition-sqlmap.xml b/shenyu-admin/src/main/resources/mappers/rule-condition-sqlmap.xml index f43d87c62..8dfecc6da 100644 --- a/shenyu-admin/src/main/resources/mappers/rule-condition-sqlmap.xml +++ b/shenyu-admin/src/main/resources/mappers/rule-condition-sqlmap.xml @@ -44,7 +44,7 @@ SELECT <include refid="Base_Column_List"/> FROM rule_condition - WHERE id = #{id,jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </select> <select id="selectByQuery" parameterType="org.apache.shenyu.admin.model.query.RuleConditionQuery" @@ -53,7 +53,7 @@ <include refid="Base_Column_List"/> FROM rule_condition <if test="ruleId != null"> - WHERE rule_id = #{ruleId,jdbcType=VARCHAR} + WHERE rule_id = #{ruleId, jdbcType=VARCHAR} </if> </select> @@ -64,27 +64,28 @@ WHERE rule_id IN <foreach collection="ruleIdSet" item="ruleId" index="index" open="(" separator="," close=")"> - #{ruleId,jdbcType=VARCHAR} + #{ruleId, jdbcType=VARCHAR} </foreach> </select> <insert id="insert" parameterType="org.apache.shenyu.admin.model.entity.RuleConditionDO"> - INSERT INTO rule_condition (id, - date_created, - date_updated, - rule_id, - param_type, - operator, - param_name, - param_value) - VALUES (#{id,jdbcType=VARCHAR}, - #{dateCreated,jdbcType=TIMESTAMP}, - #{dateUpdated,jdbcType=TIMESTAMP}, - #{ruleId,jdbcType=VARCHAR}, - #{paramType,jdbcType=VARCHAR}, - #{operator,jdbcType=VARCHAR}, - #{paramName,jdbcType=VARCHAR}, - #{paramValue,jdbcType=VARCHAR}) + INSERT INTO rule_condition + (id, + date_created, + date_updated, + rule_id, + param_type, + operator, + param_name, + param_value) + VALUES (#{id, jdbcType=VARCHAR}, + #{dateCreated, jdbcType=TIMESTAMP}, + #{dateUpdated, jdbcType=TIMESTAMP}, + #{ruleId, jdbcType=VARCHAR}, + #{paramType, jdbcType=VARCHAR}, + #{operator, jdbcType=VARCHAR}, + #{paramName, jdbcType=VARCHAR}, + #{paramValue, jdbcType=VARCHAR}) </insert> <insert id="insertSelective" parameterType="org.apache.shenyu.admin.model.entity.RuleConditionDO"> @@ -114,74 +115,74 @@ </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> - #{id,jdbcType=VARCHAR}, + #{id, jdbcType=VARCHAR}, <if test="dateCreated != null"> - #{dateCreated,jdbcType=TIMESTAMP}, + #{dateCreated, jdbcType=TIMESTAMP}, </if> <if test="dateUpdated != null"> - #{dateUpdated,jdbcType=TIMESTAMP}, + #{dateUpdated, jdbcType=TIMESTAMP}, </if> <if test="ruleId != null"> - #{ruleId,jdbcType=VARCHAR}, + #{ruleId, jdbcType=VARCHAR}, </if> <if test="paramType != null"> - #{paramType,jdbcType=VARCHAR}, + #{paramType, jdbcType=VARCHAR}, </if> <if test="operator != null"> - #{operator,jdbcType=VARCHAR}, + #{operator, jdbcType=VARCHAR}, </if> <if test="paramName != null"> - #{paramName,jdbcType=VARCHAR}, + #{paramName, jdbcType=VARCHAR}, </if> <if test="paramValue != null"> - #{paramValue,jdbcType=VARCHAR}, + #{paramValue, jdbcType=VARCHAR}, </if> </trim> </insert> <update id="update" parameterType="org.apache.shenyu.admin.model.entity.RuleConditionDO"> UPDATE rule_condition - SET date_created = #{dateCreated,jdbcType=TIMESTAMP}, - date_updated = #{dateUpdated,jdbcType=TIMESTAMP}, - rule_id = #{ruleId,jdbcType=VARCHAR}, - param_type = #{paramType,jdbcType=VARCHAR}, - operator = #{operator,jdbcType=VARCHAR}, - param_name = #{paramName,jdbcType=VARCHAR}, - param_value = #{paramValue,jdbcType=VARCHAR} - WHERE id = #{id,jdbcType=VARCHAR} + SET date_created = #{dateCreated, jdbcType=TIMESTAMP}, + date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, + rule_id = #{ruleId, jdbcType=VARCHAR}, + param_type = #{paramType, jdbcType=VARCHAR}, + operator = #{operator, jdbcType=VARCHAR}, + param_name = #{paramName, jdbcType=VARCHAR}, + param_value = #{paramValue, jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </update> <update id="updateSelective" parameterType="org.apache.shenyu.admin.model.entity.RuleConditionDO"> UPDATE rule_condition <set> <if test="dateCreated != null"> - date_created = #{dateCreated,jdbcType=TIMESTAMP}, + date_created = #{dateCreated, jdbcType=TIMESTAMP}, </if> <if test="dateUpdated != null"> - date_updated = #{dateUpdated,jdbcType=TIMESTAMP}, + date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, </if> <if test="ruleId != null"> - rule_id = #{ruleId,jdbcType=VARCHAR}, + rule_id = #{ruleId, jdbcType=VARCHAR}, </if> <if test="paramType != null"> - param_type = #{paramType,jdbcType=VARCHAR}, + param_type = #{paramType, jdbcType=VARCHAR}, </if> <if test="operator != null"> - operator = #{operator,jdbcType=VARCHAR}, + operator = #{operator, jdbcType=VARCHAR}, </if> <if test="paramName != null"> - param_name = #{paramName,jdbcType=VARCHAR}, + param_name = #{paramName, jdbcType=VARCHAR}, </if> <if test="paramValue != null"> - param_value = #{paramValue,jdbcType=VARCHAR}, + param_value = #{paramValue, jdbcType=VARCHAR}, </if> </set> - WHERE id = #{id,jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </update> <delete id="delete" parameterType="java.lang.String"> DELETE FROM rule_condition - WHERE id = #{id,jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </delete> <delete id="deleteByRuleIds" parameterType="java.util.List"> @@ -194,6 +195,6 @@ <delete id="deleteByQuery" parameterType="org.apache.shenyu.admin.model.query.RuleConditionQuery"> DELETE FROM rule_condition - WHERE rule_id = #{ruleId,jdbcType=VARCHAR} + WHERE rule_id = #{ruleId, jdbcType=VARCHAR} </delete> </mapper> diff --git a/shenyu-admin/src/main/resources/mappers/rule-sqlmap.xml b/shenyu-admin/src/main/resources/mappers/rule-sqlmap.xml index b5e71d54a..e52f0c900 100644 --- a/shenyu-admin/src/main/resources/mappers/rule-sqlmap.xml +++ b/shenyu-admin/src/main/resources/mappers/rule-sqlmap.xml @@ -32,44 +32,52 @@ </resultMap> <sql id="Base_Column_List"> - id, date_created, date_updated, selector_id, name, match_mode, - sort, enabled, loged, handle + id, + date_created, + date_updated, + selector_id, + name, + match_mode, + sort, + enabled, + loged, + handle </sql> <select id="selectById" parameterType="java.lang.String" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> - FROM rule - WHERE id = #{id,jdbcType=VARCHAR} + <include refid="Base_Column_List"/> + FROM rule + WHERE id = #{id, jdbcType=VARCHAR} </select> <select id="findByName" parameterType="java.lang.String" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> - FROM rule - WHERE name = #{name,jdbcType=VARCHAR} + <include refid="Base_Column_List"/> + FROM rule + WHERE name = #{name, jdbcType=VARCHAR} </select> <select id="findBySelectorIdAndName" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> - FROM rule - WHERE 1=1 - AND name = #{name,jdbcType=VARCHAR} - AND selector_id = #{selectorId,jdbcType=VARCHAR} + <include refid="Base_Column_List"/> + FROM rule + WHERE 1=1 + AND name = #{name, jdbcType=VARCHAR} + AND selector_id = #{selectorId, jdbcType=VARCHAR} </select> <select id="selectByQuery" parameterType="org.apache.shenyu.admin.model.query.RuleQuery" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> - FROM rule + <include refid="Base_Column_List"/> + FROM rule <where> <if test="selectorId != null"> - selector_id = #{selectorId,jdbcType=VARCHAR} + selector_id = #{selectorId, jdbcType=VARCHAR} </if> <if test="name != null and name != ''"> <bind name="nameLike" value="('%' + name + '%')"/> - AND name like #{nameLike,jdbcType=VARCHAR} + AND name like #{nameLike, jdbcType=VARCHAR} </if> <if test="filterIds != null"> AND id IN @@ -82,14 +90,16 @@ <select id="findBySelectorId" parameterType="java.lang.String" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> - FROM rule WHERE selector_id = #{selectorId,jdbcType=VARCHAR} + <include refid="Base_Column_List"/> + FROM rule + WHERE selector_id = #{selectorId, jdbcType=VARCHAR} </select> <select id="findBySelectorIds" parameterType="java.util.List" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> - FROM rule WHERE selector_id IN + <include refid="Base_Column_List"/> + FROM rule + WHERE selector_id IN <foreach item="selectId" collection="list" open="(" separator="," close=")"> #{selectId, jdbcType=VARCHAR} </foreach> @@ -98,13 +108,13 @@ <select id="countByQuery" parameterType="org.apache.shenyu.admin.model.query.RuleQuery" resultType="java.lang.Integer"> SELECT count(1) - FROM rule + FROM rule <where> <if test="selectorId != null"> - selector_id = #{selectorId,jdbcType=VARCHAR} + selector_id = #{selectorId, jdbcType=VARCHAR} </if> <if test="name != null and name != ''"> - AND name = #{name,jdbcType=VARCHAR} + AND name = #{name, jdbcType=VARCHAR} </if> <if test="filterIds != null"> AND id IN @@ -117,25 +127,38 @@ <select id="selectAll" resultType="org.apache.shenyu.admin.model.entity.RuleDO" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> - FROM rule + <include refid="Base_Column_List"/> + FROM rule </select> <select id="existed" resultType="java.lang.Boolean"> SELECT TRUE - FROM rule - WHERE id = #{id} - LIMIT 1 + FROM rule + WHERE id = #{id} + LIMIT 1 </select> <insert id="insert" parameterType="org.apache.shenyu.admin.model.entity.RuleDO"> - INSERT INTO rule (id, date_created, date_updated, - selector_id, name, match_mode, sort, enabled, - loged, handle) - VALUES (#{id,jdbcType=VARCHAR}, #{dateCreated,jdbcType=TIMESTAMP}, #{dateUpdated,jdbcType=TIMESTAMP}, - #{selectorId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{matchMode,jdbcType=INTEGER}, - #{sort,jdbcType=INTEGER}, #{enabled,jdbcType=TINYINT}, #{loged,jdbcType=TINYINT}, - #{handle,jdbcType=VARCHAR}) + INSERT INTO rule (id, + date_created, + date_updated, + selector_id, + name, + match_mode, + sort, + enabled, + loged, + handle) + VALUES (#{id, jdbcType=VARCHAR}, + #{dateCreated, jdbcType=TIMESTAMP}, + #{dateUpdated, jdbcType=TIMESTAMP}, + #{selectorId, jdbcType=VARCHAR}, + #{name, jdbcType=VARCHAR}, + #{matchMode, jdbcType=INTEGER}, + #{sort, jdbcType=INTEGER}, + #{enabled, jdbcType=TINYINT}, + #{loged, jdbcType=TINYINT}, + #{handle, jdbcType=VARCHAR}) </insert> <insert id="insertSelective" parameterType="org.apache.shenyu.admin.model.entity.RuleDO"> @@ -171,96 +194,95 @@ </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> - #{id,jdbcType=VARCHAR}, + #{id, jdbcType=VARCHAR}, <if test="dateCreated != null"> - #{dateCreated,jdbcType=TIMESTAMP}, + #{dateCreated, jdbcType=TIMESTAMP}, </if> <if test="dateUpdated != null"> - #{dateUpdated,jdbcType=TIMESTAMP}, + #{dateUpdated, jdbcType=TIMESTAMP}, </if> <if test="selectorId != null"> - #{selectorId,jdbcType=VARCHAR}, + #{selectorId, jdbcType=VARCHAR}, </if> <if test="name != null"> - #{name,jdbcType=VARCHAR}, + #{name, jdbcType=VARCHAR}, </if> <if test="matchMode != null"> - #{matchMode,jdbcType=INTEGER}, + #{matchMode, jdbcType=INTEGER}, </if> <if test="sort != null"> - #{sort,jdbcType=INTEGER}, + #{sort, jdbcType=INTEGER}, </if> <if test="enabled != null"> - #{enabled,jdbcType=TINYINT}, + #{enabled, jdbcType=TINYINT}, </if> <if test="loged != null"> - #{loged,jdbcType=TINYINT}, + #{loged, jdbcType=TINYINT}, </if> <if test="handle != null"> - #{handle,jdbcType=VARCHAR}, + #{handle, jdbcType=VARCHAR}, </if> </trim> </insert> <update id="update" parameterType="org.apache.shenyu.admin.model.entity.RuleDO"> UPDATE rule - SET date_created = #{dateCreated,jdbcType=TIMESTAMP}, - date_updated = #{dateUpdated,jdbcType=TIMESTAMP}, - selector_id = #{selectorId,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - match_mode = #{matchMode,jdbcType=INTEGER}, - sort = #{sort,jdbcType=INTEGER}, - enabled = #{enabled,jdbcType=TINYINT}, - loged = #{loged,jdbcType=TINYINT}, - handle = #{handle,jdbcType=VARCHAR} - WHERE id = #{id,jdbcType=VARCHAR} + SET date_created = #{dateCreated, jdbcType=TIMESTAMP}, + date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, + selector_id = #{selectorId, jdbcType=VARCHAR}, + name = #{name, jdbcType=VARCHAR}, + match_mode = #{matchMode, jdbcType=INTEGER}, + sort = #{sort, jdbcType=INTEGER}, + enabled = #{enabled, jdbcType=TINYINT}, + loged = #{loged, jdbcType=TINYINT}, + handle = #{handle, jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </update> <update id="updateSelective" parameterType="org.apache.shenyu.admin.model.entity.RuleDO"> UPDATE rule <set> <if test="dateCreated != null"> - date_created = #{dateCreated,jdbcType=TIMESTAMP}, + date_created = #{dateCreated, jdbcType=TIMESTAMP}, </if> <if test="dateUpdated != null"> - date_updated = #{dateUpdated,jdbcType=TIMESTAMP}, + date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, </if> <if test="selectorId != null"> - selector_id = #{selectorId,jdbcType=VARCHAR}, + selector_id = #{selectorId, jdbcType=VARCHAR}, </if> <if test="name != null"> - name = #{name,jdbcType=VARCHAR}, + name = #{name, jdbcType=VARCHAR}, </if> <if test="matchMode != null"> - match_mode = #{matchMode,jdbcType=INTEGER}, + match_mode = #{matchMode, jdbcType=INTEGER}, </if> <if test="sort != null"> - sort = #{sort,jdbcType=INTEGER}, + sort = #{sort, jdbcType=INTEGER}, </if> <if test="enabled != null"> - enabled = #{enabled,jdbcType=TINYINT}, + enabled = #{enabled, jdbcType=TINYINT}, </if> <if test="loged != null"> - loged = #{loged,jdbcType=TINYINT}, + loged = #{loged, jdbcType=TINYINT}, </if> <if test="handle != null"> - handle = #{handle,jdbcType=VARCHAR}, + handle = #{handle, jdbcType=VARCHAR}, </if> </set> - WHERE id = #{id,jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </update> <delete id="delete" parameterType="java.lang.String"> - DELETE - FROM rule - WHERE id = #{id,jdbcType=VARCHAR} + DELETE FROM rule + WHERE id = #{id, jdbcType=VARCHAR} </delete> <delete id="deleteByIds" parameterType="java.util.List"> DELETE FROM rule - WHERE id IN - <foreach item="id" collection="list" open="(" separator="," close=")"> - #{id,jdbcType=VARCHAR} - </foreach> + WHERE id IN + <foreach item="id" collection="list" open="(" separator="," close=")"> + #{id, jdbcType=VARCHAR} + </foreach> </delete> </mapper> diff --git a/shenyu-admin/src/main/resources/mappers/selector-condition-sqlmap.xml b/shenyu-admin/src/main/resources/mappers/selector-condition-sqlmap.xml index 5e1019c07..4712d0a7e 100644 --- a/shenyu-admin/src/main/resources/mappers/selector-condition-sqlmap.xml +++ b/shenyu-admin/src/main/resources/mappers/selector-condition-sqlmap.xml @@ -79,14 +79,14 @@ param_name, param_value) VALUES - (#{id,jdbcType=VARCHAR}, - #{dateCreated,jdbcType=TIMESTAMP}, - #{dateUpdated,jdbcType=TIMESTAMP}, - #{selectorId,jdbcType=VARCHAR}, - #{paramType,jdbcType=VARCHAR}, - #{operator,jdbcType=VARCHAR}, - #{paramName,jdbcType=VARCHAR}, - #{paramValue,jdbcType=VARCHAR}) + (#{id, jdbcType=VARCHAR}, + #{dateCreated, jdbcType=TIMESTAMP}, + #{dateUpdated, jdbcType=TIMESTAMP}, + #{selectorId, jdbcType=VARCHAR}, + #{paramType, jdbcType=VARCHAR}, + #{operator, jdbcType=VARCHAR}, + #{paramName, jdbcType=VARCHAR}, + #{paramValue, jdbcType=VARCHAR}) </insert> <insert id="insertSelective" parameterType="org.apache.shenyu.admin.model.entity.SelectorConditionDO"> @@ -116,89 +116,86 @@ </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> - #{id,jdbcType=VARCHAR}, + #{id, jdbcType=VARCHAR}, <if test="dateCreated != null"> - #{dateCreated,jdbcType=TIMESTAMP}, + #{dateCreated, jdbcType=TIMESTAMP}, </if> <if test="dateUpdated != null"> - #{dateUpdated,jdbcType=TIMESTAMP}, + #{dateUpdated, jdbcType=TIMESTAMP}, </if> <if test="selectorId != null"> - #{selectorId,jdbcType=VARCHAR}, + #{selectorId, jdbcType=VARCHAR}, </if> <if test="paramType != null"> - #{paramType,jdbcType=VARCHAR}, + #{paramType, jdbcType=VARCHAR}, </if> <if test="operator != null"> - #{operator,jdbcType=VARCHAR}, + #{operator, jdbcType=VARCHAR}, </if> <if test="paramName != null"> - #{paramName,jdbcType=VARCHAR}, + #{paramName, jdbcType=VARCHAR}, </if> <if test="paramValue != null"> - #{paramValue,jdbcType=VARCHAR}, + #{paramValue, jdbcType=VARCHAR}, </if> </trim> </insert> <update id="update" parameterType="org.apache.shenyu.admin.model.entity.SelectorConditionDO"> UPDATE selector_condition - SET date_created = #{dateCreated,jdbcType=TIMESTAMP}, - date_updated = #{dateUpdated,jdbcType=TIMESTAMP}, - selector_id = #{selectorId,jdbcType=VARCHAR}, - param_type = #{paramType,jdbcType=VARCHAR}, - operator = #{operator,jdbcType=VARCHAR}, - param_name = #{paramName,jdbcType=VARCHAR}, - param_value = #{paramValue,jdbcType=VARCHAR} - WHERE id = #{id,jdbcType=VARCHAR} + SET date_created = #{dateCreated, jdbcType=TIMESTAMP}, + date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, + selector_id = #{selectorId, jdbcType=VARCHAR}, + param_type = #{paramType, jdbcType=VARCHAR}, + operator = #{operator, jdbcType=VARCHAR}, + param_name = #{paramName, jdbcType=VARCHAR}, + param_value = #{paramValue, jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </update> <update id="updateSelective" parameterType="org.apache.shenyu.admin.model.entity.SelectorConditionDO"> UPDATE selector_condition <set> <if test="dateCreated != null"> - date_created = #{dateCreated,jdbcType=TIMESTAMP}, + date_created = #{dateCreated, jdbcType=TIMESTAMP}, </if> <if test="dateUpdated != null"> - date_updated = #{dateUpdated,jdbcType=TIMESTAMP}, + date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, </if> <if test="selectorId != null"> - selector_id = #{selectorId,jdbcType=VARCHAR}, + selector_id = #{selectorId, jdbcType=VARCHAR}, </if> <if test="paramType != null"> - param_type = #{paramType,jdbcType=VARCHAR}, + param_type = #{paramType, jdbcType=VARCHAR}, </if> <if test="operator != null"> - operator = #{operator,jdbcType=VARCHAR}, + operator = #{operator, jdbcType=VARCHAR}, </if> <if test="paramName != null"> - param_name = #{paramName,jdbcType=VARCHAR}, + param_name = #{paramName, jdbcType=VARCHAR}, </if> <if test="paramValue != null"> - param_value = #{paramValue,jdbcType=VARCHAR}, + param_value = #{paramValue, jdbcType=VARCHAR}, </if> </set> - WHERE id = #{id,jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </update> <delete id="delete" parameterType="java.lang.String"> - DELETE - FROM selector_condition - WHERE id = #{id,jdbcType=VARCHAR} + DELETE FROM selector_condition + WHERE id = #{id, jdbcType=VARCHAR} </delete> <delete id="deleteBySelectorIds" parameterType="java.util.List"> - DELETE - FROM selector_condition - WHERE selector_id in - <foreach item="selectorId" collection="list" open="(" separator="," close=")"> - #{selectorId,jdbcType=VARCHAR} - </foreach> + DELETE FROM selector_condition + WHERE selector_id IN + <foreach item="selectorId" collection="list" open="(" separator="," close=")"> + #{selectorId, jdbcType=VARCHAR} + </foreach> </delete> <delete id="deleteByQuery" parameterType="org.apache.shenyu.admin.model.query.SelectorConditionQuery"> - DELETE - FROM selector_condition - WHERE selector_id = #{selectorId,jdbcType=VARCHAR} + DELETE FROM selector_condition + WHERE selector_id = #{selectorId, jdbcType=VARCHAR} </delete> </mapper> diff --git a/shenyu-admin/src/main/resources/mappers/selector-sqlmap.xml b/shenyu-admin/src/main/resources/mappers/selector-sqlmap.xml index 7aa0f71fa..096f62f90 100644 --- a/shenyu-admin/src/main/resources/mappers/selector-sqlmap.xml +++ b/shenyu-admin/src/main/resources/mappers/selector-sqlmap.xml @@ -50,48 +50,48 @@ <select id="selectById" parameterType="java.lang.String" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> + <include refid="Base_Column_List"/> FROM selector - WHERE id = #{id,jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </select> <select id="selectByIdSet" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> + <include refid="Base_Column_List"/> FROM selector - WHERE id in - <foreach collection="idSet" item="id" index="index" open="(" separator="," close=")"> - #{id,jdbcType=VARCHAR} - </foreach> + WHERE id IN + <foreach collection="idSet" item="id" index="index" open="(" separator="," close=")"> + #{id, jdbcType=VARCHAR} + </foreach> </select> <select id="selectByName" parameterType="java.lang.String" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> + <include refid="Base_Column_List"/> FROM selector - WHERE name = #{name,jdbcType=VARCHAR} + WHERE name = #{name, jdbcType=VARCHAR} </select> <select id="findByNameAndPluginId" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> + <include refid="Base_Column_List"/> FROM selector - WHERE name = #{name,jdbcType=VARCHAR} - AND plugin_id = #{pluginId,jdbcType=VARCHAR} + WHERE name = #{name, jdbcType=VARCHAR} + AND plugin_id = #{pluginId, jdbcType=VARCHAR} </select> <select id="selectByQuery" parameterType="org.apache.shenyu.admin.model.query.SelectorQuery" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> - FROM selector + <include refid="Base_Column_List"/> + FROM selector <where> <if test="pluginId != null"> - plugin_id = #{pluginId,jdbcType=VARCHAR} + plugin_id = #{pluginId, jdbcType=VARCHAR} </if> <if test="name != null and name != ''"> <bind name="nameLike" value="('%' + name + '%')"/> - AND name LIKE #{nameLike,jdbcType=VARCHAR} + AND name LIKE #{nameLike, jdbcType=VARCHAR} </if> <if test="filterIds != null"> AND id IN @@ -104,31 +104,31 @@ <select id="findByPluginId" parameterType="java.lang.String" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> + <include refid="Base_Column_List"/> FROM selector - WHERE plugin_id = #{pluginId,jdbcType=VARCHAR} + WHERE plugin_id = #{pluginId, jdbcType=VARCHAR} </select> <select id="findByPluginIds" parameterType="java.util.List" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> - FROM selector - WHERE plugin_id in + <include refid="Base_Column_List"/> + FROM selector + WHERE plugin_id IN <foreach item="id" collection="list" open="(" separator="," close=")"> - #{id,jdbcType=VARCHAR} + #{id, jdbcType=VARCHAR} </foreach> </select> <select id="countByQuery" parameterType="org.apache.shenyu.admin.model.query.SelectorQuery" resultType="java.lang.Integer"> SELECT COUNT(1) - FROM selector + FROM selector <where> <if test="pluginId != null"> - plugin_id = #{pluginId,jdbcType=VARCHAR} + plugin_id = #{pluginId, jdbcType=VARCHAR} </if> <if test="name != null and name != ''"> - AND name = #{name,jdbcType=VARCHAR} + AND name = #{name, jdbcType=VARCHAR} </if> <if test="filterIds != null"> AND id IN @@ -142,7 +142,7 @@ <select id="selectAll" resultType="org.apache.shenyu.admin.model.entity.SelectorDO" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> + <include refid="Base_Column_List"/> FROM selector </select> @@ -168,18 +168,18 @@ continued, handle) VALUES - (#{id,jdbcType=VARCHAR}, - #{dateCreated,jdbcType=TIMESTAMP}, - #{dateUpdated,jdbcType=TIMESTAMP}, - #{pluginId,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, - #{matchMode,jdbcType=INTEGER}, - #{type,jdbcType=INTEGER}, - #{sort,jdbcType=INTEGER}, - #{enabled,jdbcType=TINYINT}, - #{loged,jdbcType=TINYINT}, - #{continued,jdbcType=TINYINT}, - #{handle,jdbcType=VARCHAR}) + (#{id, jdbcType=VARCHAR}, + #{dateCreated, jdbcType=TIMESTAMP}, + #{dateUpdated, jdbcType=TIMESTAMP}, + #{pluginId, jdbcType=VARCHAR}, + #{name, jdbcType=VARCHAR}, + #{matchMode, jdbcType=INTEGER}, + #{type, jdbcType=INTEGER}, + #{sort, jdbcType=INTEGER}, + #{enabled, jdbcType=TINYINT}, + #{loged, jdbcType=TINYINT}, + #{continued, jdbcType=TINYINT}, + #{handle, jdbcType=VARCHAR}) </insert> <insert id="insertSelective" parameterType="org.apache.shenyu.admin.model.entity.SelectorDO"> @@ -221,115 +221,115 @@ </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> - #{id,jdbcType=VARCHAR}, + #{id, jdbcType=VARCHAR}, <if test="dateCreated != null"> - #{dateCreated,jdbcType=TIMESTAMP}, + #{dateCreated, jdbcType=TIMESTAMP}, </if> <if test="dateUpdated != null"> - #{dateUpdated,jdbcType=TIMESTAMP}, + #{dateUpdated, jdbcType=TIMESTAMP}, </if> <if test="pluginId != null"> - #{pluginId,jdbcType=VARCHAR}, + #{pluginId, jdbcType=VARCHAR}, </if> <if test="name != null"> - #{name,jdbcType=VARCHAR}, + #{name, jdbcType=VARCHAR}, </if> <if test="matchMode != null"> - #{matchMode,jdbcType=INTEGER}, + #{matchMode, jdbcType=INTEGER}, </if> <if test="type != null"> - #{type,jdbcType=INTEGER}, + #{type, jdbcType=INTEGER}, </if> <if test="sort != null"> - #{sort,jdbcType=INTEGER}, + #{sort, jdbcType=INTEGER}, </if> <if test="enabled != null"> - #{enabled,jdbcType=TINYINT}, + #{enabled, jdbcType=TINYINT}, </if> <if test="loged != null"> - #{loged,jdbcType=TINYINT}, + #{loged, jdbcType=TINYINT}, </if> <if test="continued != null"> - #{continued,jdbcType=TINYINT}, + #{continued, jdbcType=TINYINT}, </if> <if test="handle != null"> - #{handle,jdbcType=VARCHAR}, + #{handle, jdbcType=VARCHAR}, </if> </trim> </insert> <update id="update" parameterType="org.apache.shenyu.admin.model.entity.SelectorDO"> UPDATE selector - SET - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - date_updated = #{dateUpdated,jdbcType=TIMESTAMP}, - plugin_id = #{pluginId,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - match_mode = #{matchMode,jdbcType=INTEGER}, - type = #{type,jdbcType=INTEGER}, - sort = #{sort,jdbcType=INTEGER}, - enabled = #{enabled,jdbcType=TINYINT}, - loged = #{loged,jdbcType=TINYINT}, - continued = #{continued,jdbcType=TINYINT}, - handle = #{handle,jdbcType=VARCHAR} - WHERE id = #{id,jdbcType=VARCHAR} + SET + date_created = #{dateCreated, jdbcType=TIMESTAMP}, + date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, + plugin_id = #{pluginId, jdbcType=VARCHAR}, + name = #{name, jdbcType=VARCHAR}, + match_mode = #{matchMode, jdbcType=INTEGER}, + type = #{type, jdbcType=INTEGER}, + sort = #{sort, jdbcType=INTEGER}, + enabled = #{enabled, jdbcType=TINYINT}, + loged = #{loged, jdbcType=TINYINT}, + continued = #{continued, jdbcType=TINYINT}, + handle = #{handle, jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </update> <update id="updateSelective" parameterType="org.apache.shenyu.admin.model.entity.SelectorDO"> UPDATE selector <set> <if test="dateCreated != null"> - date_created = #{dateCreated,jdbcType=TIMESTAMP}, + date_created = #{dateCreated, jdbcType=TIMESTAMP}, </if> <if test="dateUpdated != null"> - date_updated = #{dateUpdated,jdbcType=TIMESTAMP}, + date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, </if> <if test="pluginId != null"> - plugin_id = #{pluginId,jdbcType=VARCHAR}, + plugin_id = #{pluginId, jdbcType=VARCHAR}, </if> <if test="name != null"> - name = #{name,jdbcType=VARCHAR}, + name = #{name, jdbcType=VARCHAR}, </if> <if test="matchMode != null"> - match_mode = #{matchMode,jdbcType=INTEGER}, + match_mode = #{matchMode, jdbcType=INTEGER}, </if> <if test="type != null"> - type = #{type,jdbcType=INTEGER}, + type = #{type, jdbcType=INTEGER}, </if> <if test="sort != null"> - sort = #{sort,jdbcType=INTEGER}, + sort = #{sort, jdbcType=INTEGER}, </if> <if test="enabled != null"> - enabled = #{enabled,jdbcType=TINYINT}, + enabled = #{enabled, jdbcType=TINYINT}, </if> <if test="loged != null"> - loged = #{loged,jdbcType=TINYINT}, + loged = #{loged, jdbcType=TINYINT}, </if> <if test="continued != null"> - continued = #{continued,jdbcType=TINYINT}, + continued = #{continued, jdbcType=TINYINT}, </if> <if test="handle != null"> - handle = #{handle,jdbcType=VARCHAR}, + handle = #{handle, jdbcType=VARCHAR}, </if> </set> - WHERE id = #{id,jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </update> <delete id="delete" parameterType="java.lang.String"> DELETE FROM selector - WHERE id = #{id,jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </delete> <delete id="deleteByIds" parameterType="java.util.List"> DELETE FROM selector - WHERE id IN - <foreach item="id" collection="list" open="(" separator="," close=")"> - #{id,jdbcType=VARCHAR} - </foreach> + WHERE id IN + <foreach item="id" collection="list" open="(" separator="," close=")"> + #{id, jdbcType=VARCHAR} + </foreach> </delete> <delete id="deleteByPluginId" parameterType="java.lang.String"> DELETE FROM selector - WHERE plugin_id = #{pluginId,jdbcType=VARCHAR} + WHERE plugin_id = #{pluginId, jdbcType=VARCHAR} </delete> </mapper> diff --git a/shenyu-admin/src/main/resources/mappers/shenyu-dict-sqlmap.xml b/shenyu-admin/src/main/resources/mappers/shenyu-dict-sqlmap.xml index d1712d12f..7773f6cee 100644 --- a/shenyu-admin/src/main/resources/mappers/shenyu-dict-sqlmap.xml +++ b/shenyu-admin/src/main/resources/mappers/shenyu-dict-sqlmap.xml @@ -72,21 +72,21 @@ FROM shenyu_dict WHERE `type` IN <foreach collection="typeSet" item="type" open="(" separator="," close=")"> - #{type,jdbcType=VARCHAR} + #{type, jdbcType=VARCHAR} </foreach> </select> <delete id="delete" parameterType="java.lang.String"> DELETE FROM shenyu_dict - WHERE id = #{id,jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </delete> <delete id="deleteByIdList"> DELETE FROM shenyu_dict WHERE id IN - <foreach collection="idList" item="id" index="index" open="(" separator="," close=")"> - #{id,jdbcType=VARCHAR} - </foreach> + <foreach collection="idList" item="id" index="index" open="(" separator="," close=")"> + #{id, jdbcType=VARCHAR} + </foreach> </delete> <insert id="insert" parameterType="org.apache.shenyu.admin.model.entity.ShenyuDictDO"> @@ -101,16 +101,16 @@ enabled, date_created, date_updated) - VALUES (#{id,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, - #{dictCode,jdbcType=VARCHAR}, - #{dictName,jdbcType=VARCHAR}, - #{dictValue,jdbcType=VARCHAR}, - #{desc,jdbcType=VARCHAR}, - #{sort,jdbcType=INTEGER}, - #{enabled,jdbcType=TINYINT}, - #{dateCreated,jdbcType=TIMESTAMP}, - #{dateUpdated,jdbcType=TIMESTAMP}) + VALUES (#{id, jdbcType=VARCHAR}, + #{type, jdbcType=VARCHAR}, + #{dictCode, jdbcType=VARCHAR}, + #{dictName, jdbcType=VARCHAR}, + #{dictValue, jdbcType=VARCHAR}, + #{desc, jdbcType=VARCHAR}, + #{sort, jdbcType=INTEGER}, + #{enabled, jdbcType=TINYINT}, + #{dateCreated, jdbcType=TIMESTAMP}, + #{dateUpdated, jdbcType=TIMESTAMP}) </insert> <insert id="insertSelective" parameterType="org.apache.shenyu.admin.model.entity.ShenyuDictDO"> @@ -149,34 +149,34 @@ </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null"> - #{id,jdbcType=VARCHAR}, + #{id, jdbcType=VARCHAR}, </if> <if test="type != null"> - #{type,jdbcType=VARCHAR}, + #{type, jdbcType=VARCHAR}, </if> <if test="dictCode != null"> - #{dictCode,jdbcType=VARCHAR}, + #{dictCode, jdbcType=VARCHAR}, </if> <if test="dictName != null"> - #{dictName,jdbcType=VARCHAR}, + #{dictName, jdbcType=VARCHAR}, </if> <if test="dictValue != null"> - #{dictValue,jdbcType=VARCHAR}, + #{dictValue, jdbcType=VARCHAR}, </if> <if test="desc != null"> - #{desc,jdbcType=VARCHAR}, + #{desc, jdbcType=VARCHAR}, </if> <if test="sort != null"> - #{sort,jdbcType=INTEGER}, + #{sort, jdbcType=INTEGER}, </if> <if test="enabled != null"> - #{enabled,jdbcType=TINYINT}, + #{enabled, jdbcType=TINYINT}, </if> <if test="dateCreated != null"> - #{dateCreated,jdbcType=TIMESTAMP}, + #{dateCreated, jdbcType=TIMESTAMP}, </if> <if test="dateUpdated != null"> - #{dateUpdated,jdbcType=TIMESTAMP}, + #{dateUpdated, jdbcType=TIMESTAMP}, </if> </trim> </insert> @@ -184,48 +184,48 @@ UPDATE shenyu_dict <set> <if test="type != null"> - `type` = #{type,jdbcType=VARCHAR}, + `type` = #{type, jdbcType=VARCHAR}, </if> <if test="dictCode != null"> - dict_code = #{dictCode,jdbcType=VARCHAR}, + dict_code = #{dictCode, jdbcType=VARCHAR}, </if> <if test="dictName != null"> - dict_name = #{dictName,jdbcType=VARCHAR}, + dict_name = #{dictName, jdbcType=VARCHAR}, </if> <if test="dictValue != null"> - dict_value = #{dictValue,jdbcType=VARCHAR}, + dict_value = #{dictValue, jdbcType=VARCHAR}, </if> <if test="desc != null"> - `desc` = #{desc,jdbcType=VARCHAR}, + `desc` = #{desc, jdbcType=VARCHAR}, </if> <if test="sort != null"> - sort= #{sort,jdbcType=INTEGER}, + sort= #{sort, jdbcType=INTEGER}, </if> <if test="enabled != null"> - enabled= #{enabled,jdbcType=TINYINT}, + enabled= #{enabled, jdbcType=TINYINT}, </if> <if test="dateCreated != null"> - date_created = #{dateCreated,jdbcType=TIMESTAMP}, + date_created = #{dateCreated, jdbcType=TIMESTAMP}, </if> <if test="dateUpdated != null"> - date_updated = #{dateUpdated,jdbcType=TIMESTAMP}, + date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, </if> </set> - WHERE id = #{id,jdbcType=VARCHAR} + WHERE id = #{id, jdbcType=VARCHAR} </update> <update id="updateByPrimaryKey" parameterType="org.apache.shenyu.admin.model.entity.ShenyuDictDO"> UPDATE shenyu_dict - SET `type` = #{type,jdbcType=VARCHAR}, - dict_code = #{dictCode,jdbcType=VARCHAR}, - dict_name = #{dictName,jdbcType=VARCHAR}, - dict_value = #{dictValue,jdbcType=VARCHAR}, - `desc` = #{desc,jdbcType=VARCHAR}, - sort = #{sort,jdbcType=INTEGER}, - enabled = #{enabled,jdbcType=TINYINT}, - date_created = #{dateCreated,jdbcType=TIMESTAMP}, - date_updated = #{dateUpdated,jdbcType=TIMESTAMP} - WHERE id = #{id,jdbcType=VARCHAR} + SET `type` = #{type, jdbcType=VARCHAR}, + dict_code = #{dictCode, jdbcType=VARCHAR}, + dict_name = #{dictName, jdbcType=VARCHAR}, + dict_value = #{dictValue, jdbcType=VARCHAR}, + `desc` = #{desc, jdbcType=VARCHAR}, + sort = #{sort, jdbcType=INTEGER}, + enabled = #{enabled, jdbcType=TINYINT}, + date_created = #{dateCreated, jdbcType=TIMESTAMP}, + date_updated = #{dateUpdated, jdbcType=TIMESTAMP} + WHERE id = #{id, jdbcType=VARCHAR} </update> <select id="countByQuery" parameterType="org.apache.shenyu.admin.model.query.ShenyuDictQuery" @@ -234,13 +234,13 @@ FROM shenyu_dict <where> <if test="type != null and type != ''"> - AND `type` = #{type,jdbcType=VARCHAR} + AND `type` = #{type, jdbcType=VARCHAR} </if> <if test="dictCode != null and dictCode != ''"> - AND dict_code = #{dictCode,jdbcType=VARCHAR} + AND dict_code = #{dictCode, jdbcType=VARCHAR} </if> <if test="dictName != null and dictName != ''"> - AND dict_name = #{dictName,jdbcType=VARCHAR} + AND dict_name = #{dictName, jdbcType=VARCHAR} </if> </where> </select> @@ -248,21 +248,22 @@ <select id="selectByQuery" parameterType="org.apache.shenyu.admin.model.query.ShenyuDictQuery" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> + <include refid="Base_Column_List"/> FROM shenyu_dict <where> <if test="type != null and type != ''"> - AND `type` = #{type,jdbcType=VARCHAR} + AND `type` = #{type, jdbcType=VARCHAR} </if> <if test="dictCode != null and dictCode != ''"> - AND dict_code = #{dictCode,jdbcType=VARCHAR} + AND dict_code = #{dictCode, jdbcType=VARCHAR} </if> <if test="dictName != null and dictName != ''"> <bind name="dictNameLike" value="('%' + dictName + '%')"/> - AND dict_name LIKE #{dictNameLike,jdbcType=VARCHAR} + AND dict_name LIKE #{dictNameLike, jdbcType=VARCHAR} </if> </where> - ORDER BY `type`,sort ASC + ORDER BY `type`, + sort ASC </select> <select id="existed" resultType="java.lang.Boolean"> @@ -274,7 +275,7 @@ <update id="enabled"> UPDATE shenyu_dict - SET enabled = #{enabled,jdbcType=TINYINT} + SET enabled = #{enabled, jdbcType=TINYINT} WHERE id IN <foreach item="item" index="index" collection="ids" open="(" separator="," close=")"> #{item} diff --git a/shenyu-admin/src/main/resources/mappers/user-role-sqlmap.xml b/shenyu-admin/src/main/resources/mappers/user-role-sqlmap.xml index 232edb4ef..efa7b08c8 100644 --- a/shenyu-admin/src/main/resources/mappers/user-role-sqlmap.xml +++ b/shenyu-admin/src/main/resources/mappers/user-role-sqlmap.xml @@ -43,7 +43,7 @@ <select id="findByUserId" parameterType="java.lang.String" resultMap="BaseResultMap"> SELECT - <include refid="Base_Column_List"/> + <include refid="Base_Column_List"/> FROM user_role WHERE user_id = #{userId, jdbcType=VARCHAR} </select>
