midnight2104 commented on a change in pull request #3089:
URL: https://github.com/apache/incubator-shenyu/pull/3089#discussion_r832736236



##########
File path: shenyu-admin/src/main/resources/mappers/user-role-sqlmap.xml
##########
@@ -27,46 +27,61 @@
     </resultMap>
 
     <sql id="Base_Column_List">
-        id, date_created, date_updated, user_id, role_id
+        id,
+        date_created,
+        date_updated,
+        user_id,
+        role_id
     </sql>
 
     <select id="selectById" parameterType="java.lang.String" 
resultMap="BaseResultMap">
-        select
-        <include refid="Base_Column_List"/>
-        from user_role
-        where id = #{id,jdbcType=VARCHAR}
+        SELECT
+               <include refid="Base_Column_List"/>
+          FROM user_role
+        WHERE id = #{id, jdbcType=VARCHAR}
     </select>
 
     <select id="findByUserId" parameterType="java.lang.String" 
resultMap="BaseResultMap">
-        select
-        <include refid="Base_Column_List"/>
-        from user_role
-        where user_id = #{userId,jdbcType=VARCHAR}
+        SELECT
+               <include refid="Base_Column_List"/>
+          FROM user_role
+        WHERE user_id = #{userId, jdbcType=VARCHAR}
     </select>
 
     <insert id="insert" 
parameterType="org.apache.shenyu.admin.model.entity.UserRoleDO">
-        insert into user_role (id, date_created, date_updated,
-        user_id, role_id)
-        values (#{id,jdbcType=VARCHAR}, #{dateCreated,jdbcType=TIMESTAMP}, 
#{dateUpdated,jdbcType=TIMESTAMP},
-        #{userId,jdbcType=VARCHAR}, #{roleId,jdbcType=VARCHAR})
+        INSERT INTO user_role
+                    (id,
+                     date_created,
+                     date_updated,
+                     user_id,
+                     role_id)
+               VALUES
+                    (#{id, jdbcType=VARCHAR},
+                     #{dateCreated, jdbcType=TIMESTAMP},
+                     #{dateUpdated, jdbcType=TIMESTAMP},
+                     #{userId, jdbcType=VARCHAR},
+                     #{roleId, jdbcType=VARCHAR})
     </insert>
 
     <insert id="insertBatch">
-        insert into user_role (id, user_id, role_id)
-        values
-        <foreach collection="userRoleList" index="index" item="userRole" 
separator=",">
-            (
-            #{userRole.id,jdbcType=VARCHAR},
-            #{userRole.userId,jdbcType=VARCHAR},
-            #{userRole.roleId,jdbcType=VARCHAR}
-            )
-        </foreach>
+        INSERT INTO user_role

Review comment:
       The keywords `INSERT INTO` are not right-aligned




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to