[Improvement][dao] Optimized countInstanceStateByProjectCodes (#13273)

This commit is contained in:
陈家名 2022-12-28 14:31:21 +08:00 committed by GitHub
parent 6627c38be5
commit 5077fa6aae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View File

@ -178,14 +178,12 @@
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
where t.is_sub_process = 0
<if test="startTime != null and endTime != null">
and t.start_time <![CDATA[ >= ]]> #{startTime} and t.start_time <![CDATA[ <= ]]> #{endTime}
</if>
<if test="projectCodes != null and projectCodes.length != 0">
and p.code in
and d.project_code in
<foreach collection="projectCodes" index="index" item="i" open="(" close=")" separator=",">
#{i}
</foreach>

View File

@ -123,7 +123,6 @@
state, count(0) as count
from t_ds_task_instance t
left join t_ds_task_definition_log d on d.code=t.task_code and d.version=t.task_definition_version
left join t_ds_project p on p.code=d.project_code
where 1=1
<if test="states != null and states.size != 0">
and t.state in