|
|
@@ -0,0 +1,125 @@
|
|
|
+set define off
|
|
|
+whenever sqlerror exit sql.sqlcode
|
|
|
+
|
|
|
+alter session set container=ORCLPDB;
|
|
|
+
|
|
|
+declare
|
|
|
+ v_count number;
|
|
|
+ v_parent_id number;
|
|
|
+begin
|
|
|
+ select count(*)
|
|
|
+ into v_count
|
|
|
+ from PMS_TEST.RY
|
|
|
+ where RYID = 111148259
|
|
|
+ and RYH = 'T21270';
|
|
|
+ if v_count <> 1 then
|
|
|
+ raise_application_error(-20001, '未找到唯一的古绿晖账号');
|
|
|
+ end if;
|
|
|
+
|
|
|
+ select count(*)
|
|
|
+ into v_count
|
|
|
+ from PMS_TEST.GRCD
|
|
|
+ where YYRYID = 111148259
|
|
|
+ and MC = '班级评比'
|
|
|
+ and SJGRCDID is null;
|
|
|
+ if v_count <> 1 then
|
|
|
+ raise_application_error(-20002, '古绿晖班级评比父菜单异常');
|
|
|
+ end if;
|
|
|
+
|
|
|
+ select GRCDID
|
|
|
+ into v_parent_id
|
|
|
+ from PMS_TEST.GRCD
|
|
|
+ where YYRYID = 111148259
|
|
|
+ and MC = '班级评比'
|
|
|
+ and SJGRCDID is null;
|
|
|
+
|
|
|
+ select count(*)
|
|
|
+ into v_count
|
|
|
+ from all_tables
|
|
|
+ where owner = 'PMS_TEST'
|
|
|
+ and table_name = 'BAK_20261204_GLH_BJPJ_GRCD';
|
|
|
+ if v_count = 0 then
|
|
|
+ execute immediate q'[
|
|
|
+ create table PMS_TEST.BAK_20261204_GLH_BJPJ_GRCD as
|
|
|
+ select * from PMS_TEST.GRCD where YYRYID = 111148259
|
|
|
+ ]';
|
|
|
+ end if;
|
|
|
+
|
|
|
+ insert into PMS_TEST.GRCD (
|
|
|
+ SJGRCDID, GRCDMBID, CAIDLBM, YYRYID, XH, MC, YWM, DXM, GNM,
|
|
|
+ JLZTM, CJRYID, GLRYID, GLBMID, MS
|
|
|
+ )
|
|
|
+ select v_parent_id, 1011, 1, 111148259, src.XH, src.MC, null,
|
|
|
+ src.DXM, 'search', 1, 111152547, 111152547, null, src.MC
|
|
|
+ from (
|
|
|
+ select 0 XH, '升旗礼检查' MC, 'sqljc' DXM from dual
|
|
|
+ union all select 1, '宿舍内务检查', 'ssnwjc' from dual
|
|
|
+ union all select 2, '值班', 'xyttZb' from dual
|
|
|
+ union all select 3, '学校处分记录', 'xxcfjl' from dual
|
|
|
+ union all select 4, '场室卫生检查', 'cswsjc' from dual
|
|
|
+ union all select 5, '宿舍违纪记录', 'sswjjl' from dual
|
|
|
+ union all select 6, '学校违纪记录', 'xxwjjl' from dual
|
|
|
+ union all select 7, '学校获奖记录', 'xxhjjl' from dual
|
|
|
+ union all select 8, '团体', 'xsh' from dual
|
|
|
+ union all select 9, '风纪仪容检查', 'fjyrjc' from dual
|
|
|
+ ) src
|
|
|
+ where not exists (
|
|
|
+ select 1
|
|
|
+ from PMS_TEST.GRCD m
|
|
|
+ where m.YYRYID = 111148259
|
|
|
+ and m.SJGRCDID = v_parent_id
|
|
|
+ and m.DXM = src.DXM
|
|
|
+ );
|
|
|
+
|
|
|
+ update PMS_TEST.GRCD
|
|
|
+ set XH = 9
|
|
|
+ where YYRYID = 111148259
|
|
|
+ and SJGRCDID = v_parent_id
|
|
|
+ and DXM = 'fjyrjc';
|
|
|
+
|
|
|
+ select count(*)
|
|
|
+ into v_count
|
|
|
+ from PMS_TEST.QZ
|
|
|
+ where QZH = 'QZ_BJPJ_1204';
|
|
|
+
|
|
|
+ if v_count = 0 then
|
|
|
+ insert into PMS_TEST.QZ (
|
|
|
+ QZLBM, MC, MS, JLZTM, CJRYID, GLRYID, FWC, QZH
|
|
|
+ ) values (
|
|
|
+ 1,
|
|
|
+ '古绿晖班级评比补充权限-20261204',
|
|
|
+ '补齐值班、学校获奖、风纪仪容检查权限',
|
|
|
+ 51,
|
|
|
+ 111152547,
|
|
|
+ 111152547,
|
|
|
+ '{"bjpj":["ssnwjc","ssnwjc_ck","ssnwjc_lr","xxhjjl","xxhjjl_ck","xxhjjl_lr","xxhjjlMp_save","fjyrjc","fjyrjc_ck","fjyrjc_lr","fjyrjc_mpPlay","xxcfjlWjjlcy","xxcfjlWjjlcy_ck","xxcfjlWjjlcy_lr"],"xygz":["xytt","xytt_ck","xyttZb","xyttZb_ck","xyttZb_lr","xyttZb_save","xyttZb_upd","xyttZb_chgPreview","xyttZb_subm","xyttZb_stateSus","xyttZb_stateRes","xyttZb_search","xyttZb_cxsy","xyttZb_cxlb"]}',
|
|
|
+ 'QZ_BJPJ_1204'
|
|
|
+ );
|
|
|
+ else
|
|
|
+ update PMS_TEST.QZ
|
|
|
+ set MC = '古绿晖班级评比补充权限-20261204',
|
|
|
+ MS = '补齐值班、学校获奖、风纪仪容检查权限',
|
|
|
+ JLZTM = 51,
|
|
|
+ FWC = '{"bjpj":["ssnwjc","ssnwjc_ck","ssnwjc_lr","xxhjjl","xxhjjl_ck","xxhjjl_lr","xxhjjlMp_save","fjyrjc","fjyrjc_ck","fjyrjc_lr","fjyrjc_mpPlay","xxcfjlWjjlcy","xxcfjlWjjlcy_ck","xxcfjlWjjlcy_lr"],"xygz":["xytt","xytt_ck","xyttZb","xyttZb_ck","xyttZb_lr","xyttZb_save","xyttZb_upd","xyttZb_chgPreview","xyttZb_subm","xyttZb_stateSus","xyttZb_stateRes","xyttZb_search","xyttZb_cxsy","xyttZb_cxlb"]}'
|
|
|
+ where QZH = 'QZ_BJPJ_1204';
|
|
|
+ end if;
|
|
|
+
|
|
|
+ insert into PMS_TEST.QZCY (
|
|
|
+ QZID, RYID, NC, JLZTM, CJRYID, GLRYID, RYH
|
|
|
+ )
|
|
|
+ select q.QZID, 111148259, '古绿晖', 51, 111152547, 111152547, 'T21270'
|
|
|
+ from PMS_TEST.QZ q
|
|
|
+ where q.QZH = 'QZ_BJPJ_1204'
|
|
|
+ and not exists (
|
|
|
+ select 1
|
|
|
+ from PMS_TEST.QZCY c
|
|
|
+ where c.QZID = q.QZID
|
|
|
+ and c.RYID = 111148259
|
|
|
+ and c.JLZTM = 51
|
|
|
+ );
|
|
|
+
|
|
|
+ commit;
|
|
|
+end;
|
|
|
+/
|
|
|
+
|
|
|
+exit;
|