102 lines
4.6 KiB
XML
102 lines
4.6 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>
|
|
<!--<typeAlias alias="users.lect" type="NP.Model.Lect, NP.Model" />-->
|
|
</alias>
|
|
|
|
<cacheModels>
|
|
<cacheModel id="siteCache" implementation="LRU" >
|
|
<flushInterval hours="1" />
|
|
<property name="CacheSize" value="1000" />
|
|
</cacheModel>
|
|
</cacheModels>
|
|
|
|
<!--<parametermaps>
|
|
</parametermaps>-->
|
|
|
|
<resultMaps>
|
|
</resultMaps>
|
|
|
|
<statements>
|
|
<select id="site.main" parameterClass="hashtable" resultClass="data">
|
|
select *
|
|
from (
|
|
select 0 dtype
|
|
,a.cmno intval,a.isrefund intval2
|
|
,0 longval
|
|
,a.cname strval,b.cgname strval2,a.kname strval3,null strval4,null strval5,null strval6
|
|
,a.rstime time,a.retime time2,a.sstime time3,a.setime time4
|
|
from cm a
|
|
inner join cg b on b.cgno=a.cgno
|
|
inner join cg b2 on b2.cgno=b.pcgno and b2.cgcode=#offcode#
|
|
inner join cm c on c.cmno=a.pcmno
|
|
where a.ismaster=0 and a.rstime < now() and a.retime >= DATE_FORMAT(now(), '%Y%m%d') and a.isuse=1 and a.isdel=0
|
|
order by a.retime asc
|
|
limit 4
|
|
) a
|
|
union all
|
|
select *
|
|
from (
|
|
select a.dtype,a.intval,a.intval2
|
|
,a.longval
|
|
,a.strval,a.strval2,a.strval3,a.strval4,ifnull(a.strval5,d.fileurl) strval5,a.strval6
|
|
,a.time,a.time2,a.time3,a.time4
|
|
from (
|
|
select 1 dtype
|
|
,a.cmno intval,a.isrefund intval2
|
|
,0 longval
|
|
,a.cname strval,b.cgname strval2,c.cname strval3,concat('/', e.ccode, '/', f.srcp) strval4,ef.fileurl strval5,b.cgcode strval6
|
|
,a.rstime time,a.retime time2,a.sstime time3,a.setime time4
|
|
from cm a
|
|
inner join cg b on b.cgno=a.cgno
|
|
inner join cg b2 on b2.cgno=b.pcgno and b2.cgcode=#oncode#
|
|
inner join cm c on c.cmno=a.pcmno
|
|
left outer join cminning d on d.cmno=a.cmno and d.istaste=1
|
|
left outer join ct e on e.ctno=d.ctno <!--and e.ctype=0-->
|
|
left outer join fileinfo ef on ef.fgno=e.fgnothumb and ef.isdel=0
|
|
left outer join ctpage f on f.ctno=e.ctno and f.pseq=1
|
|
where a.ismaster=0 and a.rstime < now() and a.retime >= DATE_FORMAT(now(), '%Y%m%d') and a.cshape=0 and a.isuse=1 and a.isdel=0
|
|
order by a.retime asc
|
|
limit 4
|
|
) a
|
|
left outer join cminning b on a.strval5 is null and b.cmno=a.intval and b.iseq=1
|
|
left outer join ct c on a.strval5 is null and c.ctno=b.ctno
|
|
left outer join fileinfo d on a.strval5 is null and d.fgno=c.fgnothumb and d.isdel=0
|
|
) a
|
|
union all
|
|
select *
|
|
from (
|
|
select 2 dtype
|
|
,0 intval,0 intval2
|
|
,b.bno longval
|
|
,c.opname strval,b.subject strval2,null strval3,null strval4,null strval5,null strval6
|
|
,null time,null time2,null time3,null time4
|
|
from boardmaster a
|
|
inner join board b on b.bmno=a.bmno and b.pbno is null and b.isdel=0 and b.issecr=0 and b.isopen=1
|
|
left outer join boardmasteropening c on c.opno=b.opno
|
|
where a.bmcode='homenotice'
|
|
order by b.cdt desc
|
|
limit 2
|
|
) a
|
|
union all
|
|
select *
|
|
from (
|
|
select 3 dtype
|
|
,0 intval,0 intval2
|
|
,b.bno longval
|
|
,c.opname strval,b.subject strval2,null strval3,null strval4,null strval5,null strval6
|
|
,null time,null time2,null time3,null time4
|
|
from boardmaster a
|
|
inner join board b on b.bmno=a.bmno and b.pbno is null and b.isdel=0 and b.issecr=0 and b.isopen=1
|
|
left outer join boardmasteropening c on c.opno=b.opno
|
|
where a.bmcode='homefaq'
|
|
order by b.cdt desc
|
|
limit 2
|
|
) a
|
|
</select>
|
|
</statements>
|
|
</sqlMap>
|
|
|
|
|