diff --git a/Dao/MyBatis/Maps/Lect.xml b/Dao/MyBatis/Maps/Lect.xml
index 532004b..431c94f 100644
--- a/Dao/MyBatis/Maps/Lect.xml
+++ b/Dao/MyBatis/Maps/Lect.xml
@@ -1135,12 +1135,14 @@
,case when a.edate is null then b.setime else a.edate end as time2
,d.estart time3,d.eend time4
,row_number() over(order by b.setime desc) rno
+ ,case when d.eend is not null then d.eend else a.edate end as sortedate
from lect a
- inner join cm b on b.cmno=a.cmno and b.sstime <
+ inner join cm b on b.cmno=a.cmno
inner join term c on c.tmno=b.tmno
left outer join cminningscd d on a.cmisno = d.cmisno
where a.userno=#userno# and a.status=1 and a.ischanged=0
- order by case when time2 > now() then 1 else 0 end desc , time2 desc
+ and (case when a.sdate is null then b.sstime else a.sdate end) <
+ order by case when time2 > now() then 1 else 0 end desc ,sortedate desc, time2 desc
) a
union all
select a.dtype,a.intval,a.intval2,a.intval3,a.intval4,a.intval5,a.intval6,a.intval7,a.intval8
@@ -1298,6 +1300,7 @@
,scd.estart,scd.eend
,cc.ccode studyplace
,cc.cname studyplacename
+ ,case when scd.eend is not null then scd.eend else a.edate end as sortedate
from lect a
inner join cm b on b.cmno=a.cmno
@@ -1322,6 +1325,7 @@
,null estart, null eend
,null studyplace
,null studyplacename
+ ,a.edate as sortedate
from pay e
inner join lect a on a.payno=e.payno and a.status=1 and a.ischanged=0
inner join cm b on b.cmno=a.cmno and b.sstime <
@@ -1343,6 +1347,7 @@
,null estart, null eend
,null studyplace
,null studyplacename
+ ,a.edate as sortedate
from lect a0
inner join pay e on e.payno=a0.payno and e.isgroup=1 and e.userno<>#userno# and e.pstatus=1
inner join lect a on a.payno=e.payno and a.status=1 and a.ischanged=0
@@ -1353,7 +1358,7 @@
left outer join assign ua on ua.asno=u.asno
where a0.userno=#userno# and a0.status=1 and a0.ischanged=0
and b.cshape=#cshape#
- order by case when setime < now() then 0 else 1 end desc,setime desc,payno
+ order by case when setime < now() then 0 else 1 end desc,sortedate desc, edate desc,payno