신청중인 과정 정렬 변경

This commit is contained in:
lch 2021-06-30 01:06:15 +00:00
parent 9ca36b8cfa
commit 954cc2228f
2 changed files with 5 additions and 7 deletions

View File

@ -1105,9 +1105,8 @@
,l.lectno longval,a.payno longval2
,c.cname strval,null strval2,null strval3
,c.rstime time,c.retime time2
,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
,case when b.pstatus = 1 then 99 else b.pstatus end as sortpstatus
,row_number() over(order by sortpstatus, c.retime, 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 &lt; <include refid="sql.now"></include> and c.retime &gt; <include refid="sql.now"></include>
@ -1116,7 +1115,7 @@
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
order by sortpstatus, c.retime, b.payno,a.pino
) a
union all
select a.dtype,a.intval,a.intval2,a.intval3,a.intval4,a.intval5,a.intval6,a.intval7,a.intval8

View File

@ -542,8 +542,7 @@
,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
,case when b.pstatus = 1 then 99 else b.pstatus end as sortpstatus
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 &lt; now() and c.retime &gt; now()
@ -569,7 +568,7 @@
,u.email
,lect.cmisno
,cmis.estart,cmis.eend
order by sortpstatus, sortretime, a.payno,b.pino
order by sortpstatus, c.retime, a.payno,b.pino
</select>
<update id="pay.paycancel" parameterClass="hashtable">
update pay set <include refid="sql.up"></include>