@Query(name="tmAuthorize.findByManagerIdNotRole",nativeQuery=true,value="select * from SA_TMAuthorize where manager_Id = :managerId and role_kind_id <> :roleKindId and rownum=1")
@Query(name="tmAuthorize.findByManagerIdNotRole",nativeQuery=true,value="select * from SA_TMAuthorize where manager_Id = :managerId and role_kind_id <> :roleKindId and rownum=1")
@Query(name="tmAuthorize.findBySubordinationIdAndManagerId",nativeQuery=true,value="select * from SA_TMAuthorize where subordination_Id = :subordinationId and manager_Id = :managerId and rownum=1")
@Query(name="tmAuthorize.findBySubordinationIdAndManagerId",nativeQuery=true,value="select * from SA_TMAuthorize where subordination_Id = :subordinationId and manager_Id = :managerId and rownum=1")
@Query(name="tmAuthorize.findOneTMAuthorize",nativeQuery=true,value="select * from SA_TMAuthorize where (:subordinationFullId like subordination_full_id || '%' or subordination_full_id like :subordinationFullId || '%') and (system_id = :systemId or system_id = '*') and role_kind_id = :roleKindId and manager_Id = :managerId")
@Query(name="tmAuthorize.findOneTMAuthorize",value="from TMAuthorize where (:subordinationFullId like CONCAT(subordinationFullId,'%') or subordinationFullId like CONCAT(:subordinationFullId,'%')) and (systemId = :systemId or systemId = '*') and roleKindId = :roleKindId and managerId = :managerId")
@Query(name="tmAuthorize.findOneTMAuthorize2",nativeQuery=true,value="select * from SA_TMAuthorize where subordination_id = :subordinationId and system_id = :systemId and manager_id = :managerId and rownum=1")
@Query(name="tmAuthorize.findOneTMAuthorize2",nativeQuery=true,value="select * from SA_TMAuthorize where subordination_id = :subordinationId and system_id = :systemId and manager_id = :managerId and rownum=1")
@@ -13,7 +13,7 @@ public interface PersonQuerySchemeRepository extends JpaRepository<PersonQuerySc
...
@@ -13,7 +13,7 @@ public interface PersonQuerySchemeRepository extends JpaRepository<PersonQuerySc
@Query(name="personQuery.findPersonQuerySchemes",value="select o from PersonQueryScheme o where personId = :personId and kindId = :kindId order by sequence")
@Query(name="personQuery.findPersonQuerySchemes",value="select o from PersonQueryScheme o where personId = :personId and kindId = :kindId order by sequence")
@Query(name="personQuery.getMaxSequence",value="select nvl(max(sequence), 0) from PersonQueryScheme o where o.personId = :personId and o.kindId = :kindId")
@Query(name="personQuery.getMaxSequence",value="select coalesce(max(sequence), 0) from PersonQueryScheme o where o.personId = :personId and o.kindId = :kindId")
@Query(name="procUnitHandler.findNextGroupProcUnitHandlers",value="select t from ProcUnitHandler t where t.bizId = :bizId\n"
@Query(name="procUnitHandler.findNextGroupProcUnitHandlers",value="select t from ProcUnitHandler t where t.bizId = :bizId\n"
+" and t.procUnitId = :procUnitId\n"+" and status = 0\n"+" and nvl(result, 0) != 4\n"+" and cooperationModelId != 'cc'\n"
+" and t.procUnitId = :procUnitId\n"+" and status = 0\n"+" and coalesce(result, 0) != 4\n"+" and cooperationModelId != 'cc'\n"
+" and groupId = (select min(o.groupId)\n"+" from ProcUnitHandler o\n"+" where o.bizId = :bizId\n"
+" and groupId = (select min(o.groupId)\n"+" from ProcUnitHandler o\n"+" where o.bizId = :bizId\n"
+" and cooperationModelId != 'cc'\n"+" and o.procUnitId = :procUnitId\n"
+" and cooperationModelId != 'cc'\n"+" and o.procUnitId = :procUnitId\n"
+" and o.status = 0\n"+" and o.groupId > :groupId)")
+" and o.status = 0\n"+" and o.groupId > :groupId)")
...
@@ -82,16 +82,16 @@ public interface ProcUnitHandlerRepository extends JpaRepository<ProcUnitHandler
...
@@ -82,16 +82,16 @@ public interface ProcUnitHandlerRepository extends JpaRepository<ProcUnitHandler
@Query(name="procUnitHandler.getMaxGrouId",value="select max(groupId) from ProcUnitHandler o where o.bizId = :bizId and o.procUnitId = :procUnitId and cooperationModelId = 'chief'")
@Query(name="procUnitHandler.getMaxGrouId",value="select max(groupId) from ProcUnitHandler o where o.bizId = :bizId and o.procUnitId = :procUnitId and cooperationModelId = 'chief'")
@Query(name="procUnitHandler.getExecutionTimes",value="select nvl(max(executionTimes), 0) from ProcUnitHandler o where o.bizId = :bizId and o.procUnitId = :procUnitId and cooperationModelId = 'chief'")
@Query(name="procUnitHandler.getExecutionTimes",value="select coalesce(max(executionTimes), 0) from ProcUnitHandler o where o.bizId = :bizId and o.procUnitId = :procUnitId and cooperationModelId = 'chief'")
@Query(name="procUnitHandler.getMaxSequence",value="select nvl(max(sequence), 0) from ProcUnitHandler o where o.bizId = :bizId and o.procUnitId = :procUnitId and cooperationModelId = 'chief'")
@Query(name="procUnitHandler.getMaxSequence",value="select coalesce(max(sequence), 0) from ProcUnitHandler o where o.bizId = :bizId and o.procUnitId = :procUnitId and cooperationModelId = 'chief'")
@Query(name="procUnitHandler.deleteWithdrawSucceedingHandlers",nativeQuery=true,value="delete from wf_procunithandler t where t.id in (select i.proc_unit_handler_id_ from act_hi_taskinst_extension i where i.business_key_ = :bizId and i.previous_id_ = :taskId)")
@Query(name="procUnitHandler.deleteWithdrawSucceedingHandlers",value="delete from ProcUnitHandler t where t.id in (select i.procUnitHandlerId from HistoricTaskInstExtension i where i.businessKey = :bizId and i.previousId = :taskId)")