insist777 commented on code in PR #13031:
URL: 
https://github.com/apache/dolphinscheduler/pull/13031#discussion_r1035413516


##########
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessInstanceMapper.xml:
##########
@@ -308,6 +308,30 @@
         </if>
         order by instance.start_time desc,instance.id desc
     </select>
+    <select id="countInstanceStateV2" 
resultType="org.apache.dolphinscheduler.dao.entity.ExecuteStatusCount">
+        select t.state, count(0) as count
+        from t_ds_process_instance t
+        join t_ds_process_definition d on d.code=t.process_definition_code
+        join t_ds_project p on p.code=d.project_code
+        where 1 = 1
+        and t.is_sub_process = 0
+        <if test="projectIds != null and projectIds.size() != 0">
+            and p.id in
+            <foreach collection="projectIds" index="index" item="i" open="(" 
close=")" separator=",">
+                #{i}
+            </foreach>
+        </if>
+        <if test="startTime != null and endTime != null">
+            and t.start_time <![CDATA[ >= ]]> #{startTime} and t.start_time 
<![CDATA[ <= ]]> #{endTime}
+        </if>
+        <if test="model >= 1">
+           and p.name = #{projectName}
+        </if>
+        <if test="model >= 2">
+            and d.name = #{workflowName}

Review Comment:
   done.



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