You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/01/14 09:17:44 UTC

[GitHub] [incubator-dolphinscheduler] zhuangchong commented on a change in pull request #4442: [Feature-4428][dao、UI] It is recommended to add an owner in the data source center and the Resource Center to make it easier to manage

zhuangchong commented on a change in pull request #4442:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/4442#discussion_r557247083



##########
File path: dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/DataSourceMapper.xml
##########
@@ -40,11 +40,14 @@
 
     <select id="selectPaging" resultType="org.apache.dolphinscheduler.dao.entity.DataSource">
         select
-        <include refid="baseSql"/>
-        from t_ds_datasource
+        d.id, d.name, d.note, d.type, d.user_id, connection_params, d.create_time, d.update_time
+        ,
+        u.user_name as user_name
+        from t_ds_datasource d
+        join t_ds_user u on d.user_id = u.id

Review comment:
       Can this part be changed as follows?
   
   ```
   <sql id="baseSql">
           ${alias}.id, ${alias}.name, ${alias}.type, ${alias}.user_id, ${alias}.connection_params, ${alias}.create_time, ${alias}.update_time
       </sql>
       
       <select id="queryDataSourceByType" resultType="org.apache.dolphinscheduler.dao.entity.DataSource">
           select
           <include refid="baseSql">
               <property name="alias" value="d"/>
           </include>
           ,
           u.user_name as user_name
           from t_ds_datasource d
           join t_ds_user u on d.user_id = u.id
           where d.type=#{type}
           <if test="userId != 0">
               and d.id in
               (select datasource_id
               from t_ds_relation_datasource_user
               where user_id=#{userId}
               union select id as datasource_id
               from t_ds_datasource
               where user_id=#{userId}
               )
           </if>
       </select>
   ```




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org