2020-10-12 14:39:23 +09:00
<?xml version="1.0" encoding="utf-8"?>
<sqlMap xmlns= "http://ibatis.apache.org/mapping" xmlns:xsi= "http://www.w3.org/tr/xmlschema-1/" namespace= "" >
<alias >
<!-- tfile, 첨부파일 -->
<typeAlias alias= "pay" type= "NP.Model.Pay, NP.Model" />
<typeAlias alias= "payitem" type= "NP.Model.PayItem, NP.Model" />
<typeAlias alias= "payitemresult" type= "NP.Model.PayItemResult, NP.Model" />
<typeAlias alias= "paydvr" type= "NP.Model.PayDVR, NP.Model" />
<typeAlias alias= "paycart" type= "NP.Model.PayCart, NP.Model" />
<typeAlias alias= "paytax" type= "NP.Model.PayTax, NP.Model" />
<typeAlias alias= "payrfd" type= "NP.Model.PayRfd, NP.Model" />
</alias>
<cacheModels >
<cacheModel id= "payCache" implementation= "LRU" >
<flushInterval hours= "1" />
<property name= "CacheSize" value= "1000" />
</cacheModel>
</cacheModels>
<!-- <parametermaps>
</parametermaps> -->
<resultMaps >
</resultMaps>
<statements >
<insert id= "pay.pay.in" parameterClass= "pay" >
2021-01-07 14:04:52 +09:00
insert into pay(ptype,ispg,isgroup,userno,username,isexam,pstatus,rstatus,refunding,paylimit,payoktime,pgkey
2021-06-04 18:01:04 +09:00
,orgamt,discamt,deliamt,isrefunddvr,payamt,refundamt,pplno,isbill,iscashrct,<include refid= "sql.inc" > </include> )
2021-01-07 14:04:52 +09:00
values (#ptype#,#ispg#,#isgroup#,#userno#,#username#,0,#pstatus#,#rstatus#,#refunding#,#paylimit#,case when #isinmoney# is not null then <include refid= "sql.now" > </include> else #payoktime# end,#pgkey#
2021-06-04 18:01:04 +09:00
,#orgamt#,#discamt#,#deliamt#,#isrefunddvr#,#payamt#,#refundamt#,#pplno#,#isbill#,#iscashrct#,<include refid= "sql.inv" > </include> );
2020-10-12 14:39:23 +09:00
<selectKey type= "post" property= "payno" resultClass= "long" > SELECT LAST_INSERT_ID()</selectKey>
</insert>
<insert id= "pay.payitem.in" parameterClass= "payitem" >
2020-11-24 17:34:18 +09:00
insert into payitem (payno,ptype,pcno,itemno,userno,pstatus,rstatus,pcnt,orgamt,discamt,payamt,payamtcash,payamtcard,refundamt,refundtime,refundtimereal,refundinfo,isrebate,rbank,rbankaccnum,tbankuser,<include refid= "sql.inc" > </include> )
values(#payno#,#ptype#,#pcno#,#itemno#,#userno#,#pstatus#,#rstatus#,#pcnt#,#orgamt#,#discamt#,#payamt#,#payamtcash#,#payamtcard#,#refundamt#,#refundtime#,#refundtimereal#,#refundinfo#,#isrebate#,#rbank#,#rbankaccnum#,#tbankuser#,<include refid= "sql.inv" > </include> );
2020-10-12 14:39:23 +09:00
<selectKey type= "post" property= "pino" resultClass= "long" > SELECT LAST_INSERT_ID()</selectKey>
</insert>
<insert id= "pay.lect.in" parameterClass= "payitem" >
2020-11-12 16:28:05 +09:00
insert into lect (cmno,payno,pino,userno,status,isready,iscomplete,orgcmno,attrate,isrebate,ispc,pcno,isjoin,fgno,ischanged,cmisno,<include refid= "sql.inc" > </include> )
2021-06-29 15:42:55 +09:00
values(#itemno#,#payno#,#pino#,#userno#,#status#,#isready#,null,null,0,#isrebate#,#ispc#,#pcno#,#isjoin#,null,0,#cmisno#,<include refid= "sql.inv" > </include> );
2020-10-12 14:39:23 +09:00
<selectKey type= "post" property= "lectno" resultClass= "long" > SELECT LAST_INSERT_ID()</selectKey>
</insert>
2021-06-07 11:06:55 +09:00
<update id= "pay.lect.sedate.save" parameterClass= "pay" >
update lect a
inner join cm b on a.cmno = b.cmno
inner join pay c on a.payno = c.payno
set
a.sdate = case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' and b.cshape < > 1 then date_format(c.payoktime,'%Y-%m-%d 00:00:00')
else b.sstime end,
a.edate = case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' and b.cshape < > 1 then date_format(date_add(c.payoktime,interval b.studydays day),'%Y-%m-%d 23:59:59')
else b.setime end
,a.udt=now(),a.uno=#uno#,a.uip=#uip#
where a.payno = #payno# and c.pstatus = 1
</update>
2020-10-12 14:39:23 +09:00
<select id= "pay.paydvrs" parameterClass= "hashtable" resultClass= "paydvr" >
select a.*
from (
select a.payno,a.payoktime
,au.username,au.userid
,bb.bkname,c.isdvr,c.dvrcode
,c.rcvname
,count(bb.bkno) dvrcount
,row_number() over(order by <isNotNull property= "orderby" > $orderby$</isNotNull> <isNull property= "orderby" > a.payoktime desc,a.payno,b.pino</isNull> ) rno
,count(a.cdt) over() pagetotalcount
from pay a
inner join payitem b on b.payno=a.payno and b.ptype=2 and b.pstatus=1 and b.rstatus=0
inner join book bb on bb.bkno=b.itemno
<isNotNull property= "bname" > and bb.bkname like concat('%',#bkname#,'%')</isNotNull>
inner join users au on au.userno=a.userno
<isNotNull property= "username" > and au.username=#username#</isNotNull>
<isNotNull property= "userid" > and au.userid=#userid#</isNotNull>
inner join paydvr c on c.payno=a.payno
<isNotNull property= "isdvr" > and c.isdvr=#isdvr#</isNotNull>
<isNotNull property= "isdvrcode0" > and c.dvrcode is null</isNotNull>
<isNotNull property= "isdvrcode1" > and c.dvrcode is not null</isNotNull>
<isNotNull property= "rcvname" > and c.rcvname =#rcvname#</isNotNull>
where a.pstatus=1 and a.rstatus < 2 and a.payoktime is not null
<isNotNull property= "payokstime" > and a.payoktime between #payokstime# and #payoketime#</isNotNull>
<isNotNull property= "all" >
and (bb.bkname like concat('%',#all#,'%') or au.username=#all# or au.userid=#all# or c.rcvname=#all#)
</isNotNull>
group by a.payno,a.payoktime
,au.username,au.userid
,bb.bkname,c.isdvr,c.dvrcode
,c.rcvname
) a
<include refid= "sql.pagedynamic" > </include>
order by a.rno
</select>
<update id= "pay.paydvr.dvrcode" parameterClass= "hashtable" >
update paydvr set <include refid= "sql.up" > </include>
,dvrcode=#dvrcode#,codetime=<include refid= "sql.now" > </include>
where payno=#payno#
</update>
<select id= "pay.paydvrfortalk" parameterClass= "string" resultClass= "paydvr" >
select a.dvrcode,a.userno
,b.username,CAST(AES_DECRYPT(UNHEX(b.mobile), <include refid= "sql.digest" > </include> ) AS char) mobile
from (
select a.dvrcode,c.userno
,count(d.bkno) dvrcount
,max(d.bkname) bkname
from paydvr a
inner join pay b on b.payno=a.payno
inner join payitem c on c.payno=b.payno and c.ptype=2
inner join book d on d.bkno=c.itemno
where a.payno in ($paynos$)
group by a.dvrcode,c.userno
) a
inner join users b on b.userno=a.userno
</select>
<select id= "pay.cart.check" parameterClass= "hashtable" resultClass= "paycart" >
select a.*
from (
select a.ptype,a.itemno,b.cname itemname
from paycart a
inner join cm b on b.cmno=a.itemno
where a.status=1 and a.ptype=0
<isNotNull property= "itemno" > and a.itemno=#itemno#</isNotNull>
<isNotNull property= "userno" > and a.userno=#userno#</isNotNull>
union all
select a.ptype,a.itemno,b.cname itemname
from paycart a
inner join cm b on b.cmno=a.itemno
where a.status=1 and a.ptype in (2,9)
<isNotNull property= "itemno" > and a.itemno=#itemno#</isNotNull>
<isNotNull property= "userno" > and a.userno=#userno#</isNotNull>
<isNotNull property= "bknos" > and a.itemno in (#bknos#)</isNotNull>
) a
order by a.ptype
</select>
<update id= "pay.cart.in" parameterClass= "paycart" >
<!-- update paycart set status=4 where #ptype#=0 and isgroup=0 and ptype=9 and cmno=#itemno# and status=1;
update paycart set status=4 where #ptype#=0 and isgroup=0 and ptype=0 and itemno=#itemno# and status=1;-->
insert into paycart(isgroup,ptype,itemno,isrefund,cmno,userno,pcnt,status,fgno,<include refid= "sql.inc" > </include> )
select 0,#ptype#,#itemno#,#isrefund#,#cmno#,#userno#,#pcnt#,#status#,#fgno#,<include refid= "sql.inv" > </include>
from (select 1 col1) a
left outer join paycart b on b.ptype=#ptype# and b.itemno=#itemno# and b.userno=#userno# and b.status=1
where b.pcno is null;
<isNotNull property= "bknos" >
insert into paycart(isgroup,ptype,itemno,isrefund,cmno,userno,pcnt,status,fgno,<include refid= "sql.inc" > </include> )
select #isgroup#,9,a.itemno,#isrefund#,#itemno#,#userno#,a.pcnt,#status#,null,<include refid= "sql.inv" > </include>
from (
<iterate property= "Ds" open = "" conjunction= "union all" close= "" >
select #Ds[].itemno# itemno,#Ds[].pcnt# pcnt
</iterate>
) a
</isNotNull>
</update>
<select id= "pay.payitems.forexampay" parameterClass= "hashtable" resultClass= "payitem" >
select 3 ptype,b.exno itemno,b.exname itemname,0 isrebate,1 pcnt
,b.outfee orgamt
,case when ua.isjoin=1 then b.outfee-b.infee else 0 end discamt
,case when ua.isjoin=1 then b.infee else b.outfee end payamt
,case when ua.isjoin=1 then b.infee else b.outfee end payamt2
,b.rstime,b.retime
from examuser a
inner join exam b on b.exno=a.exno and b.rstime < now() and b.retime > now()
inner join users u on u.userno=a.userno
left outer join assign ua on ua.asno=u.asno
where a.exno=#exno# and a.userno=#userno# and a.status=1 and a.pstatus=4
</select>
<select id= "pay.payitems.forcertpay" parameterClass= "hashtable" resultClass= "payitem" >
update payitem a
inner join pay b on b.payno=a.payno and b.userno=#userno# and b.pstatus=21
inner join users u on u.userno=b.userno
left outer join assign ua on ua.asno=u.asno
left outer join cm c on a.ptype=4 and c.cmno=a.itemno
left outer join book d on a.ptype=2 and d.bkno=a.itemno
set a.orgamt=case when a.ptype=4 then c.outfee else d.price * a.pcnt end
,a.discamt=case when a.ptype=4 and ua.isjoin=1 then c.outfee-c.infee else 0 end
,a.payamt=case when a.ptype=4 then case when ua.isjoin=1 then c.infee else c.outfee end else d.price * a.pcnt end
where a.payno=#payno# and a.ptype in (2,4) and a.pstatus in(21,50);
update pay a
inner join (
select a.payno,sum(b.orgamt) orgamt,sum(b.discamt) discamt,sum(b.payamt) payamt
from pay a
inner join payitem b on b.payno=a.payno
where a.payno=#payno# and a.userno=#userno# and a.pstatus=21
group by a.payno
) b on b.payno=a.payno
set a.orgamt=b.orgamt,a.discamt=b.discamt,a.payamt=b.payamt
where a.payno=#payno# and a.userno=#userno# and a.pstatus=21;
select b.ptype,b.itemno,case when b.ptype=4 then c.cname else d.bkname end itemname,b.isrebate,b.pcnt
,b.orgamt,b.discamt,b.payamt payamt2,case when b.ptype=4 then b.payamt else d.price end payamt,datediff(c.setime, c.sstime)+1 days
,c.rstime,c.retime
from pay a
inner join payitem b on b.payno=a.payno and b.ptype in(2,4) and b.pstatus in(21,50)
left outer join cm c on b.ptype=4 and c.cmno=b.itemno
left outer join book d on b.ptype=2 and d.bkno=b.itemno
inner join users u on u.userno=a.userno
left outer join assign ua on ua.asno=u.asno
where a.payno=#payno# and a.userno=#userno# and a.pstatus=21
</select>
<select id= "pay.payitems.forpay" parameterClass= "hashtable" resultClass= "payitem" >
select 0 ptype,0 itemno,'a' itemname,0 orgamt,0 discamt,0 payamt,0 days, null cshape
from (select 1 col1) a
<isNotEmpty property= "cmnos0" >
union all
select 0,a.cmno,a.cname,a.outfee,case when c.isjoin=1 then a.outfee-a.infee else 0 end
,case when c.isjoin=1 then a.infee else a.outfee end
,datediff(a.setime, a.sstime)+1,a.cshape
from cm a
inner join users b on b.userno=#userno#
left outer join assign c on c.asno=b.asno
where a.cmno in ($cmnos0$)
</isNotEmpty>
<isNotEmpty property= "bknos" >
union all
select 2,a.bkno,a.bkname,a.price,0,a.price,0,null cshape
from book a
where a.bkno in ($bknos$)
</isNotEmpty>
</select>
<select id= "pay.cmcheck.forgrouppay" parameterClass= "hashtable" resultClass= "lect" >
select a.cmno,a.cname,a.quota,a.rstime,a.retime
,b.userno,b.status,c.username
,case when #usernos# like concat('%,',b.userno,',%') then 1 else 0 end ispaied
,a.infee,a.outfee,case when ua.isjoin=1 then a.infee else a.outfee end payamt
from cm a
inner join users u on u.userno=#userno#
left outer join assign ua on ua.asno=u.asno
left outer join lect b on b.cmno=a.cmno and b.status < 5 and b.ischanged=0
left outer join users c on c.userno=b.userno and c.status=1
where a.cmno=#cmno# and a.ismaster=0 and a.rstime < now() and a.retime > now() and a.isuse=1 and a.isdel=0
</select>
<select id= "pay.cmcheck.forpay" parameterClass= "hashtable" resultClass= "lect" >
select a.cmno,a.cname,a.quota,a.rstime,a.retime
,b.status
2021-01-07 14:04:52 +09:00
,a.infee,a.outfee,case when ua.isjoin=1 then a.infee else a.infee end payamt ,a.accommofee
2020-10-12 14:39:23 +09:00
,count(d.userno) countlect
from cm a
inner join users u on u.userno=#userno#
left outer join assign ua on ua.asno=u.asno
left outer join lect b on b.cmno=a.cmno and b.userno =#userno# and b.status < 5 and b.ischanged=0
2020-11-16 17:42:59 +09:00
left outer join lect c on c.cmno=a.cmno and c.status in (1,2,3,4,6) and c.ischanged=0
2020-10-12 14:39:23 +09:00
left outer join users d on d.userno=c.userno and d.status=1
where
<isNotNull property= "cmnos" > a.cmno in($cmnos$)</isNotNull>
<isNotNull property= "cmno" > a.cmno=#cmno#</isNotNull>
and a.ismaster=0 and a.rstime < now() and a.retime > now() and a.isuse=1 and a.isdel=0
group by a.cmno,a.cname,a.quota,a.rstime,a.retime,a.infee,a.outfee,ua.asno
,b.status
</select>
<insert id= "pay.pay.pgin" parameterClass= "pay" >
insert into pay(ptype,ispg,isgroup,isexam,userno,username,pstatus,rstatus
2020-12-24 14:37:26 +09:00
,refunding,paylimit,payoktime,pgkey,orgamt,discamt,deliamt,isrefunddvr,payamt,refundamt,isdvr,iscashrct,cashrcthp,pplno,isbill,<include refid= "sql.inc" > </include> )
2020-10-12 14:39:23 +09:00
select #ptype#,#ispg#,#isgroup#,#isexam#,a.userno,a.username,case when #ptype# = 6 then 1 else 0 end,0
2020-12-24 14:37:26 +09:00
,#refunding#,#paylimit#,case when #ptype# = 6 then now() else #payoktime# end,#pgkey#,#orgamt#,#discamt#,#deliamt#,#isrefunddvr#,#payamt#,#refundamt#,#isdvr#,#iscashrct#,HEX(AES_ENCRYPT(#cashrcthp#, <include refid= "sql.digest" > </include> )),#pplno#,#isbill#,<include refid= "sql.inv" > </include>
2020-10-12 14:39:23 +09:00
from users a
where a.userno=#userno#
<selectKey type= "post" property= "payno" resultClass= "long" > SELECT LAST_INSERT_ID()</selectKey>
</insert>
<update id= "pay.payitem.pgin" parameterClass= "pay" >
insert into payitem (payno,ptype,pcno,itemno,userno,pstatus,rstatus
2020-11-16 17:42:59 +09:00
,pcnt,orgamt,discamt,payamt,payamtcash,payamtcard,refundamt,refundtime,refundtimereal,refundinfo,isrebate,rbank,rbankaccnum,tbankuser,fgno,<include refid= "sql.inc" > </include> )
2020-10-12 14:39:23 +09:00
select #payno#,a.ptype,null,a.itemno,a.userno,case when #ptype# = 6 then 1 else 0 end,0
2020-11-16 17:42:59 +09:00
,a.pcnt,a.orgamt,a.discamt,a.payamt,0,0,0,null,null,null,a.isrebate,a.rbank,HEX(AES_ENCRYPT(a.rbankaccnum, <include refid= "sql.digest" > </include> )),a.tbankuser,ifnull(b.fgno,a.fgno),<include refid= "sql.inv" > </include>
2020-10-12 14:39:23 +09:00
from (
2020-11-16 17:42:59 +09:00
<iterate property= "PIs" open= "" conjunction= "union all" close= "" > select #PIs[].ptype# ptype,#PIs[].itemno# itemno,#PIs[].userno# userno,#PIs[].pcnt# pcnt,#PIs[].orgamt# orgamt,#PIs[].discamt# discamt,#PIs[].payamt# payamt,#PIs[].isrebate# isrebate,#PIs[].rbank# rbank,#PIs[].rbankaccnum# rbankaccnum,#PIs[].tbankuser# tbankuser,#PIs[].fgno# fgno </iterate>
2020-10-12 14:39:23 +09:00
) a
left outer join paycart b on #isexam# = 2 and a.ptype=0 and b.ptype=0 and b.itemno=a.itemno and b.userno=#userno# and b.status=1 and b.ispay=1
</update>
<update id= "pay.paydvr.in" parameterClass= "hashtable" >
delete from paydvr where payno=#payno#;
insert into paydvr (payno,dvrcode,codetime,isdvr,rcvname,telno,mobile,email,post,address1,address2,dmemo,<include refid= "sql.inc" > </include> )
values (#payno#,#dvrcode#,#codetime#,#isdvr#,#rcvname#
,HEX(AES_ENCRYPT(#telno#, <include refid= "sql.digest" > </include> ))
,HEX(AES_ENCRYPT(#mobile#, <include refid= "sql.digest" > </include> ))
,HEX(AES_ENCRYPT(#email#, <include refid= "sql.digest" > </include> ))
,#post#,#address1#,#address2#,#dmemo#,<include refid= "sql.inv" > </include> )
</update>
<update id= "pay.freeok" parameterClass= "long" >
2021-03-05 16:02:14 +09:00
insert into lect (cmno,payno,pino,userno,status,attrate,isrebate,ispc,isjoin,ischanged,fgno2,cmisno,<include refid= "sql.inc" > </include> )
select b.itemno,a.payno,b.pino,case when a.isgroup=1 then b.userno else a.userno end,1,0,b.isrebate,0,case when ua.isjoin=1 then 1 else 0 end,0,b.fgno,l.cmisno,<include refid= "sql.inv" > </include>
2020-10-12 14:39:23 +09:00
from pay a
inner join payitem b on b.payno=a.payno and b.ptype=0
inner join users u on u.userno=a.userno
2021-03-05 16:02:14 +09:00
inner join pplog l on a.pplno = l.pplno
2020-10-12 14:39:23 +09:00
left outer join assign ua on ua.asno=u.asno
where a.payno=#payno#;
2021-03-05 17:46:02 +09:00
<!-- 수강시작일 / 종료일 추가 2021 - 01 - 21 -->
update lect a
inner join cm b on a.cmno = b.cmno
inner join pay c on a.payno = c.payno
set
a.sdate = case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' and b.cshape < > 1 then date_format(c.payoktime,'%Y-%m-%d 00:00:00')
else b.sstime end,
a.edate = case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' and b.cshape < > 1 then date_format(date_add(c.payoktime,interval b.studydays day),'%Y-%m-%d 23:59:59')
else b.setime end
where a.payno = #payno# and c.pstatus = 1
2020-10-12 14:39:23 +09:00
</update>
<update id= "pay.paydvr.save" parameterClass= "hashtable" >
update paydvr set <include refid= "sql.up" > </include>
,dvrcode=#dvrcode#,rcvname=#rcvname#,post=#post#,address1=#address1#,address2=#address2#,dmemo=#dmemo#
,codetime=case when codetime is null and #dvrcode# is not null then now() else codetime end
,telno=HEX(AES_ENCRYPT(#telno#, <include refid= "sql.digest" > </include> ))
,mobile=HEX(AES_ENCRYPT(#mobile#, <include refid= "sql.digest" > </include> ))
where payno=#payno#
</update>
<update id= "pay.paycert.paystart" parameterClass= "pay" >
update pay a
inner join users b on b.userno=a.userno
2021-01-07 14:04:52 +09:00
set a.ptype=#ptype#,a.paylimit=#paylimit#,a.orgamt=#orgamt#,a.payamt=#payamt#,a.isbill=#isbill#
2020-11-26 13:49:56 +09:00
where a.payno=#payno# and a.userno=#userno# and a.pstatus=21;
update payitem a
inner join users b on b.userno=a.userno
set a.orgamt=#orgamt#,a.payamt=#payamt#
2020-10-12 14:39:23 +09:00
where a.payno=#payno# and a.userno=#userno# and a.pstatus=21;
</update>
<select id= "pay.pay" parameterClass= "hashtable" resultClass= "pay" >
2020-11-24 17:34:18 +09:00
select a.payno,a.ptype,a.isgroup,a.isexam,a.userno,a.pstatus,a.payamt,a.rstatus,a.refundamt,a.ispg,a.paylimit
2021-01-07 14:04:52 +09:00
,b.isready,b.isaccommodation
2020-10-12 14:39:23 +09:00
from pay a
2020-11-24 17:34:18 +09:00
left outer join pplog b on b.pplno=a.pplno
2020-10-12 14:39:23 +09:00
<dynamic prepend= "where" >
<isNotNull property= "payno" prepend= "and" > a.payno=#payno#</isNotNull>
<isNotNull property= "userno" prepend= "and" > a.userno=#userno#</isNotNull>
<isNotNull property= "pstatus21" prepend= "and" > (a.pstatus=#pstatus21# or a.pstatus=21)</isNotNull>
<isNotNull property= "pstatus" prepend= "and" > a.pstatus=#pstatus#</isNotNull>
<isNotNull property= "rstatusnot" prepend= "and" > a.rstatus< > #rstatusnot#</isNotNull>
</dynamic>
</select>
<update id= "pay.paylect" parameterClass= "hashtable" >
update pay set <include refid= "sql.up" > </include>
,pstatus=case when ptype=3 then 22 else 1 end
,payoktime=case when ptype=3 then null else <include refid= "sql.now" > </include> end
,pgkey=#pgkey#
where payno=#payno#;
insert into paydata(payno,payresult,payresultmsg,vactnum,vactbankcode,vactbankname,vactname,vactinname,cshrrcode,cshrtype,cshrauthno,cardquota,cardquotatype,cardeventcode,cardnum,iscardpoint,cardcode,cardbankcode,cardprtccode,checkflag,ocbnum,ocbappno,ocbprice,gsnum,gsremain,gsprice,unum,upoint,uprice,<include refid= "sql.inc" > </include> )
values (#payno#,#payresult#,#payresultmsg#,HEX(AES_ENCRYPT(#vactnum#, <include refid= "sql.digest" > </include> )),#vactbankcode#,#vactbankname#,#vactname#,#vactinname#,#cshrrcode#,#cshrtype#,#cshrauthno#,#cardquota#,#cardquotatype#,#cardeventcode#,HEX(AES_ENCRYPT(#cardnum#, <include refid= "sql.digest" > </include> )),#iscardpoint#,#cardcode#,#cardbankcode#,#cardprtccode#,#checkflag#,#ocbnum#,#ocbappno#,#ocbprice#,#gsnum#,#gsremain#,#gsprice#,#unum#,#upoint#,#uprice#,<include refid= "sql.inv" > </include> );
update payitem a
inner join pay b on b.payno=a.payno
set a.udt=now(),a.uno=#uno#,a.uip=#uip#
,a.pstatus=case when b.ptype=3 then 22 else 1 end
where a.payno=#payno#;
insert into lect (cmno,payno,pino,userno
,status,iscomplete,orgcmno,attrate,isrebate
,ispc,isjoin,fgno,apoint,mpoint
,fpoint,spoint,dpoint,tpoint,ischanged
,stime,etime,sip,eip,ispcs
2020-11-24 17:34:18 +09:00
,ispce,fgno2,cmisno,<include refid= "sql.inc" > </include> )
2020-10-12 14:39:23 +09:00
select a.itemno,a.payno,a.pino,case when b.isgroup=1 then a.userno else b.userno end
,case when b.ptype=3 then 2 else 1 end,null,null,0,a.isrebate
,0,ifnull(d.isjoin, 0),null,null,null
,null,null,null,null,0
,null,null,null,null,null
2020-11-24 17:34:18 +09:00
,null,a.fgno,e.cmisno,<include refid= "sql.inv" > </include>
2021-01-22 10:59:21 +09:00
from payitem a
inner join pay b on b.payno=a.payno
inner join users c on c.userno=b.userno
left outer join assign d on d.asno=c.asno
left outer join pplog e on e.pplno=b.pplno
left outer join lect f on f.payno=a.payno and f.pino=a.pino and f.status=4 and f.isready=1
where a.payno=#payno# and a.ptype=0 and f.lectno is null;
2020-10-12 14:39:23 +09:00
2021-01-22 10:59:21 +09:00
update lect a
inner join pay b on b.payno=a.payno and b.pstatus in (22,1)
inner join payitem c on c.payno=b.payno and c.itemno=a.cmno and c.pstatus=b.pstatus
set a.status=case when b.pstatus=22 then 2 else 1 end,a.uno=#uno#,a.uip=#uip#
where a.payno=#payno# and a.status=4;
2020-10-12 14:39:23 +09:00
2021-01-22 10:59:21 +09:00
<!-- 수강시작일 / 종료일 추가 2021 - 01 - 21 -->
update lect a
inner join cm b on a.cmno = b.cmno
inner join pay c on a.payno = c.payno
set
a.sdate = case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' and b.cshape < > 1 then date_format(c.payoktime,'%Y-%m-%d 00:00:00')
else b.sstime end,
a.edate = case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' and b.cshape < > 1 then date_format(date_add(c.payoktime,interval b.studydays day),'%Y-%m-%d 23:59:59')
else b.setime end
where a.payno = #payno# and c.pstatus = 1
<!-- update examuser a
2020-10-12 14:39:23 +09:00
inner join pay b on b.isexam=1 and b.payno=#payno# and b.pstatus in (22,1)
inner join payitem c on c.payno=b.payno and c.ptype=3 and c.itemno=a.exno and c.pstatus=b.pstatus
set a.payno=b.payno,a.pstatus=case when b.pstatus=22 then 2 else 1 end,a.uno=#uno#,a.uip=#uip#
where a.userno=#userno# and a.status=1 and a.pstatus=4;
update paycart a
inner join pay b on b.isexam=2 and b.payno=#payno# and b.pstatus in (22,1)
inner join payitem c on c.payno=b.payno and c.ptype=case when a.ptype=9 then 2 else a.ptype end and c.itemno=a.itemno and c.pstatus=b.pstatus
set a.status=3,c.cartno=a.pcno,a.uno=#uno#,a.uip=#uip#
2020-11-24 17:34:18 +09:00
where a.userno=#userno# and a.status=1 and a.ispay=1;-->
2020-10-12 14:39:23 +09:00
</update>
<update id= "pay.pay.fail" parameterClass= "hashtable" >
2021-07-09 13:35:05 +09:00
update pay set pstatus=#pstatus# where payno=#payno# and pstatus != 1 and pstatus != 22;
2020-10-12 14:39:23 +09:00
insert into paydata(payno,payresult,payresultmsg,vactnum,vactbankcode,vactbankname,vactname,vactinname,cshrrcode,cshrtype,cshrauthno,cardquota,cardquotatype,cardeventcode,cardnum,iscardpoint,cardcode,cardbankcode,cardprtccode,checkflag,ocbnum,ocbappno,ocbprice,gsnum,gsremain,gsprice,unum,upoint,uprice,<include refid= "sql.inc" > </include> )
values (#payno#,#payresult#,#payresultmsg#,HEX(AES_ENCRYPT(#vactnum#, <include refid= "sql.digest" > </include> )),#vactbankcode#,#vactbankname#,#vactname#,#vactinname#,#cshrrcode#,#cshrtype#,#cshrauthno#,#cardquota#,#cardquotatype#,#cardeventcode#,#cardnum#,#iscardpoint#,HEX(AES_ENCRYPT(#cardnum#, <include refid= "sql.digest" > </include> )),#cardbankcode#,#cardprtccode#,#checkflag#,#ocbnum#,#ocbappno#,#ocbprice#,#gsnum#,#gsremain#,#gsprice#,#unum#,#upoint#,#uprice#,<include refid= "sql.inv" > </include> );
</update>
<update id= "pay.paylect.vbankin" parameterClass= "hashtable" >
insert into payvbankin (payno,pgkey,inbankcode,indeal,inymd,inhms,msgseq,transseq,vacct,inamt,checkamt,isclose,typemsg,frombank,fromname,fromymd,calcymd,tranymd,transcode,korcode,cshrymd,cshrhms,cshrcode,cshrpgkey,cshramt,<include refid= "sql.inc" > </include> )
values (#payno#,#pgkey#,#inbankcode#,#indeal#,#inymd#,#inhms#,#msgseq#,#transseq#,#vacct#,#inamt#,#checkamt#,#isclose#,#typemsg#,#frombank#,#fromname#,#fromymd#,#calcymd#,#tranymd#,#transcode#,#korcode#,#cshrymd#,#cshrhms#,#cshrcode#,#cshrpgkey#,#cshramt#,<include refid= "sql.inv" > </include> );
<!-- 여기 입금 처리 -->
update pay set <include refid= "sql.up" > </include>
,pstatus=1
,payoktime=<include refid= "sql.now" > </include>
<!-- ,pgkey=#pgkey# -->
where payno=#payno# and pstatus=22 <!-- and pgkey=#pgkey# --> ;
update payitem a
inner join pay b on b.payno=a.payno <!-- and b.pgkey=#pgkey# -->
set a.udt=now(),a.uno=#uno#,a.uip=#uip#
,a.pstatus=1
where a.payno=#payno# and a.pstatus=22;
update lect a
inner join pay b on b.isexam < > 1 and b.payno=a.payno and b.pstatus=1 <!-- and b.pgkey=#pgkey# -->
set a.udt=now(),a.uno=#uno#,a.uip=#uip#
,a.status=1
where a.payno=#payno#;
2021-05-11 10:34:48 +09:00
update lect a
inner join cm b on a.cmno = b.cmno
inner join pay c on a.payno = c.payno
set
a.sdate = case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' and b.cshape < > 1 then date_format(c.payoktime,'%Y-%m-%d 00:00:00')
else b.sstime end,
a.edate = case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' and b.cshape < > 1 then date_format(date_add(c.payoktime,interval b.studydays day),'%Y-%m-%d 23:59:59')
else b.setime end
where a.payno = #payno# and c.pstatus = 1;
2020-11-24 17:34:18 +09:00
<!-- update examuser a
inner join pay b on b.isexam=1 and b.payno=a.payno and b.pstatus=1 --><!-- and b.pgkey=#pgkey# --> <!--
2020-10-12 14:39:23 +09:00
set a.udt=now(),a.uno=#uno#,a.uip=#uip#
,a.pstatus=1
2020-11-24 17:34:18 +09:00
where a.payno=#payno#;-->
2020-10-12 14:39:23 +09:00
</update>
<select id= "pay.payitems" parameterClass= "long" resultClass= "payitemresult" >
select a0.payno,a0.isgroup,a0.isexam,a0.isdvr,a0.payamt tpayamt,a0.paylimit,a0.ptype,a0.udt,a0.deliamt,a0.pgkey
,ad.rcvname
,CAST(AES_DECRYPT(UNHEX(ad.mobile), <include refid= "sql.digest" > </include> ) AS char) mobile
,CAST(AES_DECRYPT(UNHEX(ad.telno), <include refid= "sql.digest" > </include> ) AS char) telno
,CAST(AES_DECRYPT(UNHEX(ad.email), <include refid= "sql.digest" > </include> ) AS char) email
,ad.post,ad.address1,ad.address2
2020-11-24 17:34:18 +09:00
,a.ptype ptype2,a.payamt,a.pcnt,a.isrebate,a.itemno
2020-10-12 14:39:23 +09:00
,b.cmno,b.cshape,b.sstime,b.setime
,b1.rsno
,b2.username,cc.cname ccpositionname,b2.isassignuser
,CAST(AES_DECRYPT(UNHEX(b2.email), <include refid= "sql.digest" > </include> ) AS char) email2
,CAST(AES_DECRYPT(UNHEX(b2.telno), <include refid= "sql.digest" > </include> ) AS char) telno2
,b2.depart,b2.kfcfyear,b2.edus
,c.bkno
,case a.ptype when 0 then b.cname when 4 then b.cname when 2 then c.bkname when 3 then e.exname else '-' end itemname
,cg2.cgcode
,CAST(AES_DECRYPT(UNHEX(pd.vactnum), <include refid= "sql.digest" > </include> ) AS char) vactnum,pd.vactbankname,pd.vactname
,t.lectno,t.status
,ad.isdvr isdvr2
from pay a0
left outer join paydvr ad on ad.payno=a0.payno
left outer join paydata pd on pd.payno=a0.payno
inner join payitem a on a.payno=a0.payno
left outer join cm b on a.ptype in(0,4) and b.cmno=a.itemno
left outer join lect t on t.cmno=b.cmno and t.userno=a.userno and t.status=1
left outer join cg cg1 on cg1.cgno=b.cgno
left outer join cg cg2 on cg2.cgno=cg1.pcgno
left outer join cmrs b1 on b1.cmno=b.cmno and b1.rstype=1 and b1.isdel=0
left outer join users b2 on b2.userno=a.userno
left outer join comcode cc on cc.ccode=b2.ccposition
left outer join book c on a.ptype=2 and c.bkno=a.itemno
left outer join examuser d on a.ptype=3 and d.exno=a.itemno and d.userno=a0.userno and d.payno=a0.payno
left outer join exam e on e.exno=d.exno
where a0.payno=#payno#
</select>
<insert id= "pay.certpay" parameterClass= "hashtable" >
insert into pay(ptype,ispg,isgroup,userno,pstatus,rstatus,refunding,orgamt,discamt,deliamt,isrefunddvr,payamt,refundamt,isdvr,isexam,<include refid= "sql.inc" > </include> )
values (0,1,0,#userno#,51,0,0,0,0,0,0,0,0,0,0,<include refid= "sql.inv" > </include> )
<selectKey type= "post" property= "payno" resultClass= "long" > SELECT LAST_INSERT_ID()</selectKey>
</insert>
<update id= "pay.certpayitem" parameterClass= "hashtable" >
insert into payitem (payno,ptype,itemno,userno,pstatus,rstatus,pcnt
,orgamt,discamt,payamt,payamtcash,payamtcard,refundamt,isrebate,fgno,<include refid= "sql.inc" > </include> )
values (#payno#,4,#cmno#,#userno#,51,0,1
,0,0,0,0,0,0,#isrebate#,#fgno#,<include refid= "sql.inv" > </include> );
insert into lect(cmno,payno,pino,userno,status,attrate,isrebate,ispc,isjoin,fgno,ischanged,fgno2,<include refid= "sql.inc" > </include> )
select #cmno#,#payno#,LAST_INSERT_ID(),a.userno,3,0,#isrebate#,0,b.isjoin,#fgno2#,0,#fgno#,<include refid= "sql.inv" > </include>
from users a
left outer join assign b on b.asno=a.asno
where a.userno=#userno#;
<isNotNull property= "inquery" >
<!-- insert into paycertbook (payno,bkno,bcount,<include refid="sql.inc"></include>)
<iterate property= "PIs" open = "" conjunction= "union all" close= "" >
select #payno#,#PIs[].itemno#,#PIs[].pcnt#,now(),#uno#,now(),#uno#,#uip#
</iterate> -->
insert into payitem (payno,ptype,itemno,userno,pstatus,rstatus,pcnt,orgamt,discamt,payamt,payamtcash,payamtcard,refundamt,isrebate,fgno,<include refid= "sql.inc" > </include> )
<iterate property= "PIs" open = "" conjunction= "union all" close= "" >
select #payno#,2,#PIs[].itemno#,#userno#,50,0,#PIs[].pcnt#,0,0,0,0,0,0,0,null,now(),#uno#,now(),#uno#,#uip#
</iterate>
</isNotNull>
</update>
<select id= "pay.paylect.get" parameterClass= "long" resultClass= "lect" >
select a.fgno
,b.cshape,b.cname,b.rstime,b.retime,b.sstime,b.setime
,b2.cname certgradeccname
,c.username
,CAST(AES_DECRYPT(UNHEX(c.email), <include refid= "sql.digest" > </include> ) AS char) email
,CAST(AES_DECRYPT(UNHEX(c.mobile), <include refid= "sql.digest" > </include> ) AS char) mobile
,CAST(AES_DECRYPT(UNHEX(c.telno), <include refid= "sql.digest" > </include> ) AS char) telno
,c.depart
,c2.cname ccpositionname
,d.asname
from lect a
inner join cm b on b.cmno=a.cmno
left outer join comcode b2 on b2.ccode=b.certgradecc
inner join users c on c.userno=a.userno
left outer join comcode c2 on c2.ccode=c.ccposition
left outer join assign d on d.asno=c.asno
where a.payno=#payno#
</select>
<select id= "pay.mypayitems" parameterClass= "hashtable" resultClass= "payitem" >
select a.payno,a.isgroup,a.pstatus ppstatus,a.rstatus prstatus
,b.pino,b.ptype,b.pcno,b.itemno,b.userno,b.pstatus,b.rstatus,b.isrebate
2021-08-23 15:10:15 +09:00
,c.cname,c.classno,c.rstime,c.retime,c.sstime,c.setime,c.cshape,c.isrefund,c.studydays
2020-11-24 17:34:18 +09:00
,cc.cname studyplacename
2020-10-12 14:39:23 +09:00
,d.tyear,d.tseq
,u.username
,ua.asname
,uc.cname ccpositionname
,CAST(AES_DECRYPT(UNHEX(u.email), <include refid= "sql.digest" > </include> ) AS char) email
,case when max(e.rfdno) > 0 then 1 else 0 end rfdstatus
2020-11-24 17:34:18 +09:00
,lect.cmisno
2021-08-23 15:10:15 +09:00
,a.cdt,cmis.estart cmiestart,cmis.eend cmieend
2021-01-26 17:26:54 +09:00
,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
2021-06-30 10:06:15 +09:00
,case when b.pstatus = 1 then 99 else b.pstatus end as sortpstatus
2020-10-12 14:39:23 +09:00
from pay a
2021-07-07 10:27:37 +09:00
inner join payitem b on b.payno=a.payno and b.ptype in (0,1,4) and b.pstatus in (21,22,51,55)
2020-12-14 09:27:37 +09:00
inner join cm c on c.cmno=b.itemno and c.rstime < now() and c.retime > now()
2020-10-12 14:39:23 +09:00
inner join term d on d.tmno=c.tmno
inner join users u on u.userno=b.userno
left outer join assign ua on ua.asno=u.asno
left outer join comcode uc on uc.ccode=u.ccposition
left outer join payrfditem e0 on e0.pino=b.pino
left outer join payrfd e on e.rfdno=e0.rfdno and e.payno=a.payno and e.rstatus=0
2020-11-24 17:34:18 +09:00
left outer join comcode cc on cc.ccode=c.studyplace
left outer join lect lect on lect.pino=b.pino and lect.ischanged=0
left outer join cminningscd cmis on cmis.cmisno=lect.cmisno
2020-11-27 09:22:23 +09:00
where a.userno=#userno# and a.pstatus in (1,21,22,51,55) and lect.status < 8
2021-06-29 13:05:54 +09:00
and 1 = case when c.retime = '2099-12-31 23:59:59' and lect.stime is not null then 0 else 1 end
2020-10-12 14:39:23 +09:00
group by a.payno,a.isgroup,a.pstatus,a.rstatus
,b.pino,b.ptype,b.pcno,b.itemno,b.userno,b.pstatus,b.rstatus,b.isrebate
,c.cname,c.classno,c.rstime,c.retime,c.sstime,c.setime,c.cshape
2020-11-24 17:34:18 +09:00
,cc.cname
2020-10-12 14:39:23 +09:00
,d.tyear,d.tseq
,u.username
,ua.asname
,uc.cname
,u.email
2020-11-24 17:34:18 +09:00
,lect.cmisno
,cmis.estart,cmis.eend
2021-06-30 10:06:15 +09:00
order by sortpstatus, c.retime, a.payno,b.pino
2020-10-12 14:39:23 +09:00
</select>
<update id= "pay.paycancel" parameterClass= "hashtable" >
update pay set <include refid= "sql.up" > </include>
,pstatus=case when pstatus=22 then 43 else 41 end
2020-11-24 17:34:18 +09:00
where payno=#payno# and userno=#userno# and pstatus in (51,55,21,22);
2020-10-12 14:39:23 +09:00
update payitem a
inner join pay b on b.payno=a.payno and b.userno=#userno# and b.pstatus in (41,43)
set a.pstatus=b.pstatus,a.uno=#uno#,a.uip=#uip#
where a.payno=#payno# and a.pstatus in (21,22);
update lect a
inner join pay b on b.payno=a.payno and b.userno=#userno# and b.pstatus in (41,43)
set a.status=9
where a.payno=#payno#;
update examuser a
inner join pay b on b.payno=a.payno and b.userno=a.userno and b.pstatus in (41,43)
set a.pstatus=9
where a.payno=#payno# and a.userno=#userno#
</update>
<update id= "pay.cart.clear" parameterClass= "hashtable" >
update paycart set status=2,udt=now(),uno=#uno#,uip=#uip# where userno=#userno# and status=1 and date_add(cdt, interval 7 day) < now();
update paycart a
inner join cm b on b.cmno=a.itemno and b.udt > a.cdt
set a.status=2,a.udt=now(),a.uno=#uno#,a.uip=#uip#
where a.userno=#userno# and a.status=1 and a.ptype=0;
update paycart a
inner join book b on b.bkno=a.itemno and b.udt > a.cdt
set a.status=2,a.udt=now(),a.uno=#uno#,a.uip=#uip#
where a.userno=#userno# and a.status=1 and a.ptype in (2,9);
update paycart a
left outer join cm b on b.cmno=a.itemno and b.rstime < now() and b.retime > now()
set a.status=2,a.udt=now(),a.uno=#uno#,a.uip=#uip#
where a.userno=#userno# and a.status=1 and a.ptype=0 and b.cmno is null;
update paycart a
left outer join paycart b on b.ptype =0 and b.userno=#userno# and b.status=1 and b.itemno=a.cmno
set a.status=2,a.udt=now(),a.uno=#uno#,a.uip=#uip#
where a.userno=#userno# and a.status=1 and a.ptype=9 and b.pcno is null
</update>
<select id= "pay.carts" parameterClass= "int" resultClass= "paycart" >
select a.pcno,a.ptype,a.itemno,a.isrefund,a.cmno,a.userno,a.pcnt,a.fgno
,case when a.ptype=0 then b.cname else c.bkname end itemname,b.cshape,b.sstime,b.setime
,case when a.ptype = 0 then case when ua.isjoin=1 then b.infee else b.outfee end else c.price end payamt
,case when a.ptype = 0 then b.outfee else c.price end orgamt
from paycart a
inner join users u on u.userno=a.userno
left outer join assign ua on ua.asno=u.asno
left outer join cm b on a.ptype=0 and b.cmno=a.itemno
left outer join book c on a.ptype in (2,9) and c.bkno=a.itemno
where a.status=1 and a.userno=#userno#
order by a.cdt desc
</select>
<update id= "pay.paycart.del" parameterClass= "hashtable" >
update paycart a
set a.status=0,<include refid= "sql.up" > </include>
where a.userno=#userno# and a.status < > 0
<isNotNull property= "pcno" > and a.pcno=#pcno#</isNotNull>
<isNotNull property= "pcnos" > and a.pcno in ($pcnos$)</isNotNull>
</update>
<update id= "pay.paycart.flag" parameterClass= "hashtable" >
update paycart set ispay=0 where userno=#userno#;
update paycart a
set a.ispay=1
where a.userno=#userno# and a.status=1
<isNotNull property= "pcno" > and a.pcno=#pcno#</isNotNull>
<isNotNull property= "pcnos" > and a.pcno in ($pcnos$)</isNotNull>
</update>
<select id= "pay.payitems.forcartpay" parameterClass= "hashtable" resultClass= "payitem" >
select case when a.ptype = 9 then 2 else a.ptype end ptype,a.itemno,case when a.ptype=0 then b.cname else c.bkname end itemname,case when a.ptype=0 then a.isrefund else 0 end isrebate,a. pcnt
,case when a.ptype=0 then b.outfee else c.price end orgamt
,case when a.ptype=0 then case when ua.isjoin=1 then b.outfee-b.infee else 0 end else 0 end discamt
,case when a.ptype=0 then case when ua.isjoin=1 then b.infee else b.outfee end else c.price end payamt
,case when a.ptype=0 then case when ua.isjoin=1 then b.infee else b.outfee end else c.price end * a.pcnt payamt2
,b.rstime,b.retime,b.sstime,b.setime,b.cshape,datediff(b.setime, b.sstime)+1 days
from paycart a
left outer join cm b on a.ptype=0 and b.cmno=a.itemno and b.rstime < now() and b.retime > now()
left outer join book c on a.ptype in (2,9) and c.bkno=a.itemno
inner join users u on u.userno=a.userno
left outer join assign ua on ua.asno=u.asno
where a.userno=#userno# and a.status=1 and a.ispay=1;
</select>
<select id= "pay.mypaies" parameterClass= "int" resultClass= "pay" >
select a.payno,a.ptype,a.isexam,a.pstatus,a.rstatus,a.rstatustime,a.payamt,a.deliamt,a.isdvr,a.cdt,a.payoktime,a.refundamt,a.ispg,a.paylimit
,b.ptype piptype,b.isrebate
,c0.cshape
,case b.ptype when 0 then c0.cname when 2 then c2.bkname when 4 then c0.cname when 3 then c3.exname else '-' end itemname
,a2.dvrcode,a2.isdvr isdvr2
,a3.vactbankname,CAST(AES_DECRYPT(UNHEX(a3.vactnum), <include refid= "sql.digest" > </include> ) AS char) vactnum
,max(r.rfdno) rfdno
from pay a
left outer join paydvr a2 on a2.payno=a.payno
left outer join paydata a3 on a3.payno=a.payno
inner join payitem b on b.payno=a.payno
left outer join cm c0 on b.ptype in (0,4) and c0.cmno=b.itemno
left outer join book c2 on b.ptype=2 and c2.bkno=b.itemno
left outer join exam c3 on b.ptype=3 and c3.exno=b.itemno
left outer join payrfditem ri on ri.pino=b.pino
left outer join payrfd r on r.rfdno=ri.rfdno and r.payno=a.payno and r.rstatus=0
where a.ptype > 0 and a.userno=#userno# and a.pstatus in (1,22,41,42,43)
<isNotNull property= "paytermday" > and date_add(a.cdt, interval $paytermday$ day) > now()</isNotNull>
<isNotNull property= "paytermmonth" > and date_add(a.cdt, interval $paytermmonth$ month) > now()</isNotNull>
group by a.payno,a.ptype,a.isexam,a.pstatus,a.rstatus,a.rstatustime,a.payamt,a.deliamt,a.isdvr,a.cdt,a.payoktime,a.refundamt,a.ispg,a.paylimit
,b.ptype,b.isrebate
,c0.cshape
,c0.cname,c2.bkname,c3.exname
,a2.dvrcode,a2.isdvr
,a3.vactbankname,vactnum
order by a.cdt desc,a.payno
</select>
<select id= "pay.mypay" parameterClass= "hashtable" resultClass= "pay" >
select a.payno,a.ptype,a.ispg,a.isgroup,a.isexam,a.userno,a.pstatus,a.rstatus,a.rstatustime,a.refunding,a.paylimit,a.payoktime,a.isrefunddvr,a.refundamt,a.payamt,a.deliamt,a.isdvr,a.cdt,a.pgkey
,b.dvrcode,b.isdvr isdvr2,b.rcvname,b.post,b.address1,b.address2
,CAST(AES_DECRYPT(UNHEX(b.telno), <include refid= "sql.digest" > </include> ) AS char) telno
,CAST(AES_DECRYPT(UNHEX(b.email), <include refid= "sql.digest" > </include> ) AS char) email
,CAST(AES_DECRYPT(UNHEX(b.mobile), <include refid= "sql.digest" > </include> ) AS char) mobile
,c.vactbankname,CAST(AES_DECRYPT(UNHEX(c.vactnum), <include refid= "sql.digest" > </include> ) AS char) vactnum,c.vactname
from pay a
left outer join paydvr b on b.payno=a.payno
left outer join paydata c on c.payno=a.payno
where a.payno=#payno# and a.userno=#userno# and a.pstatus in (1,22,41,42,43)
</select>
<select id= "pay.mypayitem" parameterClass= "hashtable" resultClass= "payitem" >
2020-11-18 13:33:37 +09:00
select a.ptype,c0.cshape,a.isrebate,a.payamt,a.pcnt,a.rstatus,a.userno,a.pstatus,a.pino,c0.infee,c0.outfee,c0.rstime,c0.retime
2020-10-12 14:39:23 +09:00
,case a.ptype when 0 then c0.cname when 2 then c2.bkname when 4 then c0.cname when 3 then c3.exname else '-' end itemname
,c0.sstime,c0.setime,datediff(c0.setime, c0.sstime)+1 days
,u.username,uc.cname ccpositionname,u.isassignuser
,CAST(AES_DECRYPT(UNHEX(u.telno), <include refid= "sql.digest" > </include> ) AS char) telno
,CAST(AES_DECRYPT(UNHEX(u.email), <include refid= "sql.digest" > </include> ) AS char) email
,CAST(AES_DECRYPT(UNHEX(u.mobile), <include refid= "sql.digest" > </include> ) AS char) mobile
,u.kfcfyear,u.edus,u.depart
,rs.rsno,t.lectno
,a2.taxno
2021-06-28 13:56:25 +09:00
,case when t.sdate is null then c0.sstime else t.sdate end as sdate
,case when t.edate is null then c0.setime else t.edate end as edate
2021-08-23 15:10:15 +09:00
,p.cdt,csd.estart
2021-06-28 13:56:25 +09:00
,c0.studydays
2020-10-12 14:39:23 +09:00
from payitem a
2021-08-23 15:10:15 +09:00
inner join pay p on p.payno = a.payno
2020-10-12 14:39:23 +09:00
left outer join paytax a3 on a3.payno = a.payno and (a3.iscancel is null or a3.iscancel < > 1)
left outer join paytaxitem a2 on a2.pino=a.pino and a3.taxno = a2.taxno
left outer join cm c0 on a.ptype in (0,1,4) and c0.cmno=a.itemno
left outer join book c2 on a.ptype=2 and c2.bkno=a.itemno
left outer join exam c3 on a.ptype=3 and c3.exno=a.itemno
left outer join users u on u.userno=a.userno
left outer join assign ua on ua.asno=u.asno
2020-11-26 09:22:36 +09:00
left outer join comcode uc on uc.ccode=u.ccposition
2020-10-12 14:39:23 +09:00
left outer join cmrs rs on rs.cmno=c0.cmno and rs.rstype=1 and rs.isdel=0
left outer join lect t on a.ptype in (0,1,4) and t.cmno=c0.cmno and t.payno=a.payno and t.pino=a.pino and t.userno=a.userno
2021-08-23 15:10:15 +09:00
left outer join cminningscd csd on csd.cmisno = t.cmisno
2020-10-12 14:39:23 +09:00
where a.payno=#payno#
</select>
<select id= "pay.mypayrfd" parameterClass= "long" resultClass= "payrfd" >
select a.rfdno
from payrfd a
<dynamic prepend= "where" >
<isNotNull property= "payno" prepend= "and" > a.payno=#payno#</isNotNull>
<isNotNull property= "rstatus" prepend= "and" > a.rstatus=#rstatus#</isNotNull>
2020-11-18 16:02:59 +09:00
<isNotNull property= "withoutrstatus" prepend= "and" > a.rstatus not in($withoutrstatus$)</isNotNull>
2020-10-12 14:39:23 +09:00
</dynamic>
</select>
2020-11-16 18:02:46 +09:00
<select id= "pay.mypayrfdinfo" parameterClass= "long" resultClass= "payrfd" >
select
a.rfdno,a.payno,a.rtext,a.bankname
2021-08-23 15:10:15 +09:00
,b.ptype
2020-11-16 18:02:46 +09:00
,CAST(AES_DECRYPT(UNHEX(a.bankno), <include refid= "sql.digest" > </include> ) AS char) bankno
,CAST(AES_DECRYPT(UNHEX(a.rphone), <include refid= "sql.digest" > </include> ) AS char) rphone
,a.bankowner,a.isowner,a.rstatus,a.statustime,a.ramt,a.rreason,a.ruser,a.fgnor,a.fgnob,a.rback,a.cdt,a.udt,a.cno,a.uno,a.uip
from payrfd a
2021-08-23 15:10:15 +09:00
left outer join pay b on b.payno = a.payno
2020-11-16 18:02:46 +09:00
<dynamic prepend= "where" >
<isNotNull property= "payno" prepend= "and" > a.payno=#payno#</isNotNull>
2020-11-18 16:02:59 +09:00
<isNotNull property= "withoutrstatus" prepend= "and" > a.rstatus not in($withoutrstatus$)</isNotNull>
2020-11-16 18:02:46 +09:00
</dynamic>
order by a.cdt desc
</select>
2020-10-12 14:39:23 +09:00
<select id= "pay.paytax.fornew" parameterClass= "hashtable" resultClass= "paytax" >
select a.payno,a.isgroup,a.ptype,a.ispg
2021-04-28 15:36:20 +09:00
,ua.asname,ua.ceoname,ua.brno,ua.grno,ua.btype,ua.bkind,ua.post,ua.address1,ua.address2
,ua.mname manname
,CAST(AES_DECRYPT(UNHEX(ua.mphone), <include refid= "sql.digest" > </include> ) AS char) telno
,CAST(AES_DECRYPT(UNHEX(ua.taxemail), <include refid= "sql.digest" > </include> ) AS char) email
2020-10-12 14:39:23 +09:00
,sum(case when b.taxdate is not null then 0 else b.taxamt end) taxamtsum
,sum(b.taxamt) taxamt
from pay a
inner join users u on u.userno=a.userno
2021-04-28 15:36:20 +09:00
left outer join assign ua on ua.asno=u.asno
2020-10-12 14:39:23 +09:00
left outer join paytax b on b.payno=a.payno and (b.iscancel is null or b.iscancel < > 1)
where a.payno=#payno# and a.userno=#userno# and a.rstatus < 2 and (a.pstatus=1 or a.pstatus=22)
2021-04-28 15:36:20 +09:00
group by a.payno,a.isgroup,ua.asname,ua.ceoname,ua.brno,ua.grno,ua.btype,ua.bkind
2020-10-12 14:39:23 +09:00
</select>
<select id= "pay.paytax.fornewitem" parameterClass= "hashtable" resultClass= "paytax" >
select a.payno,a.isgroup
,ifnull(c.taxno,0) taxno,b.pino,b.ptype,b.rstatus
,case b.ptype when 0 then c0.cname when 4 then c0.cname when 2 then c2.bkname when 3 then c3.exname else '-' end itemname
,b.pcnt,b.payamt
from pay a
inner join payitem b on b.payno=a.payno and (b.pstatus=1 or b.pstatus=22)
left outer join cm c0 on b.ptype in (0,4) and c0.cmno=b.itemno
left outer join book c2 on b.ptype=2 and c2.bkno=b.itemno
left outer join exam c3 on b.ptype=3 and c3.exno=b.itemno
left outer join paytax c4 on c4.payno = a.payno and (c4.iscancel is null or c4.iscancel < > 1)
left outer join paytaxitem c on c.pino=b.pino and c.taxno = c4.taxno
where a.payno=#payno# and a.userno=#userno# and a.rstatus < 2 and (a.pstatus=1 or a.pstatus=22)
order by ifnull(c.taxno,0),b.pino
</select>
<insert id= "pay.paytax.in" parameterClass= "paytax" >
2021-07-09 09:53:57 +09:00
insert into paytax(payno,taxamt,pcnt,asname,ceoname,brno,grno,btype,bkind,manname,telno,email,fgno,taxinfo,asaddr,isreceipt,taxdatereq,<include refid= "sql.inc" > </include> )
2020-10-12 14:39:23 +09:00
select a.payno
,sum(b.payamt)
,sum(b.pcnt)
,#asname#,#ceoname#
,#brno#
,#grno#
,#btype#,#bkind#,#manname#
,HEX(AES_ENCRYPT(#telno#, <include refid= "sql.digest" > </include> ))
,HEX(AES_ENCRYPT(#email#, <include refid= "sql.digest" > </include> ))
2021-07-09 09:53:57 +09:00
,#fgno#,#taxinfo#,#asaddr#,#isreceipt#,#taxdatereq#,<include refid= "sql.inv" > </include>
2020-10-12 14:39:23 +09:00
from pay a
inner join payitem b on b.payno=a.payno and b.pino in ($pinos$) and (a.pstatus=1 or a.pstatus=22) and a.rstatus=0
where a.payno=#payno# and a.userno=#uno# and (a.pstatus=1 or a.pstatus=22) and a.rstatus < 2
group by a.payno;
<selectKey type= "post" property= "taxno" resultClass= "long" > SELECT LAST_INSERT_ID()</selectKey>
</insert>
<update id= "pay.paytaxitem.in" parameterClass= "paytax" >
insert into paytaxitem (taxno,pino,<include refid= "sql.inc" > </include> )
select #taxno#,b.pino,<include refid= "sql.inv" > </include>
from pay a
inner join payitem b on b.payno=a.payno and b.pino in ($pinos$) and (a.pstatus=1 or a.pstatus=22) and a.rstatus=0
where a.payno=#payno# and a.userno=#uno# and (a.pstatus=1 or a.pstatus=22) and a.rstatus < 2
</update>
<select id= "pay.payitem.forrefund" parameterClass= "hashtable" resultClass= "payitem" >
select distinct a.payno,b.pino,b.pstatus,b.rstatus,b.payamt,b.ptype,b.pcnt
,case b.ptype when 0 then c0.cname when 4 then c0.cname when 2 then c2.bkname when 3 then c3.exname else '-' end itemname
,case when b.ptype in (0,1,4) then
case when date_add(c0.retime, interval 1 day) < now() then 1 else 0 end
else
case when b.ptype=3 then
case when date_add(c3.retime, interval 1 day) < now() then 1 else 0 end
else
0
end
end ispast
,u.username
,max(d.rfdno) rfdno
,max(ifnull(case when c.rstatus=1 then -1 else c.rstatus end,-2)) rfdrstatus
from pay a
inner join payitem b on b.payno=a.payno and b.pstatus=1
left outer join users u on a.isgroup=1 and b.ptype=0 and u.userno=b.userno
left outer join cm c0 on b.ptype in (0,4) and c0.cmno=b.itemno
left outer join book c2 on b.ptype=2 and c2.bkno=b.itemno
left outer join exam c3 on b.ptype=3 and c3.exno=b.itemno
left outer join payrfditem d on d.pino=b.pino
left outer join payrfd c on c.rfdno=d.rfdno and c.payno=a.payno and c.rstatus in (0,2)
where a.payno=#payno# and a.userno=#userno# and a.pstatus=1 and a.rstatus < 2
<!-- and (d.rfdno is null or (d.rfdno is not null and c.rfdno is not null)) -->
group by a.payno,b.pino,b.pstatus,b.rstatus,b.payamt,b.ptype,b.pcnt
,c0.cname,c2.bkname,c3.exname,c0.retime,c3.retime,u.username
order by d.rfdno,b.rstatus,ispast,b.pino
</select>
<insert id= "pay.payrfd.in" parameterClass= "payrfd" >
2020-12-28 13:43:01 +09:00
delete from payrfd where payno=#payno#;
2020-12-11 15:33:48 +09:00
insert into payrfd(payno,rtext,bankname,bankno,bankowner,isowner,rstatus,ruser,rphone,rreason,fgnor,fgnob,ramt,<include refid= "sql.inc" > </include> )
2020-10-12 14:39:23 +09:00
select distinct #payno#,#rtext#,#bankname#
,HEX(AES_ENCRYPT(#bankno#, <include refid= "sql.digest" > </include> ))
2020-11-17 17:36:55 +09:00
,#bankowner#,#isowner#,#rstatus#,#ruser#
,HEX(AES_ENCRYPT(#rphone#, <include refid= "sql.digest" > </include> ))
2020-12-11 15:33:48 +09:00
,#rreason#,#fgnor#,#fgnob#,#ramt#,<include refid= "sql.inv" > </include>
2020-10-12 14:39:23 +09:00
from pay a
inner join payitem b on b.payno=a.payno and b.pino in ($pinos$) and a.pstatus=1 and a.rstatus=0
2021-07-12 10:39:26 +09:00
left outer join cm c0 on b.ptype in (0,4) and c0.cmno=b.itemno
2020-10-12 14:39:23 +09:00
left outer join book c2 on b.ptype=2 and c2.bkno=b.itemno
left outer join exam c3 on b.ptype=3 and c3.exno=b.itemno and c3.retime > now()
where a.payno=#payno# and a.userno=#uno# and a.pstatus=1 and a.rstatus < 2 and (b.ptype=2 or c0.cmno is not null or c3.exno is not null);
<selectKey type= "post" property= "rfdno" resultClass= "long" > SELECT LAST_INSERT_ID()</selectKey>
</insert>
<update id= "pay.payrfditem.in" parameterClass= "payrfd" >
insert into payrfditem (rfdno,pino,<include refid= "sql.inc" > </include> )
select #rfdno#,b.pino,<include refid= "sql.inv" > </include>
from pay a
inner join payitem b on b.payno=a.payno and b.pino in ($pinos$) and a.pstatus=1 and a.rstatus=0
2021-07-12 10:39:26 +09:00
left outer join cm c0 on b.ptype in (0,4) and c0.cmno=b.itemno
2020-10-12 14:39:23 +09:00
left outer join book c2 on b.ptype=2 and c2.bkno=b.itemno
left outer join exam c3 on b.ptype=3 and c3.exno=b.itemno and c3.retime > now()
where a.payno=#payno# and a.userno=#uno# and a.pstatus=1 and a.rstatus < 2 and (b.ptype=2 or c0.cmno is not null or c3.exno is not null)
</update>
2020-11-17 17:36:55 +09:00
<update id= "pay.payrfd.up" parameterClass= "hashtable" >
update payrfd
set fgnor=#fgnor#,fgnob=#fgnob#,udt=now(),uno=#uno#,uip=#uip#
2020-11-18 12:55:06 +09:00
where rfdno=#rfdno# and payno=#payno#
2020-11-17 17:36:55 +09:00
</update>
<update id= "pay.payrfdcancel.up" parameterClass= "hashtable" >
2020-12-28 13:43:01 +09:00
delete from payrfditem where rfdno=#rfdno#;
2020-11-17 17:36:55 +09:00
update payrfd
set rstatus=#rstatus#,udt=now(),uno=#uno#,uip=#uip#
2020-11-18 12:57:46 +09:00
where rfdno=#rfdno# and payno=#payno#
2020-11-17 17:36:55 +09:00
</update>
2020-11-18 16:02:59 +09:00
2020-10-12 14:39:23 +09:00
<update id= "pay.unpay" parameterClass= "hashtable" >
update examuser a
inner join pay b on b.payno=a.payno and b.pstatus=22 and b.ptype=3 and b.ispg=1 <!-- and b.paylimit < now() --> and b.isunpay is null and b.userno=a.userno
inner join payitem c on c.payno=b.payno and c.ptype=3 and c.itemno=a.exno and c.pino=a.pino
set a.pstatus=1,a.udt=now(),a.uno=#uno#,a.uip=#uip#
where a.payno=#payno# and a.pstatus=2;
update lect a
inner join pay b on b.payno=a.payno and b.pstatus=22 and b.ptype=3 and b.ispg=1 <!-- and b.paylimit < now() --> and b.isunpay is null
inner join payitem c on c.payno=b.payno and c.ptype in(0,4) and c.itemno=a.cmno and c.userno=a.userno and c.pino=a.pino
set a.status=1,a.udt=now(),a.uno=#uno#,a.uip=#uip#
where a.payno=#payno# and a.status=2 and a.ischanged=0;
update payitem a
inner join pay b on b.payno=a.payno and b.pstatus=22 and b.ptype=3 and b.ispg=1 <!-- and b.paylimit < now() --> and b.isunpay is null
set a.pstatus=1,a.udt=now(),a.uno=#uno#,a.uip=#uip#
where a.payno=#payno#;
update pay
set pstatus=1,isunpay=1,udt=now(),uno=#uno#,uip=#uip#
where payno=#payno# and pstatus=22 and ptype=3 and ispg=1 <!-- and paylimit < now() --> and isunpay is null;
2021-08-23 15:10:15 +09:00
update lect a
inner join cm b on a.cmno = b.cmno
inner join pay c on a.payno = c.payno
set
a.sdate = case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' and b.cshape < > 1 then date_format(<include refid= "sql.now" > </include> ,'%Y-%m-%d 00:00:00')
else b.sstime end,
a.edate = case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' and b.cshape < > 1 then date_format(date_add(<include refid= "sql.now" > </include> ,interval b.studydays day),'%Y-%m-%d 23:59:59')
else b.setime end
where a.payno = #payno# and c.pstatus = 1;
2020-10-12 14:39:23 +09:00
</update>
<update id= "pay.abspay" parameterClass= "hashtable" >
update examuser a
inner join pay b on b.payno=a.payno and b.pstatus=22 and b.ptype=3 and b.ispg=1 <!-- and b.paylimit < now() --> and b.isunpay is null and b.userno=a.userno
inner join payitem c on c.payno=b.payno and c.ptype=3 and c.itemno=a.exno and c.pino=a.pino
set a.pstatus=1,a.udt=now(),a.uno=#uno#,a.uip=#uip#
where a.payno=#payno# and a.pstatus=2;
update lect a
inner join pay b on b.payno=a.payno and b.pstatus=22 and b.ptype=3 and b.ispg=1 <!-- and b.paylimit < now() --> and b.isunpay is null
inner join payitem c on c.payno=b.payno and c.ptype in(0,4) and c.itemno=a.cmno and c.userno=a.userno and c.pino=a.pino
set a.status=1,a.udt=now(),a.uno=#uno#,a.uip=#uip#
where a.payno=#payno# and a.status=2 and a.ischanged=0;
update payitem a
inner join pay b on b.payno=a.payno and b.pstatus=22 and b.ptype=3 and b.ispg=1 <!-- and b.paylimit < now() --> and b.isunpay is null
set a.pstatus=1,a.udt=now(),a.uno=#uno#,a.uip=#uip#
where a.payno=#payno#;
update pay
set ptype=#ptype#,payoktime=now(),pstatus=1,isunpay=3,udt=now(),uno=#uno#,uip=#uip#
where payno=#payno# and pstatus=22 and ptype=3 and ispg=1 <!-- and paylimit < now() --> and isunpay is null;
2021-01-22 10:59:21 +09:00
<!-- 수강시작일 / 종료일 추가 2021 - 01 - 21 -->
update lect a
inner join cm b on a.cmno = b.cmno
inner join pay c on a.payno = c.payno
set
a.sdate = case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' and b.cshape < > 1 then date_format(c.payoktime,'%Y-%m-%d 00:00:00')
else b.sstime end,
a.edate = case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' and b.cshape < > 1 then date_format(date_add(c.payoktime,interval b.studydays day),'%Y-%m-%d 23:59:59')
else b.setime end
where a.payno = #payno# and c.pstatus = 1
2020-10-12 14:39:23 +09:00
</update>
<update id= "pay.unpaymoney" parameterClass= "hashtable" >
update pay
set isunpay=2,payoktime=#payoktime#,udt=now(),uno=#uno#,uip=#uip#
where payno=#payno# and isunpay=1;
2021-08-23 15:10:15 +09:00
update lect a
inner join cm b on a.cmno = b.cmno
inner join pay c on a.payno = c.payno
set
a.sdate = case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' and b.cshape < > 1 then date_format(c.payoktime,'%Y-%m-%d 00:00:00')
else b.sstime end,
a.edate = case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' and b.cshape < > 1 then date_format(date_add(c.payoktime,interval b.studydays day),'%Y-%m-%d 23:59:59')
else b.setime end
where a.payno = #payno# and c.pstatus = 1;
2020-10-12 14:39:23 +09:00
</update>
2020-11-12 16:28:05 +09:00
<select id= "pay.pplogs" parameterClass= "hashtable" resultClass= "pplog" >
2021-07-09 09:53:57 +09:00
select a.pplno,a.isready,a.cmno,a.cmisno,a.isrebate,a.rbankname,CAST(AES_DECRYPT(UNHEX(a.rbankacc), <include refid= "sql.digest" > </include> ) AS char) rbankacc,a.rbankowner,a.isaccommodation,a.cshape,a.isreceipt,a.taxdatereq
2021-04-28 15:36:20 +09:00
,b.payno,b.pstatus
,a2.infee,a2.accommofee
,b.isbill
2021-06-22 14:09:17 +09:00
,a.asname, a.ceoname, a.brno, a.btype, a.bkind, a.mname, a.post, a.address1, a.address2, a.eino
2021-04-28 15:36:20 +09:00
,CAST(AES_DECRYPT(UNHEX(a.mphone), <include refid= "sql.digest" > </include> ) AS char) mphone
2021-08-23 15:10:15 +09:00
,CAST(AES_DECRYPT(UNHEX(a.taxemail), <include refid= "sql.digest" > </include> ) AS char) taxemail
,b.cdt
2021-04-28 15:36:20 +09:00
from pplog a
inner join cm a2 on a2.cmno=a.cmno
left outer join pay b on b.pplno=a.pplno
<dynamic prepend= "where" >
2020-11-12 16:28:05 +09:00
<isNotNull property= "pplno" prepend= "and" > a.pplno=#pplno#</isNotNull>
<isNotNull property= "userno" prepend= "and" > a.userno=#userno#</isNotNull>
2021-08-23 15:10:15 +09:00
</dynamic>
2020-11-12 16:28:05 +09:00
</select>
<select id= "pay.payresult" parameterClass= "hashtable" resultClass= "payitem" >
select a.payno,a.payamt,a.ptype,a.pstatus
,b.itemno
2021-04-28 15:36:20 +09:00
,b.pino
2020-11-12 16:28:05 +09:00
from pay a
inner join payitem b on b.payno=a.payno
2020-12-11 16:34:45 +09:00
where a.payno=#payno# and a.userno=#userno# and a.pstatus in (1,21,22,51,55)
2020-11-24 17:34:18 +09:00
</select>
<select id= "pay.lectready" parameterClass= "int" resultClass= "int" >
select count(a.userno)
from lect a
where a.cmno=#cmno# and a.isready=1 and a.status=6
2020-11-12 16:28:05 +09:00
</select>
2020-11-26 13:49:56 +09:00
<select id= "pay.pplogs.bypay" parameterClass= "hashtable" resultClass= "pplog" >
2021-05-21 16:34:04 +09:00
select a.pplno,a.isready,a.cmno,a.cmisno,a.isrebate,a.rbankname,CAST(AES_DECRYPT(UNHEX(a.rbankacc), <include refid= "sql.digest" > </include> ) AS char) rbankacc,a.rbankowner,a.isaccommodation,a.cshape
2020-11-26 13:49:56 +09:00
,b.payno,b.pstatus
from pay b
inner join pplog a on a.pplno=b.pplno
where b.payno=#payno# and a.userno=#userno#
</select>
2021-03-18 17:14:50 +09:00
<update id= "pay.pplogtype.up" parameterClass= "hashtable" >
update pplog
set
typeman = #typeman#
,typejob = #typejob#
,typeedu = #typeedu#
,typegrade = #typegrade#
where pplno = #pplno#
</update>
2021-07-09 09:53:57 +09:00
<update id= "pay.pplog.up" parameterClass= "hashtable" >
update pplog
set <include refid= "sql.up" > </include>
<isNotNull property= "mgtkey" > ,mgtkey=#mgtkey#</isNotNull>
<isNotNull property= "isreceipt" > ,isreceipt=#isreceipt#</isNotNull>
<isNotNull property= "taxdatereq" > ,taxdatereq=#taxdatereq#</isNotNull>
where pplno = #pplno# and userno=#userno#
</update>
2020-10-12 14:39:23 +09:00
</statements>
</sqlMap>