From 90dc4f721d32b7a1e2af6b2917a8cba5cd470998 Mon Sep 17 00:00:00 2001 From: hodong13 Date: Wed, 14 Oct 2020 04:05:43 +0000 Subject: [PATCH] --- Dao/DB/DB1.Scheme.txt | 9 +++++++++ Dao/DB/DB1.SchemeFK.txt | 1 + Dao/MyBatis/Maps/CM.xml | 13 ++++++++++--- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Dao/DB/DB1.Scheme.txt b/Dao/DB/DB1.Scheme.txt index b6f4f62..86593d3 100644 --- a/Dao/DB/DB1.Scheme.txt +++ b/Dao/DB/DB1.Scheme.txt @@ -461,6 +461,15 @@ create table cminning ( ,cdt datetime not null,cno bigint not NULL,udt datetime not null,uno bigint not NULL,uip varchar(50) not NULL ,primary key(cmino)); +create table cminningscd ( + cmisno bigint auto_increment not null + ,cmino bigint not null + ,estart datetime not null + ,eend datetime not null + ,quota smallint not null + ,cdt datetime not null,cno bigint not NULL,udt datetime not null,uno bigint not NULL,uip varchar(50) not NULL + ,primary key(cmisno)); + create table cmev ( cmno int not null ,attend tinyint not null diff --git a/Dao/DB/DB1.SchemeFK.txt b/Dao/DB/DB1.SchemeFK.txt index 9f86269..e169009 100644 --- a/Dao/DB/DB1.SchemeFK.txt +++ b/Dao/DB/DB1.SchemeFK.txt @@ -57,6 +57,7 @@ alter table cminning add constraint foreign key fkcminningct (ctno) references c alter table cminning add constraint foreign key fkcminningu (userno) references users(userno); alter table cminning add constraint foreign key fkcminningfg (fgno) references filegroup(fgno); alter table cminning add constraint foreign key fkcminningfg2 (fgnotf) references filegroup(fgno); +alter table cminningscd add constraint foreign key fkcmiscmi (cmino) references cminning(cmino); alter table cmev add constraint foreign key fkcmevcm (cmno) references cm(cmno); alter table cmex add constraint foreign key fkcmexcm (cmno) references cm(cmno); alter table cmexlayer add constraint foreign key fkcmexlayercmex (exno) references cmex(exno); diff --git a/Dao/MyBatis/Maps/CM.xml b/Dao/MyBatis/Maps/CM.xml index 03a0640..9728a3f 100644 --- a/Dao/MyBatis/Maps/CM.xml +++ b/Dao/MyBatis/Maps/CM.xml @@ -1194,14 +1194,14 @@ order by dtype,intval,longval2 - insert into cm(ismaster,cgno,pcmno,cname,kname,tmno,classno,rstime,retime,sstime,setime,gstime,getime,cshape,infee,outfee,quota,introhtml,targethtml,goalhtml,contenthtml,studyplace,studytime + insert into cm(ismaster,cgno,pcmno,cname,kname,tmno,classno,rstime,retime,sstime,setime,gstime,getime,cshape,typeman,typeedu,typegrade,typejob,isoffabs,infee,outfee,quota,introhtml,targethtml,goalhtml,contenthtml,studyplace,studytime ,certcc,certgradecc,jobcc,jobpositiongrade,difficulty,isrefund,isuse,isseq,isdel,) select #ismaster#,cgno,case when a.ismaster = 1 and #ismaster# = 0 then a.cmno else a.pcmno end,ifnull(#cname#, concat('사본_', cname)),a.kname,#tmno# ,case when #tmno# is null then null else ifnull(b.classno,0)+1 end ,t.rstime,date_format(t.retime,'%Y-%m-%d 23:59:59') retime ,t.sstime,date_format(t.setime,'%Y-%m-%d 23:59:59') setime ,t.gstime,date_format(t.getime,'%Y-%m-%d 23:59:59') getime - ,cshape,infee,outfee,quota,introhtml,targethtml,goalhtml,contenthtml,studyplace,studytime + ,a.cshape,a.typeman,a.typeedu,a.typegrade,a.typejob,a.isoffabs,infee,outfee,quota,introhtml,targethtml,goalhtml,contenthtml,studyplace,studytime ,certcc,certgradecc,jobcc,jobpositiongrade,difficulty,isrefund,1,isseq,0, from cm a left outer join ( @@ -1243,8 +1243,15 @@ inner join cm b on b.cmno=#cmno# where a.cmno=#orgcmno#; + insert into cminningscd(cmino,estart,eend,quota,) + select c.cmino,b.estart,b.eend,b.quota, + from cminning a + inner join cminningscd b on b.cmino=a.cmino + inner join cminning c on c.cmno=#cmno# and c.isonline=0 + where a.cmno=#orgcmno# and a.isonline=0; + insert into cmev(cmno,attend,attendcut,attendrfd,attendcutrfd,mid,midcut,midrfd,midcutrfd,final,finalcut,finalrfd,finalcutrfd,subject,subjectcut,subjectrfd,subjectcutrfd - ,discuss,discusscut,discussrfd,discusscutrfd,etc,etccut,etcrfd,etccutrfd,cut,cutrfd,) + ,discuss,discusscut,discussrfd,discusscutrfd,etc,etccut,etcrfd,etccutrfd,cut,cutrfd,) select #cmno#,attend,attendcut,attendrfd,attendcutrfd,mid,midcut,midrfd,midcutrfd,final,finalcut,finalrfd,finalcutrfd,subject,subjectcut,subjectrfd,subjectcutrfd ,discuss,discusscut,discussrfd,discusscutrfd,etc,etccut,etcrfd,etccutrfd,cut,cutrfd, from cmev a