This commit is contained in:
ksjihd163 2022-07-06 01:34:56 +00:00
parent 104df19143
commit eacd0755c7
1 changed files with 79 additions and 78 deletions

View File

@ -364,11 +364,10 @@
select c.lectno,c.completeno,c.completetime select c.lectno,c.completeno,c.completetime
from ( from (
select t1.* select t1.*
<!--,concat('제 ',t1.cyear,' - ',t1.code1,t1.code2,t1.code3,' - ',lpad(ifnull(t2.seqNo,0)+ t1.rno , 6, 0)) completeno--> ,concat('제 ',t1.cyear,t1.code1,lpad(ifnull(t2.seqNo,0) + t1.rno , 6, 0), ' 호') as completeno
,concat('제 ',t1.cyear,t1.code1,lpad(ifnull(t2.seqNo,0)+ t1.rno , 6, 0)+'호') completeno
from ( from (
select l.lectno select l.lectno
,date_format(l.cdt,'%Y') cyear ,date_format(l.edate,'%Y') cyear
,pcg.cgcode code2 ,pcg.cgcode code2
,case when cm.cshape = 1 then 'F' else 'N' end code1 ,case when cm.cshape = 1 then 'F' else 'N' end code1
,case when te.cremark = '1' then te.refcode ,case when te.cremark = '1' then te.refcode
@ -390,19 +389,19 @@
where l.lectno in ($lectnos$) where l.lectno in ($lectnos$)
) t1 ) t1
left outer join ( left outer join (
select date_format(l.cdt, '%Y') cyear,max(substring(l.completeno, -6)) seqNo select date_format(l.cdt, '%Y') cyear
,replace(max(substring(l.completeno, -6)), ' 호','') seqNo
from lect l from lect l
group by date_format(l.cdt, '%Y') group by date_format(l.cdt, '%Y')
) t2 on t2.cyear = t1.cyear ) t2 on t2.cyear = t1.cyear
) c ) c
) b ) b
inner join cm c on c.cmno = l.cmno
set l.uno = #uno# set l.uno = #uno#
,l.udt = now() ,l.udt = now()
,l.uip= #uip# ,l.uip= #uip#
,l.iscomplete=1 ,l.iscomplete=1
,l.completetime=b.completetime ,l.completetime=b.completetime
,l.completeno = case when l.completeno is not null then l.completeno else b.completeno end ,l.completeno=b.completeno
where l.lectno = b.lectno where l.lectno = b.lectno
</update> </update>
<update id="grade.lectcomplete2" parameterClass="hashtable"> <update id="grade.lectcomplete2" parameterClass="hashtable">
@ -415,10 +414,11 @@
from ( from (
select t1.* select t1.*
<!--,concat('제 ',t1.cyear,' - ',t1.code1,t1.code2,t1.code3,' - ',lpad(ifnull(t2.seqNo,0)+ t1.rno , 6, 0)) completeno--> <!--,concat('제 ',t1.cyear,' - ',t1.code1,t1.code2,t1.code3,' - ',lpad(ifnull(t2.seqNo,0)+ t1.rno , 6, 0)) completeno-->
,concat('제 ',t1.cyear,t1.code1,lpad(ifnull(t2.seqNo,0)+ t1.rno , 6, 0)) completeno <!--,concat('제 ',t1.cyear,t1.code1,lpad(ifnull(t2.seqNo,0)+ t1.rno , 6, 0)) completeno-->
,concat('제 ',t1.cyear,t1.code1,lpad(ifnull(t2.seqNo,0) + t1.rno , 6, 0), ' 호') as completeno
from ( from (
select l.lectno select l.lectno
,date_format(l.cdt,'%Y') cyear ,date_format(l.edate,'%Y') cyear
,pcg.cgcode code2 ,pcg.cgcode code2
,case when cm.cshape = 1 then 'F' else 'N' end code1 ,case when cm.cshape = 1 then 'F' else 'N' end code1
,case when te.cremark = '1' then te.refcode ,case when te.cremark = '1' then te.refcode
@ -442,7 +442,8 @@
<isNotNull property="lectno">and l.lectno =#lectno#</isNotNull> <isNotNull property="lectno">and l.lectno =#lectno#</isNotNull>
) t1 ) t1
left outer join ( left outer join (
select date_format(l.cdt, '%Y') cyear,max(substring(l.completeno, -6)) seqNo select date_format(l.cdt, '%Y') cyear
,replace(max(substring(l.completeno, -6)), ' 호','') seqNo
from lect l from lect l
group by date_format(l.cdt, '%Y') group by date_format(l.cdt, '%Y')
) t2 on t2.cyear = t1.cyear ) t2 on t2.cyear = t1.cyear