SELECT DISTINCTt1.ID_ AS taskId,t1.NAME_ AS taskName,t2.NAME_ AS formName,t2.TENANT_ID_ AS systemSn,t2.BUSINESS_KEY_ AS businessKey,t2.PROC_INST_ID_ AS processInstanceId,t1.CREATE_TIME_ AS startTimeFROMact_ru_task t1INNER JOIN act_ru_execution t2 ON t1.PROC_INST_ID_ = t2.PROC_INST_ID_LEFT JOIN act_ru_identitylink t3 ON t3.TASK_ID_ = t1.ID_WHEREt2.BUSINESS_KEY_ IS NOT NULLAND (t1.ASSIGNEE_ = #{userCode}OR (t1.ASSIGNEE_ IN (SELECTG.group_id_FROMact_id_membership GWHEREG.user_id_ = #{userCode}))OR ((t1.ASSIGNEE_ IS NULLOR t1.ASSIGNEE_ = '')AND (t3.USER_ID_ = #{userCode}OR t3.GROUP_ID_ IN (SELECTg.group_id_FROMact_id_membership gWHEREg.user_id_ = #{userCode}))))