|
|
@@ -0,0 +1,165 @@
|
|
|
+whenever sqlerror exit sql.sqlcode;
|
|
|
+
|
|
|
+alter session set container=ORCLPDB;
|
|
|
+alter session set current_schema=C##DC;
|
|
|
+
|
|
|
+update SQLJCXM
|
|
|
+ set CKZ=50,
|
|
|
+ MFZ=50
|
|
|
+ where SQLJCXMM in (21, 22);
|
|
|
+
|
|
|
+update XJB_PZ
|
|
|
+ set JSRQ=date '2026-11-30'
|
|
|
+ where PZBB='SC-2024-10-V1';
|
|
|
+
|
|
|
+insert into XJB_PZ(PZID, PZBB, MC, KSRQ, JSRQ, JLZTM, SM, CJSJ)
|
|
|
+select XJB_PZID.nextval,
|
|
|
+ 'SC-2026-11-V2',
|
|
|
+ '星级班评分口径2026-11版',
|
|
|
+ date '2026-12-01',
|
|
|
+ null,
|
|
|
+ 51,
|
|
|
+ '升旗礼取消服装评分,国歌和校歌各50分,风貌分合计100分。',
|
|
|
+ sysdate
|
|
|
+ from dual
|
|
|
+ where not exists (
|
|
|
+ select 1 from XJB_PZ where PZBB='SC-2026-11-V2');
|
|
|
+
|
|
|
+insert into XJB_PZMX(PZMXID, PZID, XMLB, XMBM, XMMC, ZBZ, SM, CJSJ)
|
|
|
+select XJB_PZMXID.nextval,
|
|
|
+ (select PZID from XJB_PZ where PZBB='SC-2026-11-V2'),
|
|
|
+ src.XMLB,
|
|
|
+ src.XMBM,
|
|
|
+ src.XMMC,
|
|
|
+ src.ZBZ,
|
|
|
+ src.SM,
|
|
|
+ sysdate
|
|
|
+ from XJB_PZMX src
|
|
|
+ where src.PZID=(select PZID from XJB_PZ where PZBB='SC-2024-10-V1')
|
|
|
+ and not exists (
|
|
|
+ select 1
|
|
|
+ from XJB_PZMX dst
|
|
|
+ where dst.PZID=(select PZID from XJB_PZ where PZBB='SC-2026-11-V2')
|
|
|
+ and dst.XMLB=src.XMLB
|
|
|
+ and dst.XMBM=src.XMBM);
|
|
|
+
|
|
|
+insert into XJB_PZMX(PZMXID, PZID, XMLB, XMBM, XMMC, ZBZ, SM, CJSJ)
|
|
|
+select XJB_PZMXID.nextval,
|
|
|
+ (select PZID from XJB_PZ where PZBB='SC-2026-11-V2'),
|
|
|
+ 'FLAG_ITEM', 'NATIONAL_SONG_MAX', '国歌满分', 50,
|
|
|
+ '国歌分数上限', sysdate
|
|
|
+ from dual
|
|
|
+ where not exists (
|
|
|
+ select 1 from XJB_PZMX
|
|
|
+ where PZID=(select PZID from XJB_PZ where PZBB='SC-2026-11-V2')
|
|
|
+ and XMLB='FLAG_ITEM' and XMBM='NATIONAL_SONG_MAX');
|
|
|
+
|
|
|
+insert into XJB_PZMX(PZMXID, PZID, XMLB, XMBM, XMMC, ZBZ, SM, CJSJ)
|
|
|
+select XJB_PZMXID.nextval,
|
|
|
+ (select PZID from XJB_PZ where PZBB='SC-2026-11-V2'),
|
|
|
+ 'FLAG_ITEM', 'SCHOOL_SONG_MAX', '校歌满分', 50,
|
|
|
+ '校歌分数上限', sysdate
|
|
|
+ from dual
|
|
|
+ where not exists (
|
|
|
+ select 1 from XJB_PZMX
|
|
|
+ where PZID=(select PZID from XJB_PZ where PZBB='SC-2026-11-V2')
|
|
|
+ and XMLB='FLAG_ITEM' and XMBM='SCHOOL_SONG_MAX');
|
|
|
+
|
|
|
+insert into XJB_PZMX(PZMXID, PZID, XMLB, XMBM, XMMC, ZBZ, SM, CJSJ)
|
|
|
+select XJB_PZMXID.nextval,
|
|
|
+ (select PZID from XJB_PZ where PZBB='SC-2026-11-V2'),
|
|
|
+ 'FLAG_ITEM', 'CLOTHING_ENABLED', '服装评分启用', 0,
|
|
|
+ '服装评分不再录入和计算', sysdate
|
|
|
+ from dual
|
|
|
+ where not exists (
|
|
|
+ select 1 from XJB_PZMX
|
|
|
+ where PZID=(select PZID from XJB_PZ where PZBB='SC-2026-11-V2')
|
|
|
+ and XMLB='FLAG_ITEM' and XMBM='CLOTHING_ENABLED');
|
|
|
+
|
|
|
+create sequence SSZRID start with 1 increment by 1 nocache;
|
|
|
+
|
|
|
+create table SSZR (
|
|
|
+ SSZRID number(16) not null,
|
|
|
+ JZWID number(16) not null,
|
|
|
+ CDID number(16) not null,
|
|
|
+ ZRQ date not null,
|
|
|
+ ZRSCM number(1) not null,
|
|
|
+ BJID number(16) not null,
|
|
|
+ BZ varchar2(500),
|
|
|
+ JLZTM number(9) default 51 not null,
|
|
|
+ CJRYID number(16),
|
|
|
+ GLRYID number(16),
|
|
|
+ GLBMID number(16),
|
|
|
+ CJSJ timestamp(6) default systimestamp not null,
|
|
|
+ constraint PK_SSZR primary key (SSZRID),
|
|
|
+ constraint UK_SSZR_ROOM_DATE_SLOT_CLASS
|
|
|
+ unique (CDID, ZRQ, ZRSCM, BJID),
|
|
|
+ constraint CK_SSZR_ZRSCM
|
|
|
+ check (ZRSCM in (1, 2))
|
|
|
+);
|
|
|
+
|
|
|
+create index IDX_SSZR_LOOKUP
|
|
|
+ on SSZR (CDID, ZRQ, ZRSCM, JLZTM);
|
|
|
+
|
|
|
+comment on table SSZR is '宿舍值日';
|
|
|
+comment on column SSZR.JZWID is '建筑物';
|
|
|
+comment on column SSZR.CDID is '宿舍房间';
|
|
|
+comment on column SSZR.ZRQ is '值日日期';
|
|
|
+comment on column SSZR.ZRSCM is '时段:1上午、2下午';
|
|
|
+comment on column SSZR.BJID is '值日班级';
|
|
|
+
|
|
|
+insert into GRCD (
|
|
|
+ SJGRCDID, GRCDMBID, CAIDLBM, XH, MC, DXM, GNM, JLZTM, MS
|
|
|
+)
|
|
|
+select parent.GRCDID,
|
|
|
+ 1011,
|
|
|
+ 1,
|
|
|
+ 2,
|
|
|
+ '宿舍值日',
|
|
|
+ 'sszr',
|
|
|
+ 'search',
|
|
|
+ 51,
|
|
|
+ '宿舍值日'
|
|
|
+ from GRCD parent
|
|
|
+ where parent.GRCDID=1025677
|
|
|
+ and not exists (
|
|
|
+ select 1 from GRCD exists_menu
|
|
|
+ where exists_menu.GRCDMBID=1011
|
|
|
+ and exists_menu.DXM='sszr');
|
|
|
+
|
|
|
+insert into GRCD (
|
|
|
+ SJGRCDID, GRCDMBID, CAIDLBM, XH, MC, DXM, GNM, JLZTM, MS
|
|
|
+)
|
|
|
+select parent.GRCDID,
|
|
|
+ 101223,
|
|
|
+ 1,
|
|
|
+ 1,
|
|
|
+ '宿舍值日',
|
|
|
+ 'sszr',
|
|
|
+ 'search',
|
|
|
+ 51,
|
|
|
+ '宿舍值日'
|
|
|
+ from GRCD parent
|
|
|
+ where parent.GRCDID=1025856
|
|
|
+ and not exists (
|
|
|
+ select 1 from GRCD exists_menu
|
|
|
+ where exists_menu.GRCDMBID=101223
|
|
|
+ and exists_menu.DXM='sszr');
|
|
|
+
|
|
|
+update GW
|
|
|
+ set FWC=json_transform(FWC, APPEND '$.xyss'='sszr')
|
|
|
+ where GWID=1015504
|
|
|
+ and not json_exists(FWC, '$.xyss[*]?(@ == "sszr")');
|
|
|
+
|
|
|
+update GW
|
|
|
+ set FWC=json_transform(FWC, APPEND '$.xyss'='sszr_ck')
|
|
|
+ where GWID=1015504
|
|
|
+ and not json_exists(FWC, '$.xyss[*]?(@ == "sszr_ck")');
|
|
|
+
|
|
|
+update GW
|
|
|
+ set FWC=json_transform(FWC, APPEND '$.xyss'='sszr_lr')
|
|
|
+ where GWID=1015504
|
|
|
+ and not json_exists(FWC, '$.xyss[*]?(@ == "sszr_lr")');
|
|
|
+
|
|
|
+commit;
|
|
|
+exit;
|