추가개발01/06_1

This commit is contained in:
김한진 2026-01-06 08:58:17 +09:00
parent f838f54d08
commit ed5ed86f12
14 changed files with 543 additions and 207 deletions

View File

@ -94,7 +94,7 @@
} }
@*최종평가*@ @*최종평가*@
<td>@(d.ex1cnt < 1 ? "-" :d.ex1lectcnt < 1 && d.ex1cnt > 0 ? "미제출" : d.ex1lectpoint.ToString())</td> <td>@(d.ex1cnt < 1 ? "-" : d.ex1lectcnt < 1 && d.ex1cnt > 0 ? "미제출" : d.ex1lectpoint.ToString())</td>
@*과제*@ @*과제*@
<td>@(d.sd0cnt < 1 ? "-" :d.sd0lectcnt < 1 && d.sd0cnt > 0 ? "미제출" : d.sd0lectpoint.ToString())</td> <td>@(d.sd0cnt < 1 ? "-" :d.sd0lectcnt < 1 && d.sd0cnt > 0 ? "미제출" : d.sd0lectpoint.ToString())</td>

View File

@ -516,7 +516,8 @@ namespace NP.Base.Controllers
{ {
try try
{ {
var ispass = Dao.Get<Lect>("grade.ispass", new Hashtable() { { "lectno", lect.lectno } }).FirstOrDefault().ispass; //var ispass = Dao.Get<Lect>("grade.ispass", new Hashtable() { { "lectno", lect.lectno } }).FirstOrDefault().ispass;
var ispass = Dao.Get<Lect>("grade.ispass2", new Hashtable() { { "lectno", lect.lectno } }).FirstOrDefault().ispass;
if (ispass == 1) if (ispass == 1)
{ {
if (lect.iscomplete == 0) if (lect.iscomplete == 0)

View File

@ -81,13 +81,13 @@
left outer join lectex c on c.lectno=a.lectno and c.exno=b.exno left outer join lectex c on c.lectno=a.lectno and c.exno=b.exno
group by a.lectno group by a.lectno
union all union all
select *
from (
select a.lectno select a.lectno
,0,0,0 ,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
,count(b.exno),count(c.lectno),avg(ifnull(c.tpoint,0) / b.tpoint * 100) ,0 sd0lectcnt,0 sd0lectpoint,0 sd1cnt,0 sd1lectcnt,0 sd1lectpoint,0 rs0cnt,0 rs0lectcnt,0 rs0lectpoint,0 at0cnt,0 at0lectcnt
,0,0,0 ,row_number() OVER (PARTITION BY a.lectno ORDER BY (c.estart IS NOT NULL) DESC) rn
,0,0,0
,0,0,0
,0,0
from ( from (
select b.lectno,a.cmno select b.lectno,a.cmno
from cm a from cm a
@ -110,7 +110,10 @@
) a ) a
left outer join cmex b on b.cmno=a.cmno and b.extype=1 and b.isdel=0 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 left outer join lectex c on c.lectno=a.lectno and c.exno=b.exno
group by a.lectno GROUP BY a.lectno,b.exno
) a
where a.rn = 1
union all union all
select a.lectno select a.lectno
,0,0,0 ,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 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 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 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 GROUP BY fl.lectno, fl.cmno, fl.isrebate, fl.attrate
), ),
final_scores AS ( final_scores AS (
@ -1086,6 +1107,7 @@
LEFT OUTER JOIN comcode tg ON tg.ccode = ppl.typegrade LEFT OUTER JOIN comcode tg ON tg.ccode = ppl.typegrade
LEFT OUTER JOIN comcode tj ON tj.ccode = ppl.typejob LEFT OUTER JOIN comcode tj ON tj.ccode = ppl.typejob
WHERE 1=1 WHERE 1=1
AND fs.ex1cnt &lt; 2
<dynamic> <dynamic>
<isNotNull property="est1not"><![CDATA[AND fs.ex0lectcnt < fs.ex0cnt]]></isNotNull> <isNotNull property="est1not"><![CDATA[AND fs.ex0lectcnt < fs.ex0cnt]]></isNotNull>
<isNotNull property="est2not"><![CDATA[AND fs.ex1lectcnt < fs.ex1cnt]]></isNotNull> <isNotNull property="est2not"><![CDATA[AND fs.ex1lectcnt < fs.ex1cnt]]></isNotNull>
@ -1989,6 +2011,143 @@
<isNotNull property="lectno" prepend="and">a.lectno = #lectno#</isNotNull> <isNotNull property="lectno" prepend="and">a.lectno = #lectno#</isNotNull>
</dynamic> </dynamic>
</select> </select>
<select id="grade.ispass2" parameterClass="hashtable" resultClass="lect">
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) &lt;= b.attrate THEN 1 ELSE 0 END) ispassa
,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.midcutrfd ELSE d.midcut END ) &lt;= a.ex0lectpoint THEN 1 ELSE 0 END) ispassm
,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.finalcutrfd ELSE d.finalcut END) &lt;= a.ex1lectpoint THEN 1 ELSE 0 END) ispassf
,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.subjectcutrfd ELSE d.subjectcut END) &lt;= a.sd0lectpoint THEN 1 ELSE 0 END) ispasss
,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.discusscutrfd ELSE d.discusscut END) &lt;= 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) &lt;= 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) &lt;= 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) &lt;= b.attrate THEN 1 ELSE 0 END) = 1
AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.midcutrfd ELSE d.midcut END) &lt;= a.ex0lectpoint THEN 1 ELSE 0 END) = 1 AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.finalcutrfd ELSE d.finalcut END) &lt;= a.ex1lectpoint THEN 1 ELSE 0 END) = 1
AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.subjectcutrfd ELSE d.subjectcut END) &lt;= a.sd0lectpoint THEN 1 ELSE 0 END) = 1 AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.discusscutrfd ELSE d.discusscut END) &lt;= a.sd1lectpoint THEN 1 ELSE 0 END) = 1
AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.cutrfd ELSE d.cut END) &lt;= ((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 &lt; 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 &lt; 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 &lt; 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 &lt; 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 &lt; 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 &lt; 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#
</select>
</statements> </statements>
</sqlMap> </sqlMap>

View File

@ -1125,7 +1125,11 @@
order by a.rno order by a.rno
</select> </select>
<select id="lect.lectexes.all" parameterClass="hashtable" resultClass="lectex"> <select id="lect.lectexes.all" parameterClass="hashtable" resultClass="lectex">
select *
from (
select a.* select a.*
,row_number() over(order by <isNotNull property="orderby">$orderby$</isNotNull><isNull property="orderby">a.username</isNull>) rno
,count(a.lectno) OVER () pagetotalcount
from ( from (
select a.lectno,a.userno,a.cmno,a.isrebate select a.lectno,a.userno,a.cmno,a.isrebate
,p.payoktime,a.sdate,a.edate ,p.payoktime,a.sdate,a.edate
@ -1137,8 +1141,7 @@
,f.cmisno,f.estart lestart,f.eend leend,f.sseq ,f.cmisno,f.estart lestart,f.eend leend,f.sseq
,g.cname studyplacename ,g.cname studyplacename
,a.iscomplete ,a.iscomplete
,row_number() over(order by <isNotNull property="orderby">$orderby$</isNotNull><isNull property="orderby">d.username</isNull>) rno ,row_number() OVER (PARTITION BY a.lectno ORDER BY (c.estart IS NOT NULL) DESC) rn
,count(a.cdt) over() pagetotalcount
,cast(AES_DECRYPT(UNHEX(d.mobile), 'np123@!' ) as char) as mobile ,cast(AES_DECRYPT(UNHEX(d.mobile), 'np123@!' ) as char) as mobile
from lect a from lect a
inner join cmex b on b.isdel=0 and b.cmno = a.cmno inner join cmex b on b.isdel=0 and b.cmno = a.cmno
@ -1200,6 +1203,8 @@
<isEqual property="isbyadmin" compareValue="1" prepend="and">c.isbyadmin = 1</isEqual> <isEqual property="isbyadmin" compareValue="1" prepend="and">c.isbyadmin = 1</isEqual>
</isNotNull> </isNotNull>
) a ) a
WHERE a.rn = 1
) a
<include refid="sql.pagedynamic"></include> <include refid="sql.pagedynamic"></include>
order by a.rno order by a.rno
</select> </select>

View File

@ -81,13 +81,13 @@
left outer join lectex c on c.lectno=a.lectno and c.exno=b.exno left outer join lectex c on c.lectno=a.lectno and c.exno=b.exno
group by a.lectno group by a.lectno
union all union all
select *
from (
select a.lectno select a.lectno
,0,0,0 ,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
,count(b.exno),count(c.lectno),avg(ifnull(c.tpoint,0) / b.tpoint * 100) ,0 sd0lectcnt,0 sd0lectpoint,0 sd1cnt,0 sd1lectcnt,0 sd1lectpoint,0 rs0cnt,0 rs0lectcnt,0 rs0lectpoint,0 at0cnt,0 at0lectcnt
,0,0,0 ,row_number() OVER (PARTITION BY a.lectno ORDER BY (c.estart IS NOT NULL) DESC) rn
,0,0,0
,0,0,0
,0,0
from ( from (
select b.lectno,a.cmno select b.lectno,a.cmno
from cm a from cm a
@ -110,7 +110,10 @@
) a ) a
left outer join cmex b on b.cmno=a.cmno and b.extype=1 and b.isdel=0 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 left outer join lectex c on c.lectno=a.lectno and c.exno=b.exno
group by a.lectno GROUP BY a.lectno,b.exno
) a
where a.rn = 1
union all union all
select a.lectno select a.lectno
,0,0,0 ,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 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 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 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 GROUP BY fl.lectno, fl.cmno, fl.isrebate, fl.attrate
), ),
final_scores AS ( final_scores AS (
@ -1086,6 +1107,7 @@
LEFT OUTER JOIN comcode tg ON tg.ccode = ppl.typegrade LEFT OUTER JOIN comcode tg ON tg.ccode = ppl.typegrade
LEFT OUTER JOIN comcode tj ON tj.ccode = ppl.typejob LEFT OUTER JOIN comcode tj ON tj.ccode = ppl.typejob
WHERE 1=1 WHERE 1=1
AND fs.ex1cnt &lt; 2
<dynamic> <dynamic>
<isNotNull property="est1not"><![CDATA[AND fs.ex0lectcnt < fs.ex0cnt]]></isNotNull> <isNotNull property="est1not"><![CDATA[AND fs.ex0lectcnt < fs.ex0cnt]]></isNotNull>
<isNotNull property="est2not"><![CDATA[AND fs.ex1lectcnt < fs.ex1cnt]]></isNotNull> <isNotNull property="est2not"><![CDATA[AND fs.ex1lectcnt < fs.ex1cnt]]></isNotNull>
@ -1989,6 +2011,143 @@
<isNotNull property="lectno" prepend="and">a.lectno = #lectno#</isNotNull> <isNotNull property="lectno" prepend="and">a.lectno = #lectno#</isNotNull>
</dynamic> </dynamic>
</select> </select>
<select id="grade.ispass2" parameterClass="hashtable" resultClass="lect">
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) &lt;= b.attrate THEN 1 ELSE 0 END) ispassa
,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.midcutrfd ELSE d.midcut END ) &lt;= a.ex0lectpoint THEN 1 ELSE 0 END) ispassm
,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.finalcutrfd ELSE d.finalcut END) &lt;= a.ex1lectpoint THEN 1 ELSE 0 END) ispassf
,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.subjectcutrfd ELSE d.subjectcut END) &lt;= a.sd0lectpoint THEN 1 ELSE 0 END) ispasss
,(CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.discusscutrfd ELSE d.discusscut END) &lt;= 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) &lt;= 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) &lt;= 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) &lt;= b.attrate THEN 1 ELSE 0 END) = 1
AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.midcutrfd ELSE d.midcut END) &lt;= a.ex0lectpoint THEN 1 ELSE 0 END) = 1 AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.finalcutrfd ELSE d.finalcut END) &lt;= a.ex1lectpoint THEN 1 ELSE 0 END) = 1
AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.subjectcutrfd ELSE d.subjectcut END) &lt;= a.sd0lectpoint THEN 1 ELSE 0 END) = 1 AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.discusscutrfd ELSE d.discusscut END) &lt;= a.sd1lectpoint THEN 1 ELSE 0 END) = 1
AND (CASE WHEN (CASE WHEN b.isrebate = 1 THEN d.cutrfd ELSE d.cut END) &lt;= ((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 &lt; 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 &lt; 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 &lt; 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 &lt; 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 &lt; 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 &lt; 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#
</select>
</statements> </statements>
</sqlMap> </sqlMap>

View File

@ -1125,7 +1125,11 @@
order by a.rno order by a.rno
</select> </select>
<select id="lect.lectexes.all" parameterClass="hashtable" resultClass="lectex"> <select id="lect.lectexes.all" parameterClass="hashtable" resultClass="lectex">
select *
from (
select a.* select a.*
,row_number() over(order by <isNotNull property="orderby">$orderby$</isNotNull><isNull property="orderby">a.username</isNull>) rno
,count(a.lectno) OVER () pagetotalcount
from ( from (
select a.lectno,a.userno,a.cmno,a.isrebate select a.lectno,a.userno,a.cmno,a.isrebate
,p.payoktime,a.sdate,a.edate ,p.payoktime,a.sdate,a.edate
@ -1137,8 +1141,7 @@
,f.cmisno,f.estart lestart,f.eend leend,f.sseq ,f.cmisno,f.estart lestart,f.eend leend,f.sseq
,g.cname studyplacename ,g.cname studyplacename
,a.iscomplete ,a.iscomplete
,row_number() over(order by <isNotNull property="orderby">$orderby$</isNotNull><isNull property="orderby">d.username</isNull>) rno ,row_number() OVER (PARTITION BY a.lectno ORDER BY (c.estart IS NOT NULL) DESC) rn
,count(a.cdt) over() pagetotalcount
,cast(AES_DECRYPT(UNHEX(d.mobile), 'np123@!' ) as char) as mobile ,cast(AES_DECRYPT(UNHEX(d.mobile), 'np123@!' ) as char) as mobile
from lect a from lect a
inner join cmex b on b.isdel=0 and b.cmno = a.cmno inner join cmex b on b.isdel=0 and b.cmno = a.cmno
@ -1200,6 +1203,8 @@
<isEqual property="isbyadmin" compareValue="1" prepend="and">c.isbyadmin = 1</isEqual> <isEqual property="isbyadmin" compareValue="1" prepend="and">c.isbyadmin = 1</isEqual>
</isNotNull> </isNotNull>
) a ) a
WHERE a.rn = 1
) a
<include refid="sql.pagedynamic"></include> <include refid="sql.pagedynamic"></include>
order by a.rno order by a.rno
</select> </select>

Binary file not shown.

Binary file not shown.

View File

@ -68,13 +68,19 @@
@{ @{
string trainingDateText = d.intval6 != 16 ? string.Format("/ 집체교육 참석일 ({0}) 전 까지", d.time.ToShortDateString()) : ""; //string trainingDateText = d.intval6 != 16 ? string.Format("/ 집체교육 참석일 ({0}) 전 까지", d.time.ToShortDateString()) : "";
string trainingDateText = "";
if (d.intval6 != 16 && d.intval6 != 14) {
trainingDateText = string.Format("/ 집체교육 참석일 ({0}) 전 까지", d.time.ToShortDateString());
} else {
trainingDateText = "";
}
} }
@if (d.dtype == 1) @if (d.dtype == 1)
{ // 최종평가 { // 최종평가
if (d.intval6 == 16 || (d.time2 < Convert.ToDateTime("2024-08-19"))) if ((d.intval6 == 16 || d.intval6 == 14) || (d.time2 < Convert.ToDateTime("2024-08-19")))
{ {
<p>참여조건 : 진도율 @(d.intval2)% 이상 @trainingDateText</p> <p>참여조건 : 진도율 @(d.intval2)% 이상 @trainingDateText</p>
} }
@ -140,7 +146,7 @@
</td> </td>
} }
} else { } 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))) {
<td> <td>
<input type="hidden" name="cmEcondition" value="@d.intval2" /> <input type="hidden" name="cmEcondition" value="@d.intval2" />
@*<input type="hidden" name="lectSDate" value="@d.time2" /> @*<input type="hidden" name="lectSDate" value="@d.time2" />

Binary file not shown.

Binary file not shown.

View File

@ -3,3 +3,4 @@ D:\Project\git\git_YNICTE\Model\bin\Debug\NP.Model.pdb
D:\Project\git\git_YNICTE\Model\obj\Debug\Model.csproj.CoreCompileInputs.cache D:\Project\git\git_YNICTE\Model\obj\Debug\Model.csproj.CoreCompileInputs.cache
D:\Project\git\git_YNICTE\Model\obj\Debug\NP.Model.dll D:\Project\git\git_YNICTE\Model\obj\Debug\NP.Model.dll
D:\Project\git\git_YNICTE\Model\obj\Debug\NP.Model.pdb D:\Project\git\git_YNICTE\Model\obj\Debug\NP.Model.pdb
D:\Project\git\git_YNICTE\Model\obj\Debug\Model.csproj.AssemblyReference.cache

Binary file not shown.

Binary file not shown.