jackfanwan commented on code in PR #13106:
URL: 
https://github.com/apache/dolphinscheduler/pull/13106#discussion_r1040592736


##########
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskDefinitionMapper.xml:
##########
@@ -109,28 +109,35 @@
         </foreach>
     </insert>
     <select id="queryDefineListPaging" 
resultType="org.apache.dolphinscheduler.dao.entity.TaskMainInfo">
-        select td.name task_name,td.code task_code,td.version 
task_version,td.task_type,td.create_time task_create_time,td.update_time 
task_update_time,
-        pd.code process_definition_code,pd.version 
process_definition_version,pd.name process_definition_name,pd.release_state 
process_release_state,
-        pt.pre_task_code upstream_task_code,up.name upstream_task_name
+        select td.code        task_code
         from t_ds_task_definition td
-        LEFT JOIN t_ds_process_task_relation pt ON td.code     = 
pt.post_task_code and td.version=pt.post_task_version
-        LEFT JOIN t_ds_process_definition pd ON pt.process_definition_code = 
pd.code and pt.process_definition_version=pd.version
-        LEFT JOIN t_ds_task_definition up on pt.pre_task_code=up.code and 
pt.pre_task_version=up.version
         WHERE td.project_code = #{projectCode}
         <if test="taskType != ''">
             and td.task_type = #{taskType}
         </if>
         <if test="taskExecuteType != null">
             and td.task_execute_type = #{taskExecuteType.code}
         </if>
-        <if test="searchWorkflowName != null and searchWorkflowName != ''">
-            and pd.name like concat('%', #{searchWorkflowName}, '%')
-        </if>
         <if test="searchTaskName != null and searchTaskName != ''">
             and td.name like concat('%', #{searchTaskName}, '%')
         </if>
         order by td.update_time desc
     </select>
+
+    <select id="queryDefineListByCodeList" 
resultType="org.apache.dolphinscheduler.dao.entity.TaskMainInfo">
+        select td.name task_name,td.code task_code,td.version 
task_version,td.task_type,td.create_time task_create_time,td.update_time 
task_update_time,
+        pd.code process_definition_code,pd.version 
process_definition_version,pd.name process_definition_name,pd.release_state 
process_release_state,
+        pt.pre_task_code upstream_task_code,up.name upstream_task_name
+        from t_ds_task_definition td
+        LEFT JOIN t_ds_process_task_relation pt ON td.code     = 
pt.post_task_code and td.version=pt.post_task_version
+        LEFT JOIN t_ds_process_definition pd ON pt.process_definition_code = 
pd.code and pt.process_definition_version=pd.version
+        LEFT JOIN t_ds_task_definition up on pt.pre_task_code=up.code and 
pt.pre_task_version=up.version
+        WHERE td.project_code = #{projectCode} and td.code in
+        <foreach collection="codeList" item="code" open="(" separator="," 
close=")">
+            #{code}
+        </foreach>
+    </select>

Review Comment:
   > I think we don't need this query now, you can use like 
`queryUpstreamByCodes` to find the upstream codes and their workflow info.
   
   because need process definition name, but queryByProcessCode hav't this, so 
i add new query



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