732 lines
46 KiB
XML
732 lines
46 KiB
XML
<?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="users" type="NP.Model.Users, NP.Model" />
|
|
<typeAlias alias="authlog" type="NP.Model.AuthLog, NP.Model" />
|
|
<typeAlias alias="loginlog" type="NP.Model.LoginLog, NP.Model" />
|
|
<typeAlias alias="assign" type="NP.Model.Assign, NP.Model" />
|
|
<typeAlias alias="assignfee" type="NP.Model.AssignFee, NP.Model" />
|
|
<typeAlias alias="assignman" type="NP.Model.AssignMan, NP.Model" />
|
|
<typeAlias alias="users.lect" type="NP.Model.Lect, NP.Model" />
|
|
<typeAlias alias="councel" type="NP.Model.Councel, NP.Model" />
|
|
</alias>
|
|
|
|
<cacheModels>
|
|
<cacheModel id="userCache" implementation="LRU" >
|
|
<flushInterval hours="1" />
|
|
<property name="CacheSize" value="1000" />
|
|
</cacheModel>
|
|
</cacheModels>
|
|
|
|
<!--<parametermaps>
|
|
</parametermaps>-->
|
|
|
|
<resultMaps>
|
|
</resultMaps>
|
|
|
|
<statements>
|
|
<sql id="sql.prc">count(a.cdt) over() pagetotalcount</sql>
|
|
<sql id="sql.inc">cdt,cno,udt,uno,uip</sql>
|
|
<sql id="sql.inv">now(),#uno#,now(),#uno#,#uip#</sql>
|
|
<sql id="sql.up">udt=now(),uno=#uno#,uip=#uip#</sql>
|
|
<sql id="sql.now">now()</sql>
|
|
<sql id="sql.digest">'np123@!'</sql>
|
|
<sql id="sql.page">
|
|
<isNotNull property="pagerange" prepend="and">rno between $pagerange$</isNotNull>
|
|
</sql>
|
|
<sql id="sql.pagedynamic">
|
|
<dynamic prepend="where">
|
|
<isNotNull property="pagerange" prepend="and">rno between $pagerange$</isNotNull>
|
|
</dynamic>
|
|
</sql>
|
|
<select id="users.adminlogin" parameterClass="hashtable" resultClass="users">
|
|
select userno,a.username,a.status,a.userpass, usertype,a.asno
|
|
from users a
|
|
left outer join assign b on b.asno=a.asno
|
|
where a.userid=#userid# and a.usertype > 10 and (a.usertype <> 81 or (a.usertype = 81 and b.status=1))
|
|
</select>
|
|
<insert id="users.loginlog" parameterClass="hashtable">
|
|
insert into loginlog (logsite,userno, loginstatus, logindata, <include refid="sql.inc"></include>) values (#loginsite#,#userno#, #loginstatus#, #logindata#, <include refid="sql.inv"></include>)
|
|
</insert>
|
|
|
|
<select id="users.assigns" parameterClass="hashtable" resultClass="assign">
|
|
select a.*
|
|
from (
|
|
select a.asno,a.asname,a.brno
|
|
,a.asno value,a.asname text
|
|
,a.isjoin,a.ascode,a.astype,a.asctg,a.joindate,a.status
|
|
,c1.cname astypename,c2.cname asctgname
|
|
,row_number() over(order by <isNotNull property="orderby">$orderby$</isNotNull><isNull property="orderby">a.asname</isNull>) rno
|
|
,count(a.cdt) over() pagetotalcount
|
|
from assign a
|
|
left outer join comcode c1 on c1.ccode=a.astype
|
|
left outer join comcode c2 on c2.ccode=a.asctg
|
|
where a.isdel=0
|
|
<isNotNull property="asno" prepend="and">a.asno=#asno#</isNotNull>
|
|
<isNotNull property="status" prepend="and">a.status=#status#</isNotNull>
|
|
<isNotNull property="statuses" prepend="and">a.status in ($statuses$)</isNotNull>
|
|
<isNotNull property="asname" prepend="and">a.asname like concat('%',#asname#,'%')</isNotNull>
|
|
<isNotNull property="brnos" prepend="and">a.brno in ($brnos$)</isNotNull>
|
|
<isNotNull property="brno" prepend="and">a.brno =#brno#</isNotNull>
|
|
<isNotNull property="ismain" prepend="and">a.ismain=#ismain#</isNotNull>
|
|
<isNotNull property="isjoin" prepend="and">a.isjoin=#isjoin#</isNotNull>
|
|
<isNotNull property="issite" prepend="and">a.issite=#issite#</isNotNull>
|
|
<isNotNull property="ceoname" prepend="and">a.ceoname=#ceoname#</isNotNull>
|
|
) a
|
|
<include refid="sql.pagedynamic"></include>
|
|
order by a.rno
|
|
</select>
|
|
<select id="users.assigns2" parameterClass="hashtable" resultClass="assign">
|
|
select a.*
|
|
from (
|
|
select a.asno,a.astype,a.asctg,a.askey,a.brno,a.ismain
|
|
,a.asname,a.asno value,a.asname text,a.isjoin,a.joinyear,a.joinprice,a.ascode,a.joindate
|
|
,year(a.joindate) joindateyear, a.exitdate,a.aday,a.status,a.ceoname
|
|
$excel1$
|
|
,a.address1,a.address2,concat(a.address1, a.address2) adr1,a.grno,a.btype,a.bkind,a.salesamount,a.homeurl,a.mcount
|
|
,a.fgnobno,a.fgnobank,a.issite
|
|
,a.subdomain,a.sitename,a.sitelogo,a.sitefooter
|
|
,a.eino, a.mname
|
|
,CAST(AES_DECRYPT(UNHEX(a.mphone), <include refid="sql.digest"></include>) AS char) mphone
|
|
,CAST(AES_DECRYPT(UNHEX(a.taxemail), <include refid="sql.digest"></include>) AS char) taxemail
|
|
,a.cdt
|
|
,c.fdate
|
|
,case when c.status = 1 then 1 else 0 end fstatus
|
|
,case when c.fyear=year(now()) then c.status else c.status end fnstatus
|
|
,case when c.fyear=year(now()) then c.fprice else 0 end fnprice
|
|
,c1.cname astypename,c2.cname asctgname,c3.cname askeyname
|
|
,row_number() over(order by $orderby$) rno
|
|
,count(a.cdt) over() pagetotalcount
|
|
from (
|
|
select distinct a.asno
|
|
from assign a
|
|
left outer join assignman b on b.asno=a.asno and b.isdel=0 and b.mname = ifnull(#mname#, 'xx박효동 xx')
|
|
where a.isdel=0
|
|
<isNotNull property="asno" prepend="and">a.asno=#asno#</isNotNull>
|
|
<isNotNull property="status" prepend="and">a.status=#status#</isNotNull>
|
|
<isNotNull property="statuses" prepend="and">a.status in ($statuses$)</isNotNull>
|
|
<isNotNull property="asname" prepend="and">a.asname like concat('%',#asname#,'%')</isNotNull>
|
|
<isNotNull property="brnos" prepend="and">a.brno in ($brnos$)</isNotNull>
|
|
<isNotNull property="brno" prepend="and">a.brno =#brno#</isNotNull>
|
|
<isNotNull property="ismain" prepend="and">a.ismain=#ismain#</isNotNull>
|
|
<isNotNull property="isjoin" prepend="and">a.isjoin=#isjoin#</isNotNull>
|
|
<isNotNull property="ceoname" prepend="and">a.ceoname like concat('%',#ceoname#,'%')</isNotNull>
|
|
<isNotNull property="mname" prepend="and">a.mname like concat('%',#mname#,'%')</isNotNull>
|
|
<isNotNull property="salesamountf" prepend="and">a.salesamount between #salesamountf# and #salesamountt#</isNotNull>
|
|
<isNotNull property="mcountf" prepend="and">a.mcount between #mcountf# and #mcountt#</isNotNull>
|
|
<isNotNull property="cdtf" prepend="and">a.cdt between #cdtf# and #cdtt#</isNotNull>
|
|
<isNotNull property="astype" prepend="and">a.astype=#astype#</isNotNull>
|
|
<isNotNull property="asctg" prepend="and">a.asctg=#asctg#</isNotNull>
|
|
<isNotNull property="askey" prepend="and">a.askey=#askey#</isNotNull>
|
|
<isNotNull property="issite" prepend="and">a.issite=#issite#</isNotNull>
|
|
<isNotNull property="asnolt" prepend="and">a.asno < #asnolt#</isNotNull>
|
|
<isNotEmpty property="mphone" prepend="and">
|
|
CAST(AES_DECRYPT(UNHEX(a.mphone), <include refid="sql.digest"></include>) AS char) like concat('%',#mphone#,'%')
|
|
</isNotEmpty>
|
|
) b
|
|
inner join assign a on a.asno=b.asno
|
|
left outer join assignfee c on c.asno=a.asno <isNull property="fyear">and c.fyear=0</isNull> <isNotNull property="fyear">and c.fyear=#fyear#</isNotNull> and c.asno >0
|
|
left outer join comcode c1 on c1.ccode=a.astype
|
|
left outer join comcode c2 on c2.ccode=a.asctg
|
|
left outer join comcode c3 on c3.ccode=a.askey
|
|
<dynamic prepend="where">
|
|
<isNotNull property="statusfee" prepend="and">case when c.status = 1 then 1 else 0 end in ($statusfee$)</isNotNull>
|
|
</dynamic>
|
|
) a
|
|
<isNull property="isexcel">
|
|
<include refid="sql.pagedynamic"></include>
|
|
</isNull>
|
|
group by a.asno,a.brno
|
|
order by a.rno
|
|
</select>
|
|
<select id="users.assignsite" parameterClass="hashtable" resultClass="assign">
|
|
select a.asno,a.asname,a.issite,a.subdomain,a.sitename,a.sitelogo,a.sitefooter,a.siteip
|
|
,b.fileurl
|
|
from assign a
|
|
left outer join fileinfo b on b.fgno=a.sitelogo and b.isdel=0
|
|
<dynamic prepend="where">
|
|
<isNotNull property="asno" prepend="and">a.asno=#asno#</isNotNull>
|
|
<isNotNull property="subdomain" prepend="and">a.subdomain=#subdomain#</isNotNull>
|
|
<isNotNull property="asnonot" prepend="and">a.asno<>#asnonot#</isNotNull>
|
|
</dynamic>
|
|
</select>
|
|
<select id="users.assignmans" parameterClass="hashtable" resultClass="assignman">
|
|
select a.asmno,a.asno,a.mtype,a.jtype,a.depart,a.mname,a.position
|
|
,CAST(AES_DECRYPT(UNHEX(a.telno), <include refid="sql.digest"></include>) AS char) telno
|
|
,CAST(AES_DECRYPT(UNHEX(a.mobile), <include refid="sql.digest"></include>) AS char) mobile
|
|
,CAST(AES_DECRYPT(UNHEX(a.fax), <include refid="sql.digest"></include>) AS char) fax
|
|
,CAST(AES_DECRYPT(UNHEX(a.email), <include refid="sql.digest"></include>) AS char) email
|
|
,a.post,a.address1,a.address2
|
|
from assignman a
|
|
<dynamic prepend="where">
|
|
<isNotNull property="asno" prepend="and">a.asno=#asno#</isNotNull>
|
|
<isNotNull property="mtype" prepend="and">a.mtype=#mtype#</isNotNull>
|
|
<isNotNull property="jtype" prepend="and">a.jtype=#jtype#</isNotNull>
|
|
and a.isdel=0
|
|
</dynamic>
|
|
order by a.mtype,a.jtype,a.cdt
|
|
</select>
|
|
<select id="users.assignmans2" parameterClass="hashtable" resultClass="assignman">
|
|
select a.*
|
|
from (
|
|
select a.asno,a.asname,a.brno
|
|
,a.asno value,a.asname text
|
|
,a.isjoin,a.ascode,a.astype,a.asctg,a.joindate,a.status,a.ceoname, concat('[',a.post,']') post,concat(ifnull(a.post,''),ifnull(a.address1,''),ifnull(a.address2,'')) adr1
|
|
,c.mtype,c.jtype,c.depart,c.mname,c.position
|
|
,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
|
|
,concat('[',c.post,']') post2,concat(ifnull(c.post,''),ifnull(c.address1,''),ifnull(c.address2,'')) adr2
|
|
,c1.cname astypename,c2.cname asctgname,c3.cname askeyname
|
|
,case when d.status=1 then 1 else 0 end fstatus
|
|
,row_number() over(order by <isNotNull property="orderby">$orderby$</isNotNull><isNull property="orderby">a.asname</isNull>,a.asno,c.mtype,c.jtype,c.cdt) rno
|
|
,count(a.cdt) over() pagetotalcount
|
|
from (
|
|
select distinct a.asno
|
|
from assign a
|
|
left outer join assignman b on b.asno=a.asno and b.isdel=0 and b.mname = ifnull(#mname#, 'xx박효동 xx')
|
|
where a.isdel=0
|
|
<isNotNull property="asno" prepend="and">a.asno=#asno#</isNotNull>
|
|
<isNotNull property="status" prepend="and">a.status=#status#</isNotNull>
|
|
<isNotNull property="statuses" prepend="and">a.status in ($statuses$)</isNotNull>
|
|
<isNotNull property="asname" prepend="and">a.asname like concat('%',#asname#,'%')</isNotNull>
|
|
<isNotNull property="brnos" prepend="and">a.brno in ($brnos$)</isNotNull>
|
|
<isNotNull property="brno" prepend="and">a.brno =#brno#</isNotNull>
|
|
<isNotNull property="ismain" prepend="and">a.ismain=#ismain#</isNotNull>
|
|
<isNotNull property="isjoin" prepend="and">a.isjoin=#isjoin#</isNotNull>
|
|
<isNotNull property="ceoname" prepend="and">a.ceoname=#ceoname#</isNotNull>
|
|
<isNotNull property="mname" prepend="and">b.mname is not null</isNotNull>
|
|
<isNotNull property="salesamountf" prepend="and">a.salesamount between #salesamountf# and #salesamountt#</isNotNull>
|
|
<isNotNull property="mcountf" prepend="and">a.mcount between #mcountf# and #mcountt#</isNotNull>
|
|
<isNotNull property="joindatef" prepend="and">a.joindate between #joindatef# and #joindatet#</isNotNull>
|
|
<isNotNull property="astype" prepend="and">a.astype=#astype#</isNotNull>
|
|
<isNotNull property="asctg" prepend="and">a.asctg=#asctg#</isNotNull>
|
|
<isNotNull property="askey" prepend="and">a.askey=#askey#</isNotNull>
|
|
) b
|
|
inner join assign a on a.asno=b.asno
|
|
inner join assignman c on c.asno=a.asno and c.isdel=0
|
|
left outer join assignfee d on d.asno=a.asno
|
|
left outer join comcode c1 on c1.ccode=a.astype
|
|
left outer join comcode c2 on c2.ccode=a.asctg
|
|
left outer join comcode c3 on c3.ccode=a.askey
|
|
<isNotNull property="statusfee">where d.status in ($statusfee$) </isNotNull>
|
|
group by a.asno,c.asmno
|
|
) a
|
|
<isNull property="isexcel">
|
|
<include refid="sql.pagedynamic"></include>
|
|
</isNull>
|
|
order by a.rno
|
|
</select>
|
|
|
|
<select id="users.users" parameterClass="hashtable" resultClass="users">
|
|
select a.*
|
|
from (
|
|
select a.userno,a.usertype,a.asno,a.pasname,a.userid,a.username,a.status,a.gender,a.jointype
|
|
,b.asname,b.isjoin,b.ceoname,b.brno,b.post aspost,b.address1 asaddress1,b.address2 asaddress2,b.btype asbtype,b.bkind asbkind
|
|
,CAST(AES_DECRYPT(UNHEX(a.email), <include refid="sql.digest"></include>) AS char) email
|
|
,CAST(AES_DECRYPT(UNHEX(a.mobile), <include refid="sql.digest"></include>) AS char) mobile
|
|
,CAST(AES_DECRYPT(UNHEX(a.telno), <include refid="sql.digest"></include>) AS char) telno
|
|
,CAST(AES_DECRYPT(UNHEX(a.userpno), <include refid="sql.digest"></include>) AS char) userpno
|
|
,a.usernameeng,a.logintime
|
|
,CAST(AES_DECRYPT(UNHEX(a.bankno), <include refid="sql.digest"></include>) AS char) bankno
|
|
,a.userkind,a.isacceptemail,a.depart,a.ccposition,a.ccpositionetc,a.fgnoprofile,a.ccjobs
|
|
,a.bankname
|
|
,a.post,a.address1,a.address2,a.introhtml,a.send335time,a.pwcalltime,a.pwcallno,a.eastereggkey,a.eetime
|
|
,a.kfcfyear,a.isassignuser,a.edus
|
|
,case when c.refcode='9' then a.ccpositionetc else c.cname end ccpositionname
|
|
,case when a.usertype=1 then '교육생' when d.authname is null then '-' else d.authname end usertypestr
|
|
,CAST(AES_DECRYPT(UNHEX(a.birthday), <include refid="sql.digest"></include>) AS char) birthday
|
|
,a.uduty,a.slevel,a.isacceptmobile,a.vssn,a.di,a.ci,a.ischkatt,a.authplatform
|
|
,row_number() over(order by <isNotNull property="orderby">$orderby$</isNotNull><isNull property="orderby">a.username</isNull>) rno
|
|
,count(a.cdt) over() pagetotalcount
|
|
from users a
|
|
left outer join assign b on b.asno=a.asno and b.isdel=0
|
|
left outer join comcode c on c.ccode=a.ccposition
|
|
left outer join (
|
|
select distinct usertype,authname
|
|
from menuauth
|
|
) d on d.usertype = a.usertype
|
|
where a.status < 99
|
|
<isNull property="includesysadmin">and a.usertype <> 91</isNull>
|
|
<isNotNull property="userno">and a.userno =#userno#</isNotNull>
|
|
<isNotNull property="usernonot">
|
|
<isGreaterThan property="usernonot" compareValue="0">and a.userno <> #usernonot#</isGreaterThan>
|
|
</isNotNull>
|
|
<isNotEmpty property="usertypes">and a.usertype in ($usertypes$)</isNotEmpty>
|
|
<isNotNull property="usertype">and a.usertype =#usertype#</isNotNull>
|
|
<isNotNull property="userid">and a.userid like concat('%',#userid#,'%')</isNotNull>
|
|
<isNotEmpty property="username" prepend="and">a.username like concat('%',#username#,'%')</isNotEmpty>
|
|
<isNotEmpty property="usernameid" prepend="and">(a.username like concat('%',#usernameid#,'%') or a.userid like concat('%',#usernameid#,'%'))</isNotEmpty>
|
|
<isNotNull property="status" prepend="and">a.status=#status#</isNotNull>
|
|
<isNotNull property="asno" prepend="and">a.asno=#asno#</isNotNull>
|
|
<isNotNull property="profandmainadmin" prepend="and">(a.usertype=11 or (a.usertype > 80 and b.ismain=1))</isNotNull>
|
|
<isNotNull property="asname" prepend="and">b.asname like concat('%',#asname#,'%')</isNotNull>
|
|
<isNotEmpty property="brno" prepend="and">b.brno=#brno#</isNotEmpty>
|
|
<isNotNull property="email" prepend="and">
|
|
CAST(AES_DECRYPT(UNHEX(a.email), <include refid="sql.digest"></include>) AS char) like concat('%',#email#,'%')
|
|
</isNotNull>
|
|
<isNotEmpty property="mobile" prepend="and">
|
|
CAST(AES_DECRYPT(UNHEX(a.mobile), <include refid="sql.digest"></include>) AS char) like concat('%',#mobile#,'%')
|
|
</isNotEmpty>
|
|
<isNotNull property="usertypeover" prepend="and">a.usertype > #usertypeover#</isNotNull>
|
|
<isNotNull property="vssn" prepend="and">a.vssn = #vssn#</isNotNull>
|
|
<isNotNull property="di" prepend="and">a.di = #di#</isNotNull>
|
|
) a
|
|
<include refid="sql.pagedynamic"></include>
|
|
order by a.rno
|
|
|
|
</select>
|
|
<select id="users.usersbyuserids" parameterClass="hashtable" resultClass="users">
|
|
select a.userno,a.userid,a.username,asno
|
|
from users a
|
|
where a.status=1 <isNotNull property="usertype">and a.usertype=#usertype#</isNotNull>
|
|
<isNotNull property="userids">and a.userid in ($userids$)</isNotNull>
|
|
</select>
|
|
<select id="users.byusernos" parameterClass="string" resultClass="users">
|
|
select a.userno,CAST(AES_DECRYPT(UNHEX(a.mobile), <include refid="sql.digest"></include>) AS char) mobile,a.username,b.isjoin
|
|
from users a
|
|
left outer join assign b on b.asno=a.asno
|
|
where a.userno in ($usernos$)
|
|
</select>
|
|
<select id="users.checkuser" parameterClass="hashtable" resultClass="int">
|
|
select min(case when b.userid=#userid# then 1
|
|
else case when b.usertype = 1 and #email# is not null and b.email=HEX(AES_ENCRYPT(#email#, <include refid="sql.digest"></include>)) then 2
|
|
else case when b.usertype = 1 and #mobile# is not null and b.mobile=HEX(AES_ENCRYPT(#mobile#, <include refid="sql.digest"></include>)) then 3
|
|
else 9 end end end)
|
|
from (select 1 col1) a
|
|
left outer join users b on b.userno > 0 <isNotNull property="usernonot">and b.userno <>#usernonot#</isNotNull> and (b.userid=#userid# or b.email=HEX(AES_ENCRYPT(#email#, <include refid="sql.digest"></include>)) or b.mobile=HEX(AES_ENCRYPT(#mobile#, <include refid="sql.digest"></include>)))
|
|
</select>
|
|
<insert id="users.in" parameterClass="hashtable">
|
|
insert into users(usertype,userkind,userid,userpass,username,usernameeng
|
|
,gender,email,isacceptemail,mobile,telno
|
|
,asno,pasname,depart,ccposition,ccpositionetc,fgnoprofile,ccjobs
|
|
,userpno,bankname,bankno
|
|
,post,address1,address2,introhtml,status,logintime,send335time,pwcalltime,pwcallno,eastereggkey,eetime,kfcfyear,isassignuser,edus
|
|
,isacceptmobile,uduty,slevel,jointype,birthday,snsid,di,ci,vssn,ischkatt,authplatform,<include refid="sql.inc"></include>)
|
|
values (#usertype#,#userkind#,#userid#,#userpass#,#username#,#usernameeng#
|
|
,gender,HEX(AES_ENCRYPT(#email#, <include refid="sql.digest"></include>)),#isacceptemail#,HEX(AES_ENCRYPT(#mobile#, <include refid="sql.digest"></include>)),HEX(AES_ENCRYPT(#telno#, <include refid="sql.digest"></include>))
|
|
,#asno#,#pasname#,#depart#,#ccposition#,#ccpositionetc#,#fgnoprofile#,#ccjobs#
|
|
,HEX(AES_ENCRYPT(#userpno#, <include refid="sql.digest"></include>)),#bankname#,HEX(AES_ENCRYPT(#bankno#, <include refid="sql.digest"></include>))
|
|
,#post#,#address1#,#address2#,#introhtml#,#status#,<include refid="sql.now"></include>,null,null,null,null,null,#kfcfyear#,#isassignuser#,#edus#
|
|
,#isacceptmobile#,#uduty#,#slevel#,#jointype#,HEX(AES_ENCRYPT(#birthday#, <include refid="sql.digest"></include>)),#snsid#,#di#,#ci#,#vssn#,#ischkatt#,#authplatform#,<include refid="sql.inv"></include>);
|
|
|
|
<selectKey type="post" property="userno" resultClass="int">SELECT LAST_INSERT_ID()</selectKey>
|
|
</insert>
|
|
<update id="users.up" parameterClass="hashtable">
|
|
update users set <include refid="sql.up"></include>
|
|
,usertype=#usertype#
|
|
,userkind =#userkind#
|
|
<isNotNull property="userpass">,userpass =#userpass#</isNotNull>
|
|
,username =case when #username# is not null then #username# else username end
|
|
,usernameeng =case when #usernameeng# is not null then #usernameeng# else username end
|
|
,gender =#gender#
|
|
,email =case when #email# is null and #usertype# > 80 then null when #email# is not null then HEX(AES_ENCRYPT(#email#, <include refid="sql.digest"></include>)) else email end
|
|
,isacceptemail =case when #isacceptemail# is not null then #isacceptemail# else isacceptemail end
|
|
,mobile =HEX(AES_ENCRYPT(#mobile#, <include refid="sql.digest"></include>))
|
|
,telno =HEX(AES_ENCRYPT(#telno#, <include refid="sql.digest"></include>))
|
|
,asno =#asno#
|
|
,pasname =#pasname#
|
|
,depart =#depart#
|
|
,ccposition =#ccposition#
|
|
,ccpositionetc =#ccpositionetc#
|
|
<isNotNull property="fgnoprofile">,fgnoprofile =#fgnoprofile#</isNotNull>
|
|
,ccjobs =case when #ccjobs# is not null then #ccjobs# else ccjobs end
|
|
,userpno =case when #userpno# is not null then HEX(AES_ENCRYPT(#userpno#, <include refid="sql.digest"></include>)) else null end
|
|
,bankname =case when #bankname# is not null then #bankname# else bankname end
|
|
,bankno =case when #bankno# is not null then HEX(AES_ENCRYPT(#bankno#, <include refid="sql.digest"></include>)) else bankno end
|
|
,post =case when #post# is not null then #post# else post end
|
|
,address1 =case when #address1# is not null then #address1# else address1 end
|
|
,address2 =case when #address2# is not null then #address2# else address2 end
|
|
,introhtml =case when #introhtml# is not null then #introhtml# else introhtml end
|
|
,isacceptmobile = #isacceptmobile#
|
|
,uduty = #uduty#
|
|
,slevel = #slevel#
|
|
,jointype =case when #jointype# is not null then #jointype# else jointype end
|
|
,isassignuser = #isassignuser#
|
|
,birthday = case when #birthday# is not null then HEX(AES_ENCRYPT(#birthday#, <include refid="sql.digest"></include>)) else birthday end
|
|
,kfcfyear =case when #kfcfyear# is not null then #kfcfyear# else kfcfyear end
|
|
<isEqual property="savefrontbuy" compareValue="1">
|
|
,isassignuser =#isassignuser#,kfcfyear =#kfcfyear#,edus=#edus#
|
|
</isEqual>
|
|
,status =case when #status# > 0 then #status# else status end
|
|
,ischkatt = #ischkatt#
|
|
,authplatform =case when #authplatform# > 0 then #authplatform# else authplatform end
|
|
,di =case when #di# is not null then #di# else di end
|
|
,ci =case when #ci# is not null then #ci# else ci end
|
|
,vssn =case when #vssn# is not null then #vssn# else vssn end
|
|
where userno=#userno#
|
|
</update>
|
|
<update id="users.exitjoin" parameterClass="hashtable">
|
|
update users set <include refid="sql.up"></include>
|
|
,username='탈퇴회원',email=null,mobile=null,telno=null,userpno=null,bankno=null,post=null,address1=null,address2=null,status=99
|
|
where
|
|
<isNotNull property="userno">userno=#userno#</isNotNull>
|
|
<isNotNull property="usernos">userno in ($usernos$)</isNotNull>
|
|
</update>
|
|
<update id="users.dormant" parameterClass="hashtable">
|
|
update users set <include refid="sql.up"></include>,status=8
|
|
where userno in ($usernos$)
|
|
</update>
|
|
<select id="users.ee" parameterClass="int" resultClass="users">
|
|
update users set eastereggkey=FLOOR(10000000 + (RAND() * 99999999)),eetime=<include refid="sql.now"></include> where userno=#userno#;
|
|
select a.userno,a.eastereggkey,a.usertype,a.username
|
|
,b.subdomain
|
|
from users a
|
|
left outer join assign b on b.asno=a.asno and b.issite=1 and b.isdel=0
|
|
where a.userno=#userno#;
|
|
</select>
|
|
<select id ="users.batchcheck.bybrnos" parameterClass="string" resultClass="users">
|
|
select distinct(asno),brno
|
|
from assign
|
|
where status =1 and isdel=0
|
|
<isNotNull property="brnos">and brno in ($brnos$)</isNotNull>
|
|
</select>
|
|
<select id="users.usersall" parameterClass="string" resultClass="users">
|
|
select
|
|
userno,usertype,jointype,snsid,userkind,userid,userpass,username,usernameeng,gender,birthday,email,isacceptemail,mobile,isacceptmobile,telno,asno,pasname,depart,ccposition,ccpositionetc,fgnoprofile
|
|
,ccjobs,userpno,bankname,bankno,post,address1,address2,introhtml,status,exitreason,logintime,loginkey,send335time,pwcalltime,pwcallno,eastereggkey,eetime,kfcfyear,isassignuser,uduty,slevel,edus,remotekey
|
|
from users
|
|
</select>
|
|
<select id="users.batchcheck" parameterClass="string" resultClass="users">
|
|
select userid,CAST(AES_DECRYPT(UNHEX(email), <include refid="sql.digest"></include>) AS char) email from users
|
|
where
|
|
<isNotNull property="userids">userid in ($userids$)</isNotNull>
|
|
<isNotNull property="emails">
|
|
CAST(AES_DECRYPT(UNHEX(email), <include refid="sql.digest"></include>) AS char) in ($emails$)
|
|
</isNotNull>
|
|
</select>
|
|
<update id="users.batch" parameterClass="users">
|
|
insert into users (usertype,jointype,userid,userpass,username,gender,email,isacceptemail,isacceptmobile,isassignuser,mobile,telno,asno,depart,ccposition,ccjobs,uduty,status,logintime,<include refid="sql.inc"></include><!--,devcol-->)
|
|
<iterate property="Us" open="" conjunction="union all" close="">
|
|
select 1,0
|
|
,#Us[].userid#
|
|
,#Us[].userpass#
|
|
,#Us[].username#
|
|
,null
|
|
,HEX(AES_ENCRYPT(#Us[].email#, <include refid="sql.digest"></include>))
|
|
,1
|
|
,1
|
|
,1
|
|
,HEX(AES_ENCRYPT(#Us[].mobile#, <include refid="sql.digest"></include>))
|
|
,HEX(AES_ENCRYPT(#Us[].telno#, <include refid="sql.digest"></include>))
|
|
,#Us[].asno#
|
|
,#Us[].depart#
|
|
,null
|
|
,null
|
|
,#Us[].uduty#
|
|
,1,now(), now(), #uno#, now(), #uno#, #uip#
|
|
<!--,#Us[].introhtml#-->
|
|
from (select 1 col1) a
|
|
<!--left outer join assign b on b.brno=#Us[].brno# and b.isdel=0
|
|
left outer join comcode c on c.cgroup='jobposition' and c.ccode=#Us[].ccposition#-->
|
|
</iterate>;
|
|
</update>
|
|
<select id="users.eecall" parameterClass="hashtable" resultClass="users">
|
|
select userno,usertype,username from users where userno=#userno# and eastereggkey=#eek# and date_add(eetime, interval 10 second) > <include refid="sql.now"></include>;
|
|
update users set eastereggkey=null,eetime=null,loginkey=#loginkey# where userno=#userno#
|
|
</select>
|
|
<select id="users.eecall2" parameterClass="hashtable" resultClass="users">
|
|
select userno,usertype,username,userid from users where userno=#userno# and eastereggkey=#eek# and date_add(eetime, interval 10 second) > <include refid="sql.now"></include>;
|
|
update users set eastereggkey=null,eetime=null,loginkey=null where userno=#userno#
|
|
</select>
|
|
<update id="users.loginkey" parameterClass="hashtable">
|
|
update users set loginkey=#loginkey#,logintime =<include refid="sql.now" ></include>,send335time = null where userno=#userno#
|
|
</update>
|
|
<update id="users.loginkey2" parameterClass="hashtable">
|
|
update users set loginkey=#loginkey#,logintime =<include refid="sql.now" ></include>,send335time = null where userno=#userno#;
|
|
insert into loginlog (logsite,userno, loginstatus, logindata, <include refid="sql.inc"></include>)
|
|
values (#loginsite#,#userno#, #loginstatus#, #logindata#, <include refid="sql.inv"></include>)
|
|
</update>
|
|
<select id="users.assignfees" parameterClass="hashtable" resultClass="assignfee">
|
|
select a.asno,a.fyear,a.fprice,a.fdate,a.fmemo,a.status
|
|
from assignfee a
|
|
<dynamic prepend="where">
|
|
<isNotNull property="asnos" prepend="and">a.asno in ($asnos$)</isNotNull>
|
|
<isNotNull property="asno" prepend="and">a.asno =#asno#</isNotNull>
|
|
<isNotNull property="fyear" prepend="and">a.fyear=#fyear#</isNotNull>
|
|
<isNotNull property="status" prepend="and">a.status=#status#</isNotNull>
|
|
</dynamic>
|
|
order by a.asno,a.fyear desc
|
|
</select>
|
|
<select id="users.assign.newascode" parameterClass="int" resultClass="int">
|
|
select ifnull(max(b.ascode),0) + 1
|
|
from (select 1 col1) a
|
|
left outer join assign b on b.asno is not null
|
|
</select>
|
|
<select id="users.assign.check.ascode" parameterClass="hashtable" resultClass="assign">
|
|
select a.asno
|
|
from assign a
|
|
<dynamic prepend="where">
|
|
<isNotNull property="asnonot" prepend="and">a.asno <> #asnonot#</isNotNull>
|
|
<isNotNull property="ascode" prepend="and">a.ascode=#ascode#</isNotNull>
|
|
</dynamic>
|
|
</select>
|
|
<select id="users.assign.check.brno" parameterClass="hashtable" resultClass="assign">
|
|
select a.asno
|
|
from assign a
|
|
<dynamic prepend="where">
|
|
<isNotNull property="asnonot" prepend="and">a.asno <> #asnonot#</isNotNull>
|
|
<isNotNull property="brno" prepend="and">a.brno=#brno#</isNotNull>
|
|
</dynamic>
|
|
</select>
|
|
<insert id="users.assign.in" parameterClass="hashtable">
|
|
insert into assign (ascode,isjoin,joinyear,joinprice,asname,ceoname,brno,grno,btype,bkind,salesamount,homeurl,mcount,aday,astype,asctg,askey,post,address1,address2,fgnobno,fgnobank,joindate,exitdate,status,issite,subdomain,sitename,sitelogo,sitefooter,ismain,isdel,
|
|
eino,mname,mphone,taxemail,<include refid="sql.inc"></include>)
|
|
values (#ascode#,#isjoin#,#joinyear#,#joinprice#,#asname#,#ceoname#,#brno#,#grno#,#btype#,#bkind#,#salesamount#,#homeurl#,#mcount#,#aday#,#astype#,#asctg#,#askey#,#post#,#address1#,#address2#,#fgnobno#,#fgnobank#,#joindate#,#exitdate#,#status#,0,null,null,null,null,0,0,
|
|
#eino#,#mname#
|
|
,HEX(AES_ENCRYPT(#mphone#, <include refid="sql.digest"></include>))
|
|
,HEX(AES_ENCRYPT(#taxemail#, <include refid="sql.digest"></include>))
|
|
,<include refid="sql.inv"></include>);
|
|
<selectKey type="post" property="asno" resultClass="int">SELECT LAST_INSERT_ID()</selectKey>
|
|
</insert>
|
|
<update id="users.assign.up" parameterClass="hashtable">
|
|
update assign set <include refid="sql.up"></include>
|
|
<isNotNull property="saveflag">
|
|
,ascode=#ascode#,isjoin=#isjoin#,joinyear=#joinyear#,joinprice=#joinprice#,astype=#astype#,asctg=#asctg#,askey=#askey#,joindate=#joindate#,exitdate=#exitdate#,status=#status#
|
|
</isNotNull>
|
|
,asname=#asname#,ceoname=#ceoname#,brno =#brno#,grno =#grno#,btype =#btype#,bkind =#bkind#,salesamount=#salesamount#,homeurl=#homeurl#
|
|
,mcount=#mcount#,aday =#aday# ,post =#post#,address1=#address1#,address2=#address2#,fgnobno=#fgnobno#,fgnobank=#fgnobank#
|
|
,eino=#eino#,mname=#mname#
|
|
,mphone =case when #mphone# is not null then HEX(AES_ENCRYPT(#mphone#, <include refid="sql.digest"></include>)) else mphone end
|
|
,taxemail =case when #taxemail# is not null then HEX(AES_ENCRYPT(#taxemail#, <include refid="sql.digest"></include>)) else taxemail end
|
|
where asno=#asno#
|
|
</update>
|
|
<update id="users.assign.del" parameterClass="hashtable">
|
|
update assign set <include refid="sql.up"></include>
|
|
,isdel=1,brno=null
|
|
where asno=#asno#
|
|
</update>
|
|
<update id="users.assignman.in" parameterClass="hashtable">
|
|
insert into assignman (asno,mtype,jtype,depart,mname,position,telno,mobile,fax,email,post,address1,address2,isdel,<include refid="sql.inc"></include>)
|
|
values (#asno#,#mtype#,#jtype#,#depart#,#mname#,#position#
|
|
,HEX(AES_ENCRYPT(#telno#, <include refid="sql.digest"></include>))
|
|
,HEX(AES_ENCRYPT(#mobile#, <include refid="sql.digest"></include>))
|
|
,HEX(AES_ENCRYPT(#fax#, <include refid="sql.digest"></include>))
|
|
,HEX(AES_ENCRYPT(#email#, <include refid="sql.digest"></include>))
|
|
,#post#,#address1#,#address2#,0,<include refid="sql.inv"></include>)
|
|
</update>
|
|
<update id="users.assignman.up" parameterClass="hashtable">
|
|
update assignman set <include refid="sql.up"></include>
|
|
,mtype =#mtype#
|
|
,jtype =#jtype#
|
|
,depart =#depart#
|
|
,mname =#mname#
|
|
,position=#position#
|
|
,telno =HEX(AES_ENCRYPT(#telno#, <include refid="sql.digest"></include>))
|
|
,mobile =HEX(AES_ENCRYPT(#mobile#, <include refid="sql.digest"></include>))
|
|
,fax =HEX(AES_ENCRYPT(#fax#, <include refid="sql.digest"></include>))
|
|
,email =HEX(AES_ENCRYPT(#email#, <include refid="sql.digest"></include>))
|
|
,post =#post#
|
|
,address1=#address1#
|
|
,address2=#address2#
|
|
where asmno=#asmno#
|
|
</update>
|
|
<update id="users.assignman.del" parameterClass="hashtable">
|
|
update assignman set <include refid="sql.up"></include>
|
|
,isdel = 1
|
|
where asmno=#asmno#
|
|
</update>
|
|
<update id="users.assignfee.in" parameterClass="hashtable">
|
|
insert into assignfee (asno,fyear,fprice,fdate,fmemo,status,<include refid="sql.inc"></include>)
|
|
select #asno#,#fyear#,#fprice#,#fdate#,#fmemo#,#status#,<include refid="sql.inv"></include>
|
|
from (select 1 col1) a
|
|
left outer join assignfee b on b.asno=#asno# and b.fyear=#fyear#
|
|
where b.asno is null
|
|
</update>
|
|
<update id="users.assignfee.up" parameterClass="hashtable">
|
|
update assignfee set <include refid="sql.up"></include>
|
|
,fprice=#fprice#,fdate =#fdate#,fmemo =#fmemo#,status=#status#
|
|
where asno=#asno# and fyear=#fyear#
|
|
</update>
|
|
<update id="users.assignfee.del" parameterClass="hashtable">
|
|
delete from assignfee where asno=#asno# and fyear=#fyear#
|
|
</update>
|
|
<update id="users.assignsite.save" parameterClass="hashtable">
|
|
update assign set <include refid="sql.up"></include>,issite=#issite#,subdomain=#subdomain#,sitename=#sitename#
|
|
,siteip=#siteip#
|
|
,sitelogo=#sitelogo#,sitefooter=#sitefooter# where asno=#asno#
|
|
</update>
|
|
<select id="users.getlectbyusernos" parameterClass="string" resultClass="users.lect">
|
|
select a.userno,a.username
|
|
,a.isacceptemail
|
|
,CAST(AES_DECRYPT(UNHEX(a.email), <include refid="sql.digest"></include>) AS char) email
|
|
from users a
|
|
where a.userno in ($usernos$) and a.status=1
|
|
order by a.username
|
|
</select>
|
|
<select id="users.me" parameterClass="int" resultClass="users">
|
|
select userno,username
|
|
,CAST(AES_DECRYPT(UNHEX(email), <include refid="sql.digest"></include>) AS char) email
|
|
from users where userno=#userno#
|
|
</select>
|
|
<!--<update id="users.leave" parameterClass="hashtable">
|
|
update users set <include refid="sql.up"></include>
|
|
,status=99,username='탈퇴',email=null,userid=null,mobile=null,telno=null,userpno=null,bankno=null
|
|
where status<>99 <isNotNull property="usernos"> and userno in ($usernos$)</isNotNull>
|
|
</update>-->
|
|
<select id="users.userlogin" parameterClass="hashtable" resultClass="users">
|
|
select a.userid,a.userno,a.username,a.status,usertype,a.asno
|
|
,b.subdomain
|
|
from users a
|
|
left outer join assign b on b.asno=a.asno and b.issite=1 and b.isdel=0
|
|
<!--<isNotNull property="subdomain">
|
|
inner join assign b on b.asno=a.asno and b.subdomain=#subdomain#
|
|
</isNotNull>-->
|
|
where (userpass=#userpass# or #userpass# is null) and a.usertype=1 and a.status=1
|
|
<isNotNull property="userid">
|
|
and a.userid=#userid#
|
|
</isNotNull>
|
|
<isNotNull property="useridsns">
|
|
and a.snsid=#useridsns#
|
|
</isNotNull>
|
|
</select>
|
|
<update id="users.asno.save" parameterClass="hashtable">
|
|
update users set asno=#asno# where userno=#userno#
|
|
</update>
|
|
<select id="users.findme" parameterClass="hashtable" resultClass="users">
|
|
select a.userno,a.username
|
|
,a.userid
|
|
,CAST(AES_DECRYPT(UNHEX(a.mobile), <include refid="sql.digest"></include>) AS char) mobile
|
|
,CAST(AES_DECRYPT(UNHEX(a.email), <include refid="sql.digest"></include>) AS char) email
|
|
from users a
|
|
where a.usertype in (1,11) and a.status=1
|
|
<isNotNull property="email">
|
|
and a.email=HEX(AES_ENCRYPT(#email#, <include refid="sql.digest"></include>))
|
|
</isNotNull>
|
|
<isNotNull property="mobile">
|
|
and a.mobile=HEX(AES_ENCRYPT(#mobile#, <include refid="sql.digest"></include>))
|
|
</isNotNull>
|
|
</select>
|
|
<update id="users.pwcalltime" parameterClass="long">
|
|
update users set pwcalltime=<include refid="sql.now"></include>,pwcallno=#pwcallno#<!--floor(RAND() * (30000-1)+1)--> where userno=#userno#
|
|
</update>
|
|
<select id="users.pwuser" parameterClass="hashtable" resultClass="users">
|
|
select userno
|
|
,userid
|
|
,username
|
|
,usertype
|
|
,pwcallno
|
|
from users
|
|
where userno=#userno# and pwcallno=#pwcallno# and pwcalltime is not null and date_add(pwcalltime, interval 24 hour) > <include refid="sql.now"></include>
|
|
</select>
|
|
<update id="users.resetuser" parameterClass="hashtable">
|
|
update users set userpass=#userpass#, pwcalltime=null,pwcallno=null where userno=#userno# and pwcalltime is not null and pwcallno=#pwcallno# and date_add(pwcalltime, interval 24 hour) > <include refid="sql.now"></include>
|
|
</update>
|
|
<update id="users.usercheck" parameterClass="hashtable">
|
|
update usercheck a
|
|
inner join users b on b.userno=a.userno <isNotNull property="userpass">and b.userpass=#userpass#</isNotNull>
|
|
set a.checkkey=#checkkey#
|
|
where a.userno=#userno#;
|
|
|
|
insert into usercheck(userno,checkkey)
|
|
select a.userno,#checkkey#
|
|
from users a
|
|
left outer join usercheck b on b.userno=a.userno
|
|
where a.userno=#userno# <isNotNull property="userpass">and a.userpass=#userpass#</isNotNull> and b.userno is null
|
|
</update>
|
|
<select id="users.usercheckconfirm" parameterClass="hashtable" resultClass="int">
|
|
select ifnull(b.userno,0)
|
|
from (select 1 col1) a
|
|
left outer join usercheck b on b.userno=#userno# and b.checkkey=#checkkey#;
|
|
update usercheck set checkkey=0 where userno=#userno#
|
|
</select>
|
|
<update id="users.exit" parameterClass="hashtable">
|
|
update users set <include refid="sql.up"></include>
|
|
,exitreason=#exitreason#
|
|
,username='탈퇴회원',email=null,mobile=null,telno=null,birthday=null,vssn=null,di=null,ci=null,userpno=null,bankno=null,post=null,address1=null,address2=null,status=99
|
|
where userno=#userno#
|
|
</update>
|
|
<update id="users.remotelogin.set" parameterClass="hashtable">
|
|
update users a
|
|
inner join assign b on b.asno=a.asno and b.siteip like concat('%',#siteip#,'%')
|
|
set a.remotekey=#remotekey#
|
|
where a.userid=#userid# and a.status=1
|
|
</update>
|
|
<select id="users.remotelogin" parameterClass="hashtable" resultClass="users">
|
|
select a.userno from users a where a.userid=#userid# and a.status=1 and a.remotekey=#remotekey#;
|
|
update users set remotekey=null where userid=#userid#
|
|
</select>
|
|
<select id="users.remoteloginnoauth" parameterClass="hashtable" resultClass="users">
|
|
select a.userno,b.subdomain
|
|
from users a
|
|
left outer join assign b on b.asno=a.asno
|
|
where a.userid=#userid# and a.status=1
|
|
</select>
|
|
<select id="users.users.foroffby" parameterClass="string" resultClass="users">
|
|
select a.userno,a.username,a.isassignuser,a.kfcfyear,a.edus
|
|
,CAST(AES_DECRYPT(UNHEX(a.email), <include refid="sql.digest"></include>) AS char) email
|
|
,CAST(AES_DECRYPT(UNHEX(a.telno), <include refid="sql.digest"></include>) AS char) telno
|
|
,cc.cname ccpositionname
|
|
from users a
|
|
left outer join comcode cc on cc.ccode=a.ccposition
|
|
where a.userno in ($usernos$)
|
|
</select>
|
|
<select id="users.users.assign" parameterClass="hashtable" resultClass="assign">
|
|
select b.asno,b.asname,b.brno
|
|
,b.ceoname,b.post,b.address1,b.address2
|
|
,b.btype,b.bkind,b.eino,b.mname
|
|
,CAST(AES_DECRYPT(UNHEX(b.mphone), <include refid="sql.digest"></include>) AS char) mphone
|
|
,CAST(AES_DECRYPT(UNHEX(b.taxemail), <include refid="sql.digest"></include>) AS char) taxemail
|
|
,b.fgnobno
|
|
,b.isjoin,b.ascode,b.astype,b.asctg,b.joindate,b.status
|
|
,c1.cname astypename,c2.cname asctgname
|
|
from users a
|
|
inner join assign b on b.asno = a.asno
|
|
left outer join comcode c1 on c1.ccode=b.astype
|
|
left outer join comcode c2 on c2.ccode=b.asctg
|
|
where a.status=1 <!--and b.status=1--> and a.userno = #userno#
|
|
</select>
|
|
<select id="users.check.snsid" parameterClass="hashtable" resultClass="users">
|
|
select
|
|
a.userno,a.usertype,a.jointype,a.snsid,a.userkind,a.userid,a.userpass,a.username,a.usernameeng,a.gender,a.birthday,a.email,a.isacceptemail,a.mobile,a.isacceptmobile
|
|
,a.telno,a.asno,a.pasname,a.depart,a.ccposition,a.ccpositionetc,a.fgnoprofile,a.ccjobs,a.userpno,a.bankname,a.bankno,a.post,a.address1,a.address2,a.introhtml,a.status,a.exitreason
|
|
,a.logintime,a.loginkey,a.send335time,a.pwcalltime,a.pwcallno,a.eastereggkey,a.eetime,a.kfcfyear,a.isassignuser,a.uduty,a.slevel,a.edus,a.remotekey,a.vssn,a.di,a.ci
|
|
from users a
|
|
where a.snsid=#snsid# and a.jointype=#jointype#
|
|
</select>
|
|
|
|
<update id="users.snslink.up" parameterClass="hashtable">
|
|
update users set <include refid="sql.up"></include>
|
|
,snsid=#snsid# ,jointype=#jointype#
|
|
where userno=#userno#
|
|
</update>
|
|
|
|
<select id="users.councels" parameterClass="hashtable" resultClass="councel">
|
|
select a.bno,a.qtext,a.atext
|
|
,a.bldgcat
|
|
,b.cname bldgcatname
|
|
,a.cdt,c.username coname,c.userid coid
|
|
,row_number() over(order by a.cdt desc) rno
|
|
,count(a.cno) over() pagetotalcount
|
|
from councel a
|
|
inner join users c on c.userno = a.cno
|
|
left outer join comcode b on b.ccode = a.bldgcat
|
|
where a.userno = #userno# and a.isdel = 0
|
|
</select>
|
|
|
|
<insert id="councel.in" parameterClass="hashtable">
|
|
insert into councel(userno,bldgcat,qtext,atext,<include refid="sql.inc"></include>)
|
|
values (#userno#,#bldgcat#,#qtext#,#atext#,<include refid="sql.inv"></include>);
|
|
<selectKey type="post" property="bno" resultClass="int">SELECT LAST_INSERT_ID()</selectKey>
|
|
</insert>
|
|
|
|
<update id="councel.up" parameterClass="hashtable">
|
|
update councel set <include refid="sql.up"></include>
|
|
,bldgcat = #bldgcat#
|
|
,qtext = #qtext#
|
|
,atext = #atext#
|
|
where bno=#bno#
|
|
</update>
|
|
|
|
<update id="councel.del" parameterClass="hashtable">
|
|
update councel set <include refid="sql.up"></include>
|
|
,isdel = 1
|
|
where bno = #bno#
|
|
</update>
|
|
</statements>
|
|
</sqlMap>
|
|
|
|
|