From 3f97e6a78889adb7636b461556949619682b70c1 Mon Sep 17 00:00:00 2001 From: lch Date: Tue, 29 Jun 2021 04:05:54 +0000 Subject: [PATCH] =?UTF-8?q?=EC=8B=A0=EC=B2=AD=EC=A4=91=EC=9D=B8=20?= =?UTF-8?q?=EA=B3=BC=EC=A0=95=20=EC=A0=95=EB=A0=AC=20=EA=B8=B0=EC=A4=80=20?= =?UTF-8?q?=EC=9E=AC=EC=A0=95=EC=9D=98=201.=20=EC=83=81=EC=8B=9C=EA=B0=80?= =?UTF-8?q?=20=EC=95=84=EB=8B=90=EA=B2=BD=EC=9A=B0=20:=20=EC=8B=A0?= =?UTF-8?q?=EC=B2=AD=EA=B8=B0=EA=B0=84=20=EC=8B=9C=EC=9E=91=EC=9D=BC~?= =?UTF-8?q?=EC=8B=A0=EC=B2=AD=EA=B8=B0=EA=B0=84=20=EC=A2=85=EB=A3=8C?= =?UTF-8?q?=EC=9D=BC=202.=20=EC=83=81=EC=8B=9C=EC=9D=BC=20=EA=B2=BD?= =?UTF-8?q?=EC=9A=B0=20:=20=EC=8B=A0=EC=B2=AD=EC=9D=BC(=EC=9E=85=EA=B8=88?= =?UTF-8?q?=EC=A0=84=20=EC=8B=A0=EC=B2=AD=EC=9D=BC)~=EC=B6=9C=EA=B2=B0?= =?UTF-8?q?=EC=9D=B4=EB=A0=A5=EC=9D=B4=20=EC=9E=88=EC=9D=84=20=EA=B2=BD?= =?UTF-8?q?=EC=9A=B0=203.=20=EC=A0=95=EB=A0=AC=20=EC=88=9C=EC=84=9C=201)?= =?UTF-8?q?=20=EB=AF=B8=EC=9E=85=EA=B8=88=202)=20=EC=8B=A0=EC=B2=AD?= =?UTF-8?q?=EA=B8=B0=EA=B0=84=20=EC=A2=85=EB=A3=8C=EC=9D=BC=203)=20?= =?UTF-8?q?=EC=83=81=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dao/MyBatis/Maps/Lect.xml | 25 +++++++++---------------- Dao/MyBatis/Maps/Pay.xml | 5 ++++- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Dao/MyBatis/Maps/Lect.xml b/Dao/MyBatis/Maps/Lect.xml index 5f70d71..532004b 100644 --- a/Dao/MyBatis/Maps/Lect.xml +++ b/Dao/MyBatis/Maps/Lect.xml @@ -1105,26 +1105,19 @@ ,l.lectno longval,a.payno longval2 ,c.cname strval,null strval2,null strval3 ,c.rstime time,c.retime time2 - ,row_number() over(order by c.retime) rno + ,case when b.pstatus = 1 then 99 else b.pstatus end as sortpstatus + ,case when c.retime = '2099-12-31 23:59:59' then l.cdt else c.retime end as sortretime + ,row_number() over(order by sortpstatus, sortretime, b.payno,a.pino) rno from payitem a inner join pay b on b.payno=a.payno and b.pstatus in (1,21,22,51,55) and b.rstatus < 2 inner join cm c on c.cmno=a.itemno and c.rstime < and c.retime > inner join lect l on l.cmno=c.cmno and (l.status < 5 or l.status = 6) and l.ischanged=0 and l.userno=b.userno - inner join term d on d.tmno=c.tmno - left outer join ( - select l.lectno - ,count(li.cmino) cnt - from payitem a - inner join pay b on b.payno= a.payno and b.pstatus in (1,21,22,51,55) and b.rstatus < 2 - inner join cm c on c.cmno = a.itemno and c.rstime < and c.retime > - inner join lect l on l.cmno = c.cmno and (l.status < 5 or l.status = 6) and l.ischanged =0 and l.userno = b.userno - left outer join lectinning li on li.lectno = l.lectno and li.istatus is not null - where a.ptype in (0,1,4) and a.userno=#userno# and a.pstatus in (1,21,22,51,55) and a.rstatus =0 - group by l.lectno - )li on li.lectno = l.lectno - left outer join payrfd e on e.payno=a.payno and e.payno=a.payno and e.rstatus=0 - where a.ptype in (0,1,4) and a.userno=#userno# and a.pstatus in (1,21,22,51,55) and a.rstatus=0 and li.cnt = 0 - order by rno + inner join term d on d.tmno=c.tmno + left outer join payrfd e on e.payno=a.payno and e.payno=a.payno and e.rstatus=0 + where a.ptype in (0,1,4) and a.userno=#userno# and a.pstatus in (1,21,22,51,55) and a.rstatus=0 + and 1 = case when c.retime = '2099-12-31 23:59:59' and l.stime is not null then 0 else 1 end + order by sortpstatus, sortretime, b.payno,a.pino + limit 3 ) a union all select a.dtype,a.intval,a.intval2,a.intval3,a.intval4,a.intval5,a.intval6,a.intval7,a.intval8 diff --git a/Dao/MyBatis/Maps/Pay.xml b/Dao/MyBatis/Maps/Pay.xml index 2544008..29bb308 100644 --- a/Dao/MyBatis/Maps/Pay.xml +++ b/Dao/MyBatis/Maps/Pay.xml @@ -542,6 +542,8 @@ ,cmis.estart cmiestart,cmis.eend cmieend ,case when lect.sdate is null then c.sstime else lect.sdate end as sdate ,case when lect.edate is null then c.setime else lect.edate end as edate + ,case when b.pstatus = 1 then 99 else b.pstatus end as sortpstatus + ,case when c.retime = '2099-12-31 23:59:59' then lect.cdt else c.retime end as sortretime from pay a inner join payitem b on b.payno=a.payno and b.ptype in (0,1,4) and b.pstatus in (1,21,22,51,55) inner join cm c on c.cmno=b.itemno and c.rstime < now() and c.retime > now() @@ -555,6 +557,7 @@ left outer join lect lect on lect.pino=b.pino and lect.ischanged=0 left outer join cminningscd cmis on cmis.cmisno=lect.cmisno where a.userno=#userno# and a.pstatus in (1,21,22,51,55) and lect.status < 8 + and 1 = case when c.retime = '2099-12-31 23:59:59' and lect.stime is not null then 0 else 1 end group by a.payno,a.isgroup,a.pstatus,a.rstatus ,b.pino,b.ptype,b.pcno,b.itemno,b.userno,b.pstatus,b.rstatus,b.isrebate ,c.cname,c.classno,c.rstime,c.retime,c.sstime,c.setime,c.cshape @@ -566,7 +569,7 @@ ,u.email ,lect.cmisno ,cmis.estart,cmis.eend - order by c.retime,a.payno,b.pino + order by sortpstatus, sortretime, a.payno,b.pino update pay set