update t_tjxx t set t.bndkcount =(select tmp2.count from (select count(1) as count,g.organcode as organcode from meeting_main g where TO_CHAR(g.BEGINTIME, 'yyyy') = TO_CHAR(SYSDATE, 'yyyy') AND g.TYPEID = 4 group by g.organcode) tmp2 where t.organcode = tmp2.organcode) where exists (select tmp2.count from (select count(1) as count,g.organcode as organcode from meeting_main g where TO_CHAR(g.BEGINTIME, 'yyyy') = TO_CHAR(SYSDATE, 'yyyy') AND g.TYPEID = 4 group by g.organcode) tmp2 where t.organcode = tmp2.organcode);commit;
update t_tjxx t
set t.bndkcount =(select tmp2.count from
(select count(1) as count,g.organcode as organcode
from meeting_main g
where TO_CHAR(g.BEGINTIME, 'yyyy') = TO_CHAR(SYSDATE, 'yyyy')
AND g.TYPEID = 4
group by g.organcode) tmp2 where t.organcode = tmp2.organcode)
where exists
(select tmp2.count from
(select count(1) as count,g.organcode as organcode
from meeting_main g
where TO_CHAR(g.BEGINTIME, 'yyyy') = TO_CHAR(SYSDATE, 'yyyy')
AND g.TYPEID = 4
group by g.organcode) tmp2 where t.organcode = tmp2.organcode);
commit;
update t_tjxx xx
set xx.bjdydhcount =
(select tmp2.count
from (SELECT COUNT(G.UUID) AS COUNT, g.organcode as organcode
FROM MEETING_MAIN G
WHERE G.TYPEID = 1
and TO_CHAR(G.BEGINTIME, 'Q') = to_char(SYSDATE, 'Q')
group by g.organcode) tmp2
where xx.organcode = tmp2.organcode)
where exists
(select tmp2.count
from (SELECT COUNT(G.UUID) AS COUNT, g.organcode as organcode
FROM MEETING_MAIN G
WHERE G.TYPEID = 1
and TO_CHAR(G.BEGINTIME, 'Q') = to_char(SYSDATE, 'Q')
group by g.organcode) tmp2
where xx.organcode = tmp2.organcode);
commit;