From ed5ed86f125e88511e2931ff4cf5430822fbe025 Mon Sep 17 00:00:00 2001
From: KimHanJin
Date: Tue, 6 Jan 2026 08:58:17 +0900
Subject: [PATCH] =?UTF-8?q?=EC=B6=94=EA=B0=80=EA=B0=9C=EB=B0=9C01/06=5F1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
BO/Views/croom/gradeall0.cshtml | 2 +-
Base/Controller/ACommonCRoom.cs | 3 +-
Dao/MyBatis/Maps/Grade.xml | 219 +++++++++++++++---
Dao/MyBatis/Maps/Lect.xml | 147 ++++++------
Dao/bin/Debug/MyBatis/Maps/Grade.xml | 219 +++++++++++++++---
Dao/bin/Debug/MyBatis/Maps/Lect.xml | 147 ++++++------
Dao/bin/Debug/NP.Model.dll | Bin 468480 -> 468480 bytes
Dao/bin/Debug/NP.Model.pdb | Bin 1353216 -> 1353216 bytes
FO/Views/CRoom/Estimation.cshtml | 12 +-
Model/bin/Debug/NP.Model.dll | Bin 468480 -> 468480 bytes
Model/bin/Debug/NP.Model.pdb | Bin 1353216 -> 1353216 bytes
.../Debug/Model.csproj.FileListAbsolute.txt | 1 +
Model/obj/Debug/NP.Model.dll | Bin 468480 -> 468480 bytes
Model/obj/Debug/NP.Model.pdb | Bin 1353216 -> 1353216 bytes
14 files changed, 543 insertions(+), 207 deletions(-)
diff --git a/BO/Views/croom/gradeall0.cshtml b/BO/Views/croom/gradeall0.cshtml
index 25daadf..6b1b0f0 100644
--- a/BO/Views/croom/gradeall0.cshtml
+++ b/BO/Views/croom/gradeall0.cshtml
@@ -94,7 +94,7 @@
}
@*최종평가*@
- @(d.ex1cnt < 1 ? "-" :d.ex1lectcnt < 1 && d.ex1cnt > 0 ? "미제출" : d.ex1lectpoint.ToString())
+ @(d.ex1cnt < 1 ? "-" : d.ex1lectcnt < 1 && d.ex1cnt > 0 ? "미제출" : d.ex1lectpoint.ToString())
@*과제*@
@(d.sd0cnt < 1 ? "-" :d.sd0lectcnt < 1 && d.sd0cnt > 0 ? "미제출" : d.sd0lectpoint.ToString())
diff --git a/Base/Controller/ACommonCRoom.cs b/Base/Controller/ACommonCRoom.cs
index a316a26..1fb8c51 100644
--- a/Base/Controller/ACommonCRoom.cs
+++ b/Base/Controller/ACommonCRoom.cs
@@ -516,7 +516,8 @@ namespace NP.Base.Controllers
{
try
{
- var ispass = Dao.Get("grade.ispass", new Hashtable() { { "lectno", lect.lectno } }).FirstOrDefault().ispass;
+ //var ispass = Dao.Get("grade.ispass", new Hashtable() { { "lectno", lect.lectno } }).FirstOrDefault().ispass;
+ var ispass = Dao.Get("grade.ispass2", new Hashtable() { { "lectno", lect.lectno } }).FirstOrDefault().ispass;
if (ispass == 1)
{
if (lect.iscomplete == 0)
diff --git a/Dao/MyBatis/Maps/Grade.xml b/Dao/MyBatis/Maps/Grade.xml
index 88a83e5..eb2ff97 100644
--- a/Dao/MyBatis/Maps/Grade.xml
+++ b/Dao/MyBatis/Maps/Grade.xml
@@ -81,36 +81,39 @@
left outer join lectex c on c.lectno=a.lectno and c.exno=b.exno
group by a.lectno
union all
- select a.lectno
- ,0,0,0
- ,count(b.exno),count(c.lectno),avg(ifnull(c.tpoint,0) / b.tpoint * 100)
- ,0,0,0
- ,0,0,0
- ,0,0,0
- ,0,0
- from (
- select b.lectno,a.cmno
- from cm a
- inner join lect b on b.cmno=a.cmno and b.status=1 and b.ischanged=0
- and b.lectno=#lectno#
- and b.userno=#userno#
- and b.attrate <= #attrateunder#
- and b.isrebate=#isrebate#
- and b.lectno in ($lectnos$)
- inner join users c on c.userno=b.userno and c.status < 99
- and c.userid=#userid#
- and c.username=#username#
- where a.ismaster=0
- and a.cgno=#cgno#
- and a.tmno=#tmno#
- and a.cmno=#cmno#
- and a.cmno in ($cmnos$)
- and a.cshape in ($cshapes$)
- and a.isdel=0
- ) a
- left outer join cmex b on b.cmno=a.cmno and b.extype=1 and b.isdel=0
- left outer join lectex c on c.lectno=a.lectno and c.exno=b.exno
- group by a.lectno
+
+ select *
+ from (
+ select a.lectno
+ ,0 ex0cnt,0 ex0lectcnt,0 ex0lectpoint,count(b.exno) ex1cnt,count(c.lectno) ex1lectcnt,avg(ifnull(c.tpoint, 0) / b.tpoint * 100) ex1lectpoint,0 sd0cnt
+ ,0 sd0lectcnt,0 sd0lectpoint,0 sd1cnt,0 sd1lectcnt,0 sd1lectpoint,0 rs0cnt,0 rs0lectcnt,0 rs0lectpoint,0 at0cnt,0 at0lectcnt
+ ,row_number() OVER (PARTITION BY a.lectno ORDER BY (c.estart IS NOT NULL) DESC) rn
+ from (
+ select b.lectno,a.cmno
+ from cm a
+ inner join lect b on b.cmno=a.cmno and b.status=1 and b.ischanged=0
+ and b.lectno=#lectno#
+ and b.userno=#userno#
+ and b.attrate <= #attrateunder#
+ and b.isrebate=#isrebate#
+ and b.lectno in ($lectnos$)
+ inner join users c on c.userno=b.userno and c.status < 99
+ and c.userid=#userid#
+ and c.username=#username#
+ where a.ismaster=0
+ and a.cgno=#cgno#
+ and a.tmno=#tmno#
+ and a.cmno=#cmno#
+ and a.cmno in ($cmnos$)
+ and a.cshape in ($cshapes$)
+ and a.isdel=0
+ ) a
+ left outer join cmex b on b.cmno=a.cmno and b.extype=1 and b.isdel=0
+ left outer join lectex c on c.lectno=a.lectno and c.exno=b.exno
+ GROUP BY a.lectno,b.exno
+ ) a
+ where a.rn = 1
+
union all
select a.lectno
,0,0,0
@@ -1021,6 +1024,24 @@
LEFT JOIN cmsd sd ON sd.cmno = fl.cmno AND sd.isdel = 0 LEFT JOIN lectsd lsd ON lsd.lectno = fl.lectno AND lsd.sdno = sd.sdno
LEFT JOIN cmrs rs ON rs.cmno = fl.cmno AND rs.rstype = 0 AND rs.isdel = 0 LEFT JOIN lectrs lrs ON lrs.lectno = fl.lectno AND lrs.rsno = rs.rsno
LEFT JOIN cminning ci ON ci.cmno = fl.cmno AND ci.isonline = 0 AND ci.isscd = 1 LEFT JOIN lectinning li ON li.cmino = ci.cmino AND li.lectno = fl.lectno AND li.istatus = 2
+ GROUP BY fl.lectno, fl.cmno, fl.isrebate, fl.attrate
+
+ UNION ALL
+
+ SELECT
+ fl.lectno, fl.cmno, fl.isrebate, fl.attrate
+ , COUNT(DISTINCT CASE WHEN ex.extype = 0 THEN ex.exno END) AS ex0cnt, COUNT(DISTINCT CASE WHEN ex.extype = 0 THEN lex.lectno END) AS ex0lectcnt, AVG(CASE WHEN ex.extype = 0 AND ex.tpoint > 0 THEN IFNULL(lex.tpoint, 0) / ex.tpoint * 100 ELSE 0 END) AS ex0lectpoint
+ , COUNT(DISTINCT CASE WHEN ex.extype = 1 THEN ex.exno END) AS ex1cnt, COUNT(DISTINCT CASE WHEN ex.extype = 1 THEN lex.lectno END) AS ex1lectcnt, AVG(CASE WHEN ex.extype = 1 AND ex.tpoint > 0 THEN IFNULL(lex.tpoint, 0) / ex.tpoint * 100 ELSE 0 END) AS ex1lectpoint
+ , COUNT(DISTINCT CASE WHEN sd.sdtype = 0 THEN sd.sdno END) AS sd0cnt, COUNT(DISTINCT CASE WHEN sd.sdtype = 0 THEN lsd.lectno END) AS sd0lectcnt, AVG(CASE WHEN sd.sdtype = 0 AND sd.tpoint > 0 THEN IFNULL(lsd.cpoint, 0) / sd.tpoint * 100 ELSE 0 END) AS sd0lectpoint
+ , COUNT(DISTINCT CASE WHEN sd.sdtype = 1 THEN sd.sdno END) AS sd1cnt, COUNT(DISTINCT CASE WHEN sd.sdtype = 1 THEN lsd.lectno END) AS sd1lectcnt, AVG(CASE WHEN sd.sdtype = 1 AND sd.tpoint > 0 THEN IFNULL(lsd.cpoint, 0) / sd.tpoint * 100 ELSE 0 END) AS sd1lectpoint
+ , COUNT(DISTINCT CASE WHEN rs.rstype = 0 THEN rs.rsno END) AS rs0cnt, COUNT(DISTINCT CASE WHEN rs.rstype = 0 THEN lrs.lectno END) AS rs0lectcnt
+ , COUNT(DISTINCT ci.cmino) AS at0cnt, COUNT(DISTINCT li.lectno) AS at0lectcnt
+ FROM filtered_lect fl
+ LEFT JOIN cmex ex ON ex.cmno = fl.cmno AND ex.isdel = 0 LEFT JOIN lectex lex ON lex.lectno = fl.lectno AND lex.exno = ex.exno
+ LEFT JOIN cmsd sd ON sd.cmno = fl.cmno AND sd.isdel = 0 LEFT JOIN lectsd lsd ON lsd.lectno = fl.lectno AND lsd.sdno = sd.sdno
+ LEFT JOIN cmrs rs ON rs.cmno = fl.cmno AND rs.rstype = 0 AND rs.isdel = 0 LEFT JOIN lectrs lrs ON lrs.lectno = fl.lectno AND lrs.rsno = rs.rsno
+ LEFT JOIN cminning ci ON ci.cmno = fl.cmno AND ci.isonline = 0 AND ci.isscd = 1 LEFT JOIN lectinning li ON li.cmino = ci.cmino AND li.lectno = fl.lectno AND li.istatus = 2
+ WHERE ex.cmisno > 0
GROUP BY fl.lectno, fl.cmno, fl.isrebate, fl.attrate
),
final_scores AS (
@@ -1086,6 +1107,7 @@
LEFT OUTER JOIN comcode tg ON tg.ccode = ppl.typegrade
LEFT OUTER JOIN comcode tj ON tj.ccode = ppl.typejob
WHERE 1=1
+ AND fs.ex1cnt < 2
@@ -1989,6 +2011,143 @@
a.lectno = #lectno#
+
+
+ SELECT a.*
+ FROM (
+ SELECT a.lectno
+ ,(b.attrate / 100) * (CASE WHEN b.isrebate = 1 THEN d.attendrfd ELSE d.attend END / 100) * 100 apoint
+ ,a.ex0cnt,a.ex0lectcnt,a.ex0lectpoint
+ ,(a.ex0lectpoint / 100) * (CASE WHEN b.isrebate = 1 THEN d.midrfd ELSE d.mid END / 100) * 100 mpoint
+ ,a.ex1cnt,a.ex1lectcnt,a.ex1lectpoint
+ ,(a.ex1lectpoint / 100) * (CASE WHEN b.isrebate = 1 THEN d.finalrfd ELSE d.final END / 100) * 100 fpoint
+ ,a.sd0cnt,a.sd0lectcnt,a.sd0lectpoint
+ ,(a.sd0lectpoint / 100) * (CASE WHEN b.isrebate = 1 THEN d.subjectrfd ELSE d.subject END / 100) * 100 spoint
+ ,a.sd1cnt,a.sd1lectcnt,a.sd1lectpoint
+ ,(a.sd1lectpoint / 100) * (CASE WHEN b.isrebate = 1 THEN d.discussrfd ELSE d.discuss END / 100) * 100 dpoint
+ ,a.rs0cnt,a.rs0lectcnt,a.rs0lectpoint
+ ,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.attendcutrfd ELSE d.attendcut END) <= b.attrate THEN 1 ELSE 0 END) ispassa
+ ,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.midcutrfd ELSE d.midcut END ) <= a.ex0lectpoint THEN 1 ELSE 0 END) ispassm
+ ,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.finalcutrfd ELSE d.finalcut END) <= a.ex1lectpoint THEN 1 ELSE 0 END) ispassf
+ ,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.subjectcutrfd ELSE d.subjectcut END) <= a.sd0lectpoint THEN 1 ELSE 0 END) ispasss
+ ,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.discusscutrfd ELSE d.discusscut END) <= a.sd1lectpoint THEN 1 ELSE 0 END) ispassd
+ ,(CASE WHEN (CASE WHEN ifnull(d.isoffabs, 0) = 1 THEN ifnull(a.at0cnt, 0) ELSE 0 END) <= ifnull(a.at0lectcnt, 0) THEN 1 ELSE 0 END) ispassat
+ ,(CASE WHEN (CASE WHEN (CASE WHEN ifnull(d.isoffabs, 0) = 1 THEN ifnull(a.at0cnt, 0) ELSE 0 END) <= ifnull(a.at0lectcnt, 0) THEN 1 ELSE 0 END) = 1 AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.attendcutrfd ELSE d.attendcut END) <= b.attrate THEN 1 ELSE 0 END) = 1
+ AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.midcutrfd ELSE d.midcut END) <= a.ex0lectpoint THEN 1 ELSE 0 END) = 1 AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.finalcutrfd ELSE d.finalcut END) <= a.ex1lectpoint THEN 1 ELSE 0 END) = 1
+ AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.subjectcutrfd ELSE d.subjectcut END) <= a.sd0lectpoint THEN 1 ELSE 0 END) = 1 AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.discusscutrfd ELSE d.discusscut END) <= a.sd1lectpoint THEN 1 ELSE 0 END) = 1
+ AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.cutrfd ELSE d.cut END) <= ((b.attrate / 100) * ((CASE WHEN b.isrebate = 1 THEN d.attendrfd ELSE d.attend END) / 100 * 100)) + ((a.ex0lectpoint / 100) * ((CASE WHEN b.isrebate = 1 THEN d.midrfd ELSE d.mid END) / 100) * 100)
+ + ((a.ex1lectpoint / 100) * ((CASE WHEN b.isrebate = 1 THEN d.finalrfd ELSE d.final END) / 100) * 100) + ((a.sd0lectpoint / 100) * ((CASE WHEN b.isrebate = 1 THEN d.subjectrfd ELSE d.subject END) / 100) * 100)
+ + ((a.sd1lectpoint / 100) * ((CASE WHEN b.isrebate = 1 THEN d.discussrfd ELSE d.discuss END) / 100) * 100) THEN 1 ELSE 0 END) = 1 THEN 1 ELSE 0 END) ispass
+ FROM (
+ SELECT a.lectno
+ ,sum(ex0cnt) ex0cnt,sum(ex0lectcnt) ex0lectcnt,sum(ex0lectpoint) ex0lectpoint,sum(ex1cnt) ex1cnt,sum(ex1lectcnt) ex1lectcnt,sum(ex1lectpoint) ex1lectpoint,sum(sd0cnt) sd0cnt,sum(sd0lectcnt) sd0lectcnt,sum(sd0lectpoint) sd0lectpoint
+ ,sum(sd1cnt) sd1cnt,sum(sd1lectcnt) sd1lectcnt,sum(sd1lectpoint) sd1lectpoint,sum(rs0cnt) rs0cnt,sum(rs0lectcnt) rs0lectcnt,sum(rs0lectpoint) rs0lectpoint,sum(at0cnt) at0cnt,sum(at0lectcnt) at0lectcnt
+ FROM (
+ SELECT a.lectno
+ ,count(b.exno) ex0cnt,count(c.lectno) ex0lectcnt,avg(ifnull(c.tpoint, 0) / b.tpoint * 100) ex0lectpoint,0 ex1cnt,0 ex1lectcnt,0 ex1lectpoint,0 sd0cnt
+ ,0 sd0lectcnt,0 sd0lectpoint,0 sd1cnt,0 sd1lectcnt,0 sd1lectpoint,0 rs0cnt,0 rs0lectcnt,0 rs0lectpoint,0 at0cnt,0 at0lectcnt
+ FROM (
+ SELECT b.lectno,a.cmno
+ FROM cm a
+ INNER JOIN lect b ON b.cmno = a.cmno AND b.STATUS = 1 AND b.ischanged = 0 AND b.lectno = #lectno#
+ INNER JOIN users c ON c.userno = b.userno AND c.STATUS < 99
+ WHERE a.ismaster = 0 AND a.isdel = 0
+ ) a
+ LEFT OUTER JOIN cmex b ON b.cmno = a.cmno AND b.extype = 0 AND b.isdel = 0
+ LEFT OUTER JOIN lectex c ON c.lectno = a.lectno AND c.exno = b.exno
+ GROUP BY a.lectno
+
+ UNION ALL
+
+ SELECT a.lectno
+ ,a.ex0cnt,a.ex0lectcnt,a.ex0lectpoint,a.ex1cnt,a.ex1lectcnt,a.ex1lectpoint,a.sd0cnt
+ ,a.sd0lectcnt,a.sd0lectpoint,a.sd1cnt,a.sd1lectcnt,a.sd1lectpoint,a.rs0cnt,a.rs0lectcnt,a.rs0lectpoint,a.at0cnt,a.at0lectcnt
+ FROM (
+ SELECT a.lectno
+ ,0 ex0cnt,0 ex0lectcnt,0 ex0lectpoint,count(b.exno) ex1cnt,count(c.lectno) ex1lectcnt,avg(ifnull(c.tpoint, 0) / b.tpoint * 100) ex1lectpoint,0 sd0cnt
+ ,0 sd0lectcnt,0 sd0lectpoint,0 sd1cnt,0 sd1lectcnt,0 sd1lectpoint,0 rs0cnt,0 rs0lectcnt,0 rs0lectpoint,0 at0cnt,0 at0lectcnt
+ ,row_number() OVER (PARTITION BY a.lectno ORDER BY (c.estart IS NOT NULL) DESC) rn
+ FROM (
+ SELECT b.lectno,a.cmno
+ FROM cm a
+ INNER JOIN lect b ON b.cmno = a.cmno AND b.STATUS = 1 AND b.ischanged = 0 AND b.lectno = #lectno#
+ INNER JOIN users c ON c.userno = b.userno AND c.STATUS < 99
+ WHERE a.ismaster = 0 AND a.isdel = 0
+ ) a
+ LEFT OUTER JOIN cmex b ON b.cmno = a.cmno AND b.extype = 1 AND b.isdel = 0
+ LEFT OUTER JOIN lectex c ON c.lectno = a.lectno AND c.exno = b.exno
+ GROUP BY a.lectno,b.exno
+ ) a
+ WHERE a.rn = 1
+
+ UNION ALL
+
+ SELECT a.lectno
+ ,0,0,0,0,0,0,count(b.sdno),count(c.lectno),avg(ifnull(c.cpoint, 0) / b.tpoint * 100),0,0,0,0,0,0,0,0
+ FROM (
+ SELECT b.lectno,a.cmno
+ FROM cm a
+ INNER JOIN lect b ON b.cmno = a.cmno AND b.STATUS = 1 AND b.ischanged = 0 AND b.lectno = #lectno#
+ INNER JOIN users c ON c.userno = b.userno AND c.STATUS < 99
+ WHERE a.ismaster = 0 AND a.isdel = 0
+ ) a
+ LEFT OUTER JOIN cmsd b ON b.cmno = a.cmno AND b.sdtype = 0 AND b.isdel = 0
+ LEFT OUTER JOIN lectsd c ON c.lectno = a.lectno AND c.sdno = b.sdno
+ GROUP BY a.lectno
+
+ UNION ALL
+
+ SELECT a.lectno
+ ,0,0,0,0,0,0,0,0,0,count(b.sdno),count(c.lectno),avg(ifnull(c.cpoint, 0) / b.tpoint * 100),0,0,0,0,0
+ FROM (
+ SELECT b.lectno,a.cmno
+ FROM cm a
+ INNER JOIN lect b ON b.cmno = a.cmno AND b.STATUS = 1 AND b.ischanged = 0 AND b.lectno = #lectno#
+ INNER JOIN users c ON c.userno = b.userno AND c.STATUS < 99
+ WHERE a.ismaster = 0 AND a.isdel = 0
+ ) a
+ LEFT OUTER JOIN cmsd b ON b.cmno = a.cmno AND b.sdtype = 1
+ AND b.isdel = 0
+ LEFT OUTER JOIN lectsd c ON c.lectno = a.lectno AND c.sdno = b.sdno
+ GROUP BY a.lectno
+
+ UNION ALL
+
+ SELECT a.lectno
+ ,0,0,0,0,0,0,0,0,0,0,0,0,count(b.rsno),count(c.lectno),0,0,0
+ FROM (
+ SELECT b.lectno,a.cmno
+ FROM cm a
+ INNER JOIN lect b ON b.cmno = a.cmno AND b.STATUS = 1 AND b.ischanged = 0 AND b.lectno = #lectno#
+ INNER JOIN users c ON c.userno = b.userno AND c.STATUS < 99
+ WHERE a.ismaster = 0 AND a.isdel = 0
+ ) a
+ LEFT OUTER JOIN cmrs b ON b.cmno = a.cmno AND b.rstype = 0 AND b.isdel = 0
+ LEFT OUTER JOIN lectrs c ON c.lectno = a.lectno AND c.rsno = b.rsno
+ GROUP BY a.lectno
+
+ UNION ALL
+
+ SELECT a.lectno
+ ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,count(b.cmino),count(c.lectno)
+ FROM (
+ SELECT b.lectno,a.cmno
+ FROM cm a
+ INNER JOIN lect b ON b.cmno = a.cmno AND b.STATUS = 1 AND b.ischanged = 0 AND b.lectno = #lectno#
+ INNER JOIN users c ON c.userno = b.userno AND c.STATUS < 99
+ WHERE a.ismaster = 0 AND a.isdel = 0
+ ) a
+ LEFT OUTER JOIN cminning b ON b.cmno = a.cmno AND b.isonline = 0 AND b.isscd = 1
+ LEFT OUTER JOIN lectinning c ON c.cmino = b.cmino AND c.lectno = a.lectno AND c.istatus = 2
+ GROUP BY a.lectno
+ ) a
+ GROUP BY a.lectno
+ ) a
+ INNER JOIN lect b ON b.lectno = a.lectno
+ INNER JOIN cmev d ON d.cmno = b.cmno
+ ) a
+ WHERE a.lectno = #lectno#
+
diff --git a/Dao/MyBatis/Maps/Lect.xml b/Dao/MyBatis/Maps/Lect.xml
index d35909d..c826ab6 100644
--- a/Dao/MyBatis/Maps/Lect.xml
+++ b/Dao/MyBatis/Maps/Lect.xml
@@ -1125,80 +1125,85 @@
order by a.rno
- select a.*
+ select *
from (
- select a.lectno,a.userno,a.cmno,a.isrebate
- ,p.payoktime,a.sdate,a.edate
- ,b.exno,b.exname,b.extype
- ,b2.cshape,b2.cname
- ,c.estart,c.eend,c.eip,c.tpoint,c.recount,c.entercount,c.cblock,c.isbyadmin
- ,d.username,d.userid
- ,e.asname
- ,f.cmisno,f.estart lestart,f.eend leend,f.sseq
- ,g.cname studyplacename
- ,a.iscomplete
- ,row_number() over(order by $orderby$ d.username ) rno
- ,count(a.cdt) over() pagetotalcount
- ,cast(AES_DECRYPT(UNHEX(d.mobile), 'np123@!' ) as char) as mobile
- from lect a
- inner join cmex b on b.isdel=0 and b.cmno = a.cmno
- inner join cm b2 on b2.cmno = b.cmno
- inner join pay p on p.payno = a.payno
- left outer join lectex c on c.lectno = a.lectno and c.exno =b.exno
- inner join users d on d.userno = a.userno
- left outer join assign e on e.asno = d.asno
- left outer join cminningscd f on f.cmisno = a.cmisno
- left outer join comcode g on g.ccode = f.studyplace and g.isuse =1
+ select a.*
+ ,row_number() over(order by $orderby$ a.username ) rno
+ ,count(a.lectno) OVER () pagetotalcount
+ from (
+ select a.lectno,a.userno,a.cmno,a.isrebate
+ ,p.payoktime,a.sdate,a.edate
+ ,b.exno,b.exname,b.extype
+ ,b2.cshape,b2.cname
+ ,c.estart,c.eend,c.eip,c.tpoint,c.recount,c.entercount,c.cblock,c.isbyadmin
+ ,d.username,d.userid
+ ,e.asname
+ ,f.cmisno,f.estart lestart,f.eend leend,f.sseq
+ ,g.cname studyplacename
+ ,a.iscomplete
+ ,row_number() OVER (PARTITION BY a.lectno ORDER BY (c.estart IS NOT NULL) DESC) rn
+ ,cast(AES_DECRYPT(UNHEX(d.mobile), 'np123@!' ) as char) as mobile
+ from lect a
+ inner join cmex b on b.isdel=0 and b.cmno = a.cmno
+ inner join cm b2 on b2.cmno = b.cmno
+ inner join pay p on p.payno = a.payno
+ left outer join lectex c on c.lectno = a.lectno and c.exno =b.exno
+ inner join users d on d.userno = a.userno
+ left outer join assign e on e.asno = d.asno
+ left outer join cminningscd f on f.cmisno = a.cmisno
+ left outer join comcode g on g.ccode = f.studyplace and g.isuse =1
- left outer join cmev ce on b2.cmno=ce.cmno
- left outer join lect l on a.lectno = l.lectno
- left outer join cminningscd cis on l.cmisno = cis.cmisno
- left outer join lectinning li on a.lectno = li.lectno and cis.cmino = li.cmino
+ left outer join cmev ce on b2.cmno=ce.cmno
+ left outer join lect l on a.lectno = l.lectno
+ left outer join cminningscd cis on l.cmisno = cis.cmisno
+ left outer join lectinning li on a.lectno = li.lectno and cis.cmino = li.cmino
- where a.status = 1 and a.ischanged=0 and d.status < 99
- and b.extype = #extype#
- and a.cmno = #cmno#
- and a.isrebate=#isrebate#
- and (date_format((case when b2.cshape = 2 and f.eend is not null then f.eend else a.edate end),'%Y-%m-%d') = #edate#)
- and ((case when b2.cshape = 2 and f.eend is not null then f.eend else a.edate end) >= #edate1#)
- and ((case when b2.cshape = 2 and f.eend is not null then f.eend else a.edate end) <= #edate2#)
- and b2.cshape = #cshape#
- and b2.cname like concat('%',#cname#,'%')
- and b2.cname like concat('%',#cname#,'%')
- and ifnull(a.iscomplete,0) = #iscomplete#
- and f.studyplace = #studyplace#
- and d.username like concat('%',#usernamestr#,'%')
- and d.userid like concat('%',#useridstr#,'%')
-
- and d.username like concat('%',#usernamestr#,'%')
- and d.userid like concat('%',#useridstr#,'%')
-
-
- and c.estart is null
- and c.estart is not null and c.eend is null
- and c.eend is not null
-
- and (case when b2.cshape = 0 and a.isrebate = 0 then p.payoktime else a.sdate end) >= date_format(#sdateall#,'%Y-%m-%d 00:00:00')
- and (case when b2.cshape = 2 then f.eend else a.edate end) <= date_format(#edateall#,'%Y-%m-%d 23:59:59')
- and e.asname like concat('%',#asname#,'%')
- and (cast(AES_DECRYPT(UNHEX(d.mobile), 'np123@!' ) as char) like concat('%',#mobile#,'%'))
-
-
- ifnull(ce.isoffabs,0) = 0
-
- ifnull(ce.isoffabs,0) = 1
-
- ifnull(ce.isoffabs,0) = 1 and li.istatus is null
-
- ifnull(ce.isoffabs,0) = 1 and ifnull(li.istatus,-1) = 2
-
- ifnull(ce.isoffabs,0) = 1 and ifnull(li.istatus,-1) = 0
-
-
- (c.isbyadmin = 0 or c.isbyadmin is null) and c.estart is null
- c.isbyadmin = 0 and c.estart is not null
- c.isbyadmin = 1
-
+ where a.status = 1 and a.ischanged=0 and d.status < 99
+ and b.extype = #extype#
+ and a.cmno = #cmno#
+ and a.isrebate=#isrebate#
+ and (date_format((case when b2.cshape = 2 and f.eend is not null then f.eend else a.edate end),'%Y-%m-%d') = #edate#)
+ and ((case when b2.cshape = 2 and f.eend is not null then f.eend else a.edate end) >= #edate1#)
+ and ((case when b2.cshape = 2 and f.eend is not null then f.eend else a.edate end) <= #edate2#)
+ and b2.cshape = #cshape#
+ and b2.cname like concat('%',#cname#,'%')
+ and b2.cname like concat('%',#cname#,'%')
+ and ifnull(a.iscomplete,0) = #iscomplete#
+ and f.studyplace = #studyplace#
+ and d.username like concat('%',#usernamestr#,'%')
+ and d.userid like concat('%',#useridstr#,'%')
+
+ and d.username like concat('%',#usernamestr#,'%')
+ and d.userid like concat('%',#useridstr#,'%')
+
+
+ and c.estart is null
+ and c.estart is not null and c.eend is null
+ and c.eend is not null
+
+ and (case when b2.cshape = 0 and a.isrebate = 0 then p.payoktime else a.sdate end) >= date_format(#sdateall#,'%Y-%m-%d 00:00:00')
+ and (case when b2.cshape = 2 then f.eend else a.edate end) <= date_format(#edateall#,'%Y-%m-%d 23:59:59')
+ and e.asname like concat('%',#asname#,'%')
+ and (cast(AES_DECRYPT(UNHEX(d.mobile), 'np123@!' ) as char) like concat('%',#mobile#,'%'))
+
+
+ ifnull(ce.isoffabs,0) = 0
+
+ ifnull(ce.isoffabs,0) = 1
+
+ ifnull(ce.isoffabs,0) = 1 and li.istatus is null
+
+ ifnull(ce.isoffabs,0) = 1 and ifnull(li.istatus,-1) = 2
+
+ ifnull(ce.isoffabs,0) = 1 and ifnull(li.istatus,-1) = 0
+
+
+ (c.isbyadmin = 0 or c.isbyadmin is null) and c.estart is null
+ c.isbyadmin = 0 and c.estart is not null
+ c.isbyadmin = 1
+
+ ) a
+ WHERE a.rn = 1
) a
order by a.rno
diff --git a/Dao/bin/Debug/MyBatis/Maps/Grade.xml b/Dao/bin/Debug/MyBatis/Maps/Grade.xml
index bf2d77d..81f5d3e 100644
--- a/Dao/bin/Debug/MyBatis/Maps/Grade.xml
+++ b/Dao/bin/Debug/MyBatis/Maps/Grade.xml
@@ -81,36 +81,39 @@
left outer join lectex c on c.lectno=a.lectno and c.exno=b.exno
group by a.lectno
union all
- select a.lectno
- ,0,0,0
- ,count(b.exno),count(c.lectno),avg(ifnull(c.tpoint,0) / b.tpoint * 100)
- ,0,0,0
- ,0,0,0
- ,0,0,0
- ,0,0
- from (
- select b.lectno,a.cmno
- from cm a
- inner join lect b on b.cmno=a.cmno and b.status=1 and b.ischanged=0
- and b.lectno=#lectno#
- and b.userno=#userno#
- and b.attrate <= #attrateunder#
- and b.isrebate=#isrebate#
- and b.lectno in ($lectnos$)
- inner join users c on c.userno=b.userno and c.status < 99
- and c.userid=#userid#
- and c.username=#username#
- where a.ismaster=0
- and a.cgno=#cgno#
- and a.tmno=#tmno#
- and a.cmno=#cmno#
- and a.cmno in ($cmnos$)
- and a.cshape in ($cshapes$)
- and a.isdel=0
- ) a
- left outer join cmex b on b.cmno=a.cmno and b.extype=1 and b.isdel=0
- left outer join lectex c on c.lectno=a.lectno and c.exno=b.exno
- group by a.lectno
+
+ select *
+ from (
+ select a.lectno
+ ,0 ex0cnt,0 ex0lectcnt,0 ex0lectpoint,count(b.exno) ex1cnt,count(c.lectno) ex1lectcnt,avg(ifnull(c.tpoint, 0) / b.tpoint * 100) ex1lectpoint,0 sd0cnt
+ ,0 sd0lectcnt,0 sd0lectpoint,0 sd1cnt,0 sd1lectcnt,0 sd1lectpoint,0 rs0cnt,0 rs0lectcnt,0 rs0lectpoint,0 at0cnt,0 at0lectcnt
+ ,row_number() OVER (PARTITION BY a.lectno ORDER BY (c.estart IS NOT NULL) DESC) rn
+ from (
+ select b.lectno,a.cmno
+ from cm a
+ inner join lect b on b.cmno=a.cmno and b.status=1 and b.ischanged=0
+ and b.lectno=#lectno#
+ and b.userno=#userno#
+ and b.attrate <= #attrateunder#
+ and b.isrebate=#isrebate#
+ and b.lectno in ($lectnos$)
+ inner join users c on c.userno=b.userno and c.status < 99
+ and c.userid=#userid#
+ and c.username=#username#
+ where a.ismaster=0
+ and a.cgno=#cgno#
+ and a.tmno=#tmno#
+ and a.cmno=#cmno#
+ and a.cmno in ($cmnos$)
+ and a.cshape in ($cshapes$)
+ and a.isdel=0
+ ) a
+ left outer join cmex b on b.cmno=a.cmno and b.extype=1 and b.isdel=0
+ left outer join lectex c on c.lectno=a.lectno and c.exno=b.exno
+ GROUP BY a.lectno,b.exno
+ ) a
+ where a.rn = 1
+
union all
select a.lectno
,0,0,0
@@ -1021,6 +1024,24 @@
LEFT JOIN cmsd sd ON sd.cmno = fl.cmno AND sd.isdel = 0 LEFT JOIN lectsd lsd ON lsd.lectno = fl.lectno AND lsd.sdno = sd.sdno
LEFT JOIN cmrs rs ON rs.cmno = fl.cmno AND rs.rstype = 0 AND rs.isdel = 0 LEFT JOIN lectrs lrs ON lrs.lectno = fl.lectno AND lrs.rsno = rs.rsno
LEFT JOIN cminning ci ON ci.cmno = fl.cmno AND ci.isonline = 0 AND ci.isscd = 1 LEFT JOIN lectinning li ON li.cmino = ci.cmino AND li.lectno = fl.lectno AND li.istatus = 2
+ GROUP BY fl.lectno, fl.cmno, fl.isrebate, fl.attrate
+
+ UNION ALL
+
+ SELECT
+ fl.lectno, fl.cmno, fl.isrebate, fl.attrate
+ , COUNT(DISTINCT CASE WHEN ex.extype = 0 THEN ex.exno END) AS ex0cnt, COUNT(DISTINCT CASE WHEN ex.extype = 0 THEN lex.lectno END) AS ex0lectcnt, AVG(CASE WHEN ex.extype = 0 AND ex.tpoint > 0 THEN IFNULL(lex.tpoint, 0) / ex.tpoint * 100 ELSE 0 END) AS ex0lectpoint
+ , COUNT(DISTINCT CASE WHEN ex.extype = 1 THEN ex.exno END) AS ex1cnt, COUNT(DISTINCT CASE WHEN ex.extype = 1 THEN lex.lectno END) AS ex1lectcnt, AVG(CASE WHEN ex.extype = 1 AND ex.tpoint > 0 THEN IFNULL(lex.tpoint, 0) / ex.tpoint * 100 ELSE 0 END) AS ex1lectpoint
+ , COUNT(DISTINCT CASE WHEN sd.sdtype = 0 THEN sd.sdno END) AS sd0cnt, COUNT(DISTINCT CASE WHEN sd.sdtype = 0 THEN lsd.lectno END) AS sd0lectcnt, AVG(CASE WHEN sd.sdtype = 0 AND sd.tpoint > 0 THEN IFNULL(lsd.cpoint, 0) / sd.tpoint * 100 ELSE 0 END) AS sd0lectpoint
+ , COUNT(DISTINCT CASE WHEN sd.sdtype = 1 THEN sd.sdno END) AS sd1cnt, COUNT(DISTINCT CASE WHEN sd.sdtype = 1 THEN lsd.lectno END) AS sd1lectcnt, AVG(CASE WHEN sd.sdtype = 1 AND sd.tpoint > 0 THEN IFNULL(lsd.cpoint, 0) / sd.tpoint * 100 ELSE 0 END) AS sd1lectpoint
+ , COUNT(DISTINCT CASE WHEN rs.rstype = 0 THEN rs.rsno END) AS rs0cnt, COUNT(DISTINCT CASE WHEN rs.rstype = 0 THEN lrs.lectno END) AS rs0lectcnt
+ , COUNT(DISTINCT ci.cmino) AS at0cnt, COUNT(DISTINCT li.lectno) AS at0lectcnt
+ FROM filtered_lect fl
+ LEFT JOIN cmex ex ON ex.cmno = fl.cmno AND ex.isdel = 0 LEFT JOIN lectex lex ON lex.lectno = fl.lectno AND lex.exno = ex.exno
+ LEFT JOIN cmsd sd ON sd.cmno = fl.cmno AND sd.isdel = 0 LEFT JOIN lectsd lsd ON lsd.lectno = fl.lectno AND lsd.sdno = sd.sdno
+ LEFT JOIN cmrs rs ON rs.cmno = fl.cmno AND rs.rstype = 0 AND rs.isdel = 0 LEFT JOIN lectrs lrs ON lrs.lectno = fl.lectno AND lrs.rsno = rs.rsno
+ LEFT JOIN cminning ci ON ci.cmno = fl.cmno AND ci.isonline = 0 AND ci.isscd = 1 LEFT JOIN lectinning li ON li.cmino = ci.cmino AND li.lectno = fl.lectno AND li.istatus = 2
+ WHERE ex.cmisno > 0
GROUP BY fl.lectno, fl.cmno, fl.isrebate, fl.attrate
),
final_scores AS (
@@ -1086,6 +1107,7 @@
LEFT OUTER JOIN comcode tg ON tg.ccode = ppl.typegrade
LEFT OUTER JOIN comcode tj ON tj.ccode = ppl.typejob
WHERE 1=1
+ AND fs.ex1cnt < 2
@@ -1989,6 +2011,143 @@
a.lectno = #lectno#
+
+
+ SELECT a.*
+ FROM (
+ SELECT a.lectno
+ ,(b.attrate / 100) * (CASE WHEN b.isrebate = 1 THEN d.attendrfd ELSE d.attend END / 100) * 100 apoint
+ ,a.ex0cnt,a.ex0lectcnt,a.ex0lectpoint
+ ,(a.ex0lectpoint / 100) * (CASE WHEN b.isrebate = 1 THEN d.midrfd ELSE d.mid END / 100) * 100 mpoint
+ ,a.ex1cnt,a.ex1lectcnt,a.ex1lectpoint
+ ,(a.ex1lectpoint / 100) * (CASE WHEN b.isrebate = 1 THEN d.finalrfd ELSE d.final END / 100) * 100 fpoint
+ ,a.sd0cnt,a.sd0lectcnt,a.sd0lectpoint
+ ,(a.sd0lectpoint / 100) * (CASE WHEN b.isrebate = 1 THEN d.subjectrfd ELSE d.subject END / 100) * 100 spoint
+ ,a.sd1cnt,a.sd1lectcnt,a.sd1lectpoint
+ ,(a.sd1lectpoint / 100) * (CASE WHEN b.isrebate = 1 THEN d.discussrfd ELSE d.discuss END / 100) * 100 dpoint
+ ,a.rs0cnt,a.rs0lectcnt,a.rs0lectpoint
+ ,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.attendcutrfd ELSE d.attendcut END) <= b.attrate THEN 1 ELSE 0 END) ispassa
+ ,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.midcutrfd ELSE d.midcut END ) <= a.ex0lectpoint THEN 1 ELSE 0 END) ispassm
+ ,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.finalcutrfd ELSE d.finalcut END) <= a.ex1lectpoint THEN 1 ELSE 0 END) ispassf
+ ,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.subjectcutrfd ELSE d.subjectcut END) <= a.sd0lectpoint THEN 1 ELSE 0 END) ispasss
+ ,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.discusscutrfd ELSE d.discusscut END) <= a.sd1lectpoint THEN 1 ELSE 0 END) ispassd
+ ,(CASE WHEN (CASE WHEN ifnull(d.isoffabs, 0) = 1 THEN ifnull(a.at0cnt, 0) ELSE 0 END) <= ifnull(a.at0lectcnt, 0) THEN 1 ELSE 0 END) ispassat
+ ,(CASE WHEN (CASE WHEN (CASE WHEN ifnull(d.isoffabs, 0) = 1 THEN ifnull(a.at0cnt, 0) ELSE 0 END) <= ifnull(a.at0lectcnt, 0) THEN 1 ELSE 0 END) = 1 AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.attendcutrfd ELSE d.attendcut END) <= b.attrate THEN 1 ELSE 0 END) = 1
+ AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.midcutrfd ELSE d.midcut END) <= a.ex0lectpoint THEN 1 ELSE 0 END) = 1 AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.finalcutrfd ELSE d.finalcut END) <= a.ex1lectpoint THEN 1 ELSE 0 END) = 1
+ AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.subjectcutrfd ELSE d.subjectcut END) <= a.sd0lectpoint THEN 1 ELSE 0 END) = 1 AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.discusscutrfd ELSE d.discusscut END) <= a.sd1lectpoint THEN 1 ELSE 0 END) = 1
+ AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.cutrfd ELSE d.cut END) <= ((b.attrate / 100) * ((CASE WHEN b.isrebate = 1 THEN d.attendrfd ELSE d.attend END) / 100 * 100)) + ((a.ex0lectpoint / 100) * ((CASE WHEN b.isrebate = 1 THEN d.midrfd ELSE d.mid END) / 100) * 100)
+ + ((a.ex1lectpoint / 100) * ((CASE WHEN b.isrebate = 1 THEN d.finalrfd ELSE d.final END) / 100) * 100) + ((a.sd0lectpoint / 100) * ((CASE WHEN b.isrebate = 1 THEN d.subjectrfd ELSE d.subject END) / 100) * 100)
+ + ((a.sd1lectpoint / 100) * ((CASE WHEN b.isrebate = 1 THEN d.discussrfd ELSE d.discuss END) / 100) * 100) THEN 1 ELSE 0 END) = 1 THEN 1 ELSE 0 END) ispass
+ FROM (
+ SELECT a.lectno
+ ,sum(ex0cnt) ex0cnt,sum(ex0lectcnt) ex0lectcnt,sum(ex0lectpoint) ex0lectpoint,sum(ex1cnt) ex1cnt,sum(ex1lectcnt) ex1lectcnt,sum(ex1lectpoint) ex1lectpoint,sum(sd0cnt) sd0cnt,sum(sd0lectcnt) sd0lectcnt,sum(sd0lectpoint) sd0lectpoint
+ ,sum(sd1cnt) sd1cnt,sum(sd1lectcnt) sd1lectcnt,sum(sd1lectpoint) sd1lectpoint,sum(rs0cnt) rs0cnt,sum(rs0lectcnt) rs0lectcnt,sum(rs0lectpoint) rs0lectpoint,sum(at0cnt) at0cnt,sum(at0lectcnt) at0lectcnt
+ FROM (
+ SELECT a.lectno
+ ,count(b.exno) ex0cnt,count(c.lectno) ex0lectcnt,avg(ifnull(c.tpoint, 0) / b.tpoint * 100) ex0lectpoint,0 ex1cnt,0 ex1lectcnt,0 ex1lectpoint,0 sd0cnt
+ ,0 sd0lectcnt,0 sd0lectpoint,0 sd1cnt,0 sd1lectcnt,0 sd1lectpoint,0 rs0cnt,0 rs0lectcnt,0 rs0lectpoint,0 at0cnt,0 at0lectcnt
+ FROM (
+ SELECT b.lectno,a.cmno
+ FROM cm a
+ INNER JOIN lect b ON b.cmno = a.cmno AND b.STATUS = 1 AND b.ischanged = 0 AND b.lectno = #lectno#
+ INNER JOIN users c ON c.userno = b.userno AND c.STATUS < 99
+ WHERE a.ismaster = 0 AND a.isdel = 0
+ ) a
+ LEFT OUTER JOIN cmex b ON b.cmno = a.cmno AND b.extype = 0 AND b.isdel = 0
+ LEFT OUTER JOIN lectex c ON c.lectno = a.lectno AND c.exno = b.exno
+ GROUP BY a.lectno
+
+ UNION ALL
+
+ SELECT a.lectno
+ ,a.ex0cnt,a.ex0lectcnt,a.ex0lectpoint,a.ex1cnt,a.ex1lectcnt,a.ex1lectpoint,a.sd0cnt
+ ,a.sd0lectcnt,a.sd0lectpoint,a.sd1cnt,a.sd1lectcnt,a.sd1lectpoint,a.rs0cnt,a.rs0lectcnt,a.rs0lectpoint,a.at0cnt,a.at0lectcnt
+ FROM (
+ SELECT a.lectno
+ ,0 ex0cnt,0 ex0lectcnt,0 ex0lectpoint,count(b.exno) ex1cnt,count(c.lectno) ex1lectcnt,avg(ifnull(c.tpoint, 0) / b.tpoint * 100) ex1lectpoint,0 sd0cnt
+ ,0 sd0lectcnt,0 sd0lectpoint,0 sd1cnt,0 sd1lectcnt,0 sd1lectpoint,0 rs0cnt,0 rs0lectcnt,0 rs0lectpoint,0 at0cnt,0 at0lectcnt
+ ,row_number() OVER (PARTITION BY a.lectno ORDER BY (c.estart IS NOT NULL) DESC) rn
+ FROM (
+ SELECT b.lectno,a.cmno
+ FROM cm a
+ INNER JOIN lect b ON b.cmno = a.cmno AND b.STATUS = 1 AND b.ischanged = 0 AND b.lectno = #lectno#
+ INNER JOIN users c ON c.userno = b.userno AND c.STATUS < 99
+ WHERE a.ismaster = 0 AND a.isdel = 0
+ ) a
+ LEFT OUTER JOIN cmex b ON b.cmno = a.cmno AND b.extype = 1 AND b.isdel = 0
+ LEFT OUTER JOIN lectex c ON c.lectno = a.lectno AND c.exno = b.exno
+ GROUP BY a.lectno,b.exno
+ ) a
+ WHERE a.rn = 1
+
+ UNION ALL
+
+ SELECT a.lectno
+ ,0,0,0,0,0,0,count(b.sdno),count(c.lectno),avg(ifnull(c.cpoint, 0) / b.tpoint * 100),0,0,0,0,0,0,0,0
+ FROM (
+ SELECT b.lectno,a.cmno
+ FROM cm a
+ INNER JOIN lect b ON b.cmno = a.cmno AND b.STATUS = 1 AND b.ischanged = 0 AND b.lectno = #lectno#
+ INNER JOIN users c ON c.userno = b.userno AND c.STATUS < 99
+ WHERE a.ismaster = 0 AND a.isdel = 0
+ ) a
+ LEFT OUTER JOIN cmsd b ON b.cmno = a.cmno AND b.sdtype = 0 AND b.isdel = 0
+ LEFT OUTER JOIN lectsd c ON c.lectno = a.lectno AND c.sdno = b.sdno
+ GROUP BY a.lectno
+
+ UNION ALL
+
+ SELECT a.lectno
+ ,0,0,0,0,0,0,0,0,0,count(b.sdno),count(c.lectno),avg(ifnull(c.cpoint, 0) / b.tpoint * 100),0,0,0,0,0
+ FROM (
+ SELECT b.lectno,a.cmno
+ FROM cm a
+ INNER JOIN lect b ON b.cmno = a.cmno AND b.STATUS = 1 AND b.ischanged = 0 AND b.lectno = #lectno#
+ INNER JOIN users c ON c.userno = b.userno AND c.STATUS < 99
+ WHERE a.ismaster = 0 AND a.isdel = 0
+ ) a
+ LEFT OUTER JOIN cmsd b ON b.cmno = a.cmno AND b.sdtype = 1
+ AND b.isdel = 0
+ LEFT OUTER JOIN lectsd c ON c.lectno = a.lectno AND c.sdno = b.sdno
+ GROUP BY a.lectno
+
+ UNION ALL
+
+ SELECT a.lectno
+ ,0,0,0,0,0,0,0,0,0,0,0,0,count(b.rsno),count(c.lectno),0,0,0
+ FROM (
+ SELECT b.lectno,a.cmno
+ FROM cm a
+ INNER JOIN lect b ON b.cmno = a.cmno AND b.STATUS = 1 AND b.ischanged = 0 AND b.lectno = #lectno#
+ INNER JOIN users c ON c.userno = b.userno AND c.STATUS < 99
+ WHERE a.ismaster = 0 AND a.isdel = 0
+ ) a
+ LEFT OUTER JOIN cmrs b ON b.cmno = a.cmno AND b.rstype = 0 AND b.isdel = 0
+ LEFT OUTER JOIN lectrs c ON c.lectno = a.lectno AND c.rsno = b.rsno
+ GROUP BY a.lectno
+
+ UNION ALL
+
+ SELECT a.lectno
+ ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,count(b.cmino),count(c.lectno)
+ FROM (
+ SELECT b.lectno,a.cmno
+ FROM cm a
+ INNER JOIN lect b ON b.cmno = a.cmno AND b.STATUS = 1 AND b.ischanged = 0 AND b.lectno = #lectno#
+ INNER JOIN users c ON c.userno = b.userno AND c.STATUS < 99
+ WHERE a.ismaster = 0 AND a.isdel = 0
+ ) a
+ LEFT OUTER JOIN cminning b ON b.cmno = a.cmno AND b.isonline = 0 AND b.isscd = 1
+ LEFT OUTER JOIN lectinning c ON c.cmino = b.cmino AND c.lectno = a.lectno AND c.istatus = 2
+ GROUP BY a.lectno
+ ) a
+ GROUP BY a.lectno
+ ) a
+ INNER JOIN lect b ON b.lectno = a.lectno
+ INNER JOIN cmev d ON d.cmno = b.cmno
+ ) a
+ WHERE a.lectno = #lectno#
+
diff --git a/Dao/bin/Debug/MyBatis/Maps/Lect.xml b/Dao/bin/Debug/MyBatis/Maps/Lect.xml
index 5b7e46c..cb770c3 100644
--- a/Dao/bin/Debug/MyBatis/Maps/Lect.xml
+++ b/Dao/bin/Debug/MyBatis/Maps/Lect.xml
@@ -1125,80 +1125,85 @@
order by a.rno
- select a.*
+ select *
from (
- select a.lectno,a.userno,a.cmno,a.isrebate
- ,p.payoktime,a.sdate,a.edate
- ,b.exno,b.exname,b.extype
- ,b2.cshape,b2.cname
- ,c.estart,c.eend,c.eip,c.tpoint,c.recount,c.entercount,c.cblock,c.isbyadmin
- ,d.username,d.userid
- ,e.asname
- ,f.cmisno,f.estart lestart,f.eend leend,f.sseq
- ,g.cname studyplacename
- ,a.iscomplete
- ,row_number() over(order by $orderby$ d.username ) rno
- ,count(a.cdt) over() pagetotalcount
- ,cast(AES_DECRYPT(UNHEX(d.mobile), 'np123@!' ) as char) as mobile
- from lect a
- inner join cmex b on b.isdel=0 and b.cmno = a.cmno
- inner join cm b2 on b2.cmno = b.cmno
- inner join pay p on p.payno = a.payno
- left outer join lectex c on c.lectno = a.lectno and c.exno =b.exno
- inner join users d on d.userno = a.userno
- left outer join assign e on e.asno = d.asno
- left outer join cminningscd f on f.cmisno = a.cmisno
- left outer join comcode g on g.ccode = f.studyplace and g.isuse =1
+ select a.*
+ ,row_number() over(order by $orderby$ a.username ) rno
+ ,count(a.lectno) OVER () pagetotalcount
+ from (
+ select a.lectno,a.userno,a.cmno,a.isrebate
+ ,p.payoktime,a.sdate,a.edate
+ ,b.exno,b.exname,b.extype
+ ,b2.cshape,b2.cname
+ ,c.estart,c.eend,c.eip,c.tpoint,c.recount,c.entercount,c.cblock,c.isbyadmin
+ ,d.username,d.userid
+ ,e.asname
+ ,f.cmisno,f.estart lestart,f.eend leend,f.sseq
+ ,g.cname studyplacename
+ ,a.iscomplete
+ ,row_number() OVER (PARTITION BY a.lectno ORDER BY (c.estart IS NOT NULL) DESC) rn
+ ,cast(AES_DECRYPT(UNHEX(d.mobile), 'np123@!' ) as char) as mobile
+ from lect a
+ inner join cmex b on b.isdel=0 and b.cmno = a.cmno
+ inner join cm b2 on b2.cmno = b.cmno
+ inner join pay p on p.payno = a.payno
+ left outer join lectex c on c.lectno = a.lectno and c.exno =b.exno
+ inner join users d on d.userno = a.userno
+ left outer join assign e on e.asno = d.asno
+ left outer join cminningscd f on f.cmisno = a.cmisno
+ left outer join comcode g on g.ccode = f.studyplace and g.isuse =1
- left outer join cmev ce on b2.cmno=ce.cmno
- left outer join lect l on a.lectno = l.lectno
- left outer join cminningscd cis on l.cmisno = cis.cmisno
- left outer join lectinning li on a.lectno = li.lectno and cis.cmino = li.cmino
+ left outer join cmev ce on b2.cmno=ce.cmno
+ left outer join lect l on a.lectno = l.lectno
+ left outer join cminningscd cis on l.cmisno = cis.cmisno
+ left outer join lectinning li on a.lectno = li.lectno and cis.cmino = li.cmino
- where a.status = 1 and a.ischanged=0 and d.status < 99
- and b.extype = #extype#
- and a.cmno = #cmno#
- and a.isrebate=#isrebate#
- and (date_format((case when b2.cshape = 2 and f.eend is not null then f.eend else a.edate end),'%Y-%m-%d') = #edate#)
- and ((case when b2.cshape = 2 and f.eend is not null then f.eend else a.edate end) >= #edate1#)
- and ((case when b2.cshape = 2 and f.eend is not null then f.eend else a.edate end) <= #edate2#)
- and b2.cshape = #cshape#
- and b2.cname like concat('%',#cname#,'%')
- and b2.cname like concat('%',#cname#,'%')
- and ifnull(a.iscomplete,0) = #iscomplete#
- and f.studyplace = #studyplace#
- and d.username like concat('%',#usernamestr#,'%')
- and d.userid like concat('%',#useridstr#,'%')
-
- and d.username like concat('%',#usernamestr#,'%')
- and d.userid like concat('%',#useridstr#,'%')
-
-
- and c.estart is null
- and c.estart is not null and c.eend is null
- and c.eend is not null
-
- and (case when b2.cshape = 0 and a.isrebate = 0 then p.payoktime else a.sdate end) >= date_format(#sdateall#,'%Y-%m-%d 00:00:00')
- and (case when b2.cshape = 2 then f.eend else a.edate end) <= date_format(#edateall#,'%Y-%m-%d 23:59:59')
- and e.asname like concat('%',#asname#,'%')
- and (cast(AES_DECRYPT(UNHEX(d.mobile), 'np123@!' ) as char) like concat('%',#mobile#,'%'))
-
-
- ifnull(ce.isoffabs,0) = 0
-
- ifnull(ce.isoffabs,0) = 1
-
- ifnull(ce.isoffabs,0) = 1 and li.istatus is null
-
- ifnull(ce.isoffabs,0) = 1 and ifnull(li.istatus,-1) = 2
-
- ifnull(ce.isoffabs,0) = 1 and ifnull(li.istatus,-1) = 0
-
-
- (c.isbyadmin = 0 or c.isbyadmin is null) and c.estart is null
- c.isbyadmin = 0 and c.estart is not null
- c.isbyadmin = 1
-
+ where a.status = 1 and a.ischanged=0 and d.status < 99
+ and b.extype = #extype#
+ and a.cmno = #cmno#
+ and a.isrebate=#isrebate#
+ and (date_format((case when b2.cshape = 2 and f.eend is not null then f.eend else a.edate end),'%Y-%m-%d') = #edate#)
+ and ((case when b2.cshape = 2 and f.eend is not null then f.eend else a.edate end) >= #edate1#)
+ and ((case when b2.cshape = 2 and f.eend is not null then f.eend else a.edate end) <= #edate2#)
+ and b2.cshape = #cshape#
+ and b2.cname like concat('%',#cname#,'%')
+ and b2.cname like concat('%',#cname#,'%')
+ and ifnull(a.iscomplete,0) = #iscomplete#
+ and f.studyplace = #studyplace#
+ and d.username like concat('%',#usernamestr#,'%')
+ and d.userid like concat('%',#useridstr#,'%')
+
+ and d.username like concat('%',#usernamestr#,'%')
+ and d.userid like concat('%',#useridstr#,'%')
+
+
+ and c.estart is null
+ and c.estart is not null and c.eend is null
+ and c.eend is not null
+
+ and (case when b2.cshape = 0 and a.isrebate = 0 then p.payoktime else a.sdate end) >= date_format(#sdateall#,'%Y-%m-%d 00:00:00')
+ and (case when b2.cshape = 2 then f.eend else a.edate end) <= date_format(#edateall#,'%Y-%m-%d 23:59:59')
+ and e.asname like concat('%',#asname#,'%')
+ and (cast(AES_DECRYPT(UNHEX(d.mobile), 'np123@!' ) as char) like concat('%',#mobile#,'%'))
+
+
+ ifnull(ce.isoffabs,0) = 0
+
+ ifnull(ce.isoffabs,0) = 1
+
+ ifnull(ce.isoffabs,0) = 1 and li.istatus is null
+
+ ifnull(ce.isoffabs,0) = 1 and ifnull(li.istatus,-1) = 2
+
+ ifnull(ce.isoffabs,0) = 1 and ifnull(li.istatus,-1) = 0
+
+
+ (c.isbyadmin = 0 or c.isbyadmin is null) and c.estart is null
+ c.isbyadmin = 0 and c.estart is not null
+ c.isbyadmin = 1
+
+ ) a
+ WHERE a.rn = 1
) a
order by a.rno
diff --git a/Dao/bin/Debug/NP.Model.dll b/Dao/bin/Debug/NP.Model.dll
index 3b4857a6ccd785b9cf64ea18ff89601f8b473fb8..f22bbb3d1d58e53a209eb2952d0803a9cbbb6c87 100644
GIT binary patch
delta 111
zcmZoTBhzq3Wt=&wm-OR1sEUn$Ft=()}yV(QT1uPbKwYhDW;?#aF
zaq1!uo)_ESu(NlF>Hzg*G5`S+5X&$!F!WfnGxW%^GXw>@1WPxi%lO%B^615tXZ1F%@mlwGw#}=!
M(3tHDWZ4rq0EKxbB>(^b
diff --git a/Dao/bin/Debug/NP.Model.pdb b/Dao/bin/Debug/NP.Model.pdb
index 098b802f3de37ed828db3339214d31373fe716bb..6f213bb9c6c14d598f7c39c44593de8f4561c602 100644
GIT binary patch
delta 171
zcmZoT6Vz}fXaftE#NJ8KnT!k!4AM>MGJZCjJo3-y($+1
zoXi*`JTXAF*&(FeA%qc#nShuXh*^M`6^Pk@m>q~YfS41Axqz4(h-A*
bfLIWSg@9OiyF-Y`5mB5@*e;VL^28bd?x8xu
delta 171
zcmZoT6Vz}fXaftEL`-0KCL;p_!>jPAXZ1F%@mlwGw#}=!(3s6KTyH!%참여조건 : 진도율 @(d.intval2)% 이상 @trainingDateText
}
@@ -140,7 +146,7 @@
}
} else {
- if ((currentProgresRate >= d.intval2) && IsDateInRange(d.time3, d.time4)) {
+ if ((currentProgresRate >= d.intval2) && IsDateInRange(d.time3, d.time4) && (ViewBag.exCheck || (d.intval6 == 16 || d.intval6 == 14))) {
@*
diff --git a/Model/bin/Debug/NP.Model.dll b/Model/bin/Debug/NP.Model.dll
index 3b4857a6ccd785b9cf64ea18ff89601f8b473fb8..f22bbb3d1d58e53a209eb2952d0803a9cbbb6c87 100644
GIT binary patch
delta 111
zcmZoTBhzq3Wt=&wm-OR1sEUn$Ft=()}yV(QT1uPbKwYhDW;?#aF
zaq1!uo)_ESu(NlF>Hzg*G5`S+5X&$!F!WfnGxW%^GXw>@1WPxi%lO%B^615tXZ1F%@mlwGw#}=!
M(3tHDWZ4rq0EKxbB>(^b
diff --git a/Model/bin/Debug/NP.Model.pdb b/Model/bin/Debug/NP.Model.pdb
index 098b802f3de37ed828db3339214d31373fe716bb..6f213bb9c6c14d598f7c39c44593de8f4561c602 100644
GIT binary patch
delta 171
zcmZoT6Vz}fXaftE#NJ8KnT!k!4AM>MGJZCjJo3-y($+1
zoXi*`JTXAF*&(FeA%qc#nShuXh*^M`6^Pk@m>q~YfS41Axqz4(h-A*
bfLIWSg@9OiyF-Y`5mB5@*e;VL^28bd?x8xu
delta 171
zcmZoT6Vz}fXaftEL`-0KCL;p_!>jPAXZ1F%@mlwGw#}=!(3s6KTyH!%t=&wm-OR1sEUn$Ft=()}yV(QT1uPbKwYhDW;?#aF
zaq1!uo)_ESu(NlF>Hzg*G5`S+5X&$!F!WfnGxW%^GXw>@1WPxi%lO%B^615tXZ1F%@mlwGw#}=!
M(3tHDWZ4rq0EKxbB>(^b
diff --git a/Model/obj/Debug/NP.Model.pdb b/Model/obj/Debug/NP.Model.pdb
index 098b802f3de37ed828db3339214d31373fe716bb..6f213bb9c6c14d598f7c39c44593de8f4561c602 100644
GIT binary patch
delta 171
zcmZoT6Vz}fXaftE#NJ8KnT!k!4AM>MGJZCjJo3-y($+1
zoXi*`JTXAF*&(FeA%qc#nShuXh*^M`6^Pk@m>q~YfS41Axqz4(h-A*
bfLIWSg@9OiyF-Y`5mB5@*e;VL^28bd?x8xu
delta 171
zcmZoT6Vz}fXaftEL`-0KCL;p_!>jPAXZ1F%@mlwGw#}=!(3s6KTyH!%