parent
6f0b2c3e49
commit
fc2c561756
|
|
@ -1108,12 +1108,12 @@
|
||||||
,case when b.pstatus = 1 then 99 else b.pstatus end as sortpstatus
|
,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
|
,row_number() over(order by sortpstatus, c.retime, b.payno,a.pino) rno
|
||||||
from payitem a
|
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 pay b on b.payno=a.payno and b.pstatus in (21,22,51,55) and b.rstatus < 2
|
||||||
inner join cm c on c.cmno=a.itemno and c.rstime < <include refid="sql.now"></include> and c.retime > <include refid="sql.now"></include>
|
inner join cm c on c.cmno=a.itemno and c.rstime < <include refid="sql.now"></include> and c.retime > <include refid="sql.now"></include>
|
||||||
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 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
|
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
|
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
|
where a.ptype in (0,1,4) and a.userno=#userno# and a.pstatus in (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
|
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, c.retime, b.payno,a.pino
|
order by sortpstatus, c.retime, b.payno,a.pino
|
||||||
) a
|
) a
|
||||||
|
|
|
||||||
|
|
@ -544,7 +544,7 @@
|
||||||
,case when lect.edate is null then c.setime else lect.edate end as edate
|
,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 b.pstatus = 1 then 99 else b.pstatus end as sortpstatus
|
||||||
from pay a
|
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 payitem b on b.payno=a.payno and b.ptype in (0,1,4) and b.pstatus in (21,22,51,55)
|
||||||
inner join cm c on c.cmno=b.itemno and c.rstime < now() and c.retime > now()
|
inner join cm c on c.cmno=b.itemno and c.rstime < now() and c.retime > now()
|
||||||
inner join term d on d.tmno=c.tmno
|
inner join term d on d.tmno=c.tmno
|
||||||
inner join users u on u.userno=b.userno
|
inner join users u on u.userno=b.userno
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue