Commit eb412f8f authored by 雍欢's avatar 雍欢

修复MySQL数据库下无法正常删除组织和清除回收站

parent dfd95268
...@@ -9,6 +9,24 @@ ...@@ -9,6 +9,24 @@
and (o.org_Kind_Id != 'psm' or and (o.org_Kind_Id != 'psm' or
(select p.status from SA_OPPerson p where p.id = o.person_Id) >= :newStatus) (select p.status from SA_OPPerson p where p.id = o.person_Id) >= :newStatus)
</sql> </sql>
<sql name="subordinatePsm">
select id
from
SA_OPOrg o
where o.org_Kind_Id = 'psm'
and o.status in (:oldStatus)
and (select p.status from SA_OPOrg p where p.id = o.parent_Id) >= :newStatus
and exists (select 1
from SA_OPPerson person, SA_OPOrg org
where person.status = :newStatus
and org.org_Kind_Id = 'psm'
and org.status in (:oldStatus)
and org.full_Id like :fullId
and person.main_Org_Id = org.parent_Id
and person.id = org.person_Id
and o.person_Id = person.id
and o.parent_Id != person.main_Org_Id)
</sql>
<sql name="updateSubordinatePsmStatus"> <sql name="updateSubordinatePsmStatus">
update SA_OPOrg o update SA_OPOrg o
set o.status = :newStatus, o.version = (select next_sequence('version_seq')) set o.status = :newStatus, o.version = (select next_sequence('version_seq'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment