123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="cn.ubitech.ttc.dao.PageSettingMapper">
- <!-- 开启二级缓存 -->
- <cache type="org.mybatis.caches.ehcache.EhcacheCache">
- <property name="timeToIdleSeconds" value="120"/>
- <property name="timeToLiveSeconds" value="180"/>
- <property name="maxEntriesLocalHeap" value="1000"/>
- <property name="maxEntriesLocalDisk" value="10000000"/>
- <property name="memoryStoreEvictionPolicy" value="LRU"/>
- </cache>
- <select id="getInfoUnitList" resultType="cn.ubitech.ttc.model.information.InfoUnitModel">
- select
- p.*,
- t.tcname,
- t.issetup
- from page_setting p, typeentry t
- where p.pagecode = #{pagecode} and p.restype = #{restype} and p.node = #{node}
- and p.resinnertype = #{resinnertype} and p.isenabled = 1 and p.rescode = t.itemvalue order by p.sort
- </select>
- <select id="getResInfoUnitList" resultType="cn.ubitech.ttc.model.information.InfoUnitModel">
- select
- p.*,
- t.tcname,
- t.issetup
- from page_setting p, typeentry t
- where p.pagecode = #{pagecode} and p.restype = #{restype} and p.node = #{node}
- and p.pagetype = #{pagetype} and p.resinnertype = #{resinnertype} and p.isenabled = 1 and p.rescode = t.itemvalue order by p.sort
- </select>
- <select id="getSubInfoUnitList" resultType="cn.ubitech.ttc.model.information.InfoUnitModel">
- select
- p.*,
- t.tcname,
- t.issetup
- from page_setting p, typeentry t
- where p.parentpagecode = #{parentpagecode} and p.restype = #{restype} and p.node = #{node}
- and p.resinnertype = #{resinnertype} and p.isenabled = 1 and p.rescode = t.itemvalue order by p.sort
- </select>
- <select id="getPageSettingSectionList" resultType="cn.ubitech.ttc.entity.PageSetting">
- SELECT *
- FROM page_setting ps
- WHERE ps.pagecode = #{pagecode} AND ps.restype = ps.rescode and ps.isenabled = 1 and ps.node = #{node}
- order by ps.sort
- </select>
- <select id="getPageSettingSubSectoinList" resultType="cn.ubitech.ttc.entity.PageSetting">
- SELECT *
- FROM page_setting ps
- WHERE ps.parentpagecode = #{pagecode} AND ps.restype = ps.rescode and ps.isenabled = 1 and ps.node = #{node}
- order by ps.sort
- </select>
- <select id="getPageSettingSubSectoinListByParenttype" resultType="cn.ubitech.ttc.entity.PageSetting">
- SELECT *
- FROM page_setting ps
- WHERE ps.parentpagecode = #{pagecode} AND ps.restype = ps.rescode and ps.isenabled = 1
- and ps.node = #{node} and ps.resparenttype = #{parenttype}
- order by ps.sort
- </select>
- <select id="getSubPageSetting" resultType="cn.ubitech.ttc.entity.PageSetting">
- SELECT
- *
- FROM page_setting ps
- WHERE ps.node = #{node}
- AND ps.parentpagecode = #{pagecode}
- AND ps.restype = #{restype}
- AND ps.resinnertype = #{resinnertype}
- AND ps.rescode = #{rescode}
- and ps.isenabled = 1
- </select>
- <select id="getResSubPageSetting" resultType="cn.ubitech.ttc.entity.PageSetting">
- SELECT
- *
- FROM page_setting ps
- WHERE ps.node = #{node}
- AND ps.parentpagecode = #{pagecode}
- AND ps.restype = #{restype}
- AND ps.pagetype = #{pagetype}
- AND ps.resinnertype = #{resinnertype}
- AND ps.rescode = #{rescode}
- and ps.isenabled = 1
- </select>
- <select id="getByRescodeEqRestype" resultType="cn.ubitech.ttc.entity.PageSetting"
- parameterType="cn.ubitech.ttc.entity.PageSetting">
- select *
- FROM page_setting
- WHERE restype=rescode
- <include refid="getField"/>
- </select>
- <sql id="getField">
- <if test="pagecode !=null ">
- AND pagecode=#{pagecode}
- </if>
- <if test="node !=null ">
- AND node=#{node}
- </if>
- <if test="restype !=null">
- AND restype=#{restype}
- </if>
- <if test="resinnertype !=null">
- AND resinnertype=#{resinnertype}
- </if>
- </sql>
- <select id="selectDistinctList" resultType="java.lang.Long">
- select distinct pagecode
- from page_setting
- where parentpagecode=#{parentpagecode}
- <if test="node !=null ">
- and node=#{node}
- </if>
- </select>
- <select id="selectFirstIndexList" resultType="cn.ubitech.ttc.entity.PageSetting">
- select *
- from page_setting
- where pagecode=#{pagecode}
- and pagetype=#{pagetype}
- and node=#{node}
- and restype = rescode
- order by sort asc
- </select>
- <select id="selectSecondIndexList" resultType="cn.ubitech.ttc.entity.PageSetting">
- select *
- from page_setting
- where pagecode=#{pagecode}
- and pagetype=#{pagetype}
- and node=#{node}
- and restype=#{restype}
- and resinnertype = #{resinnertype}
- and restype != rescode
- order by sort asc
- </select>
- <select id="selectFirstTitleList" resultType="cn.ubitech.ttc.entity.PageSetting">
- select *
- from page_setting
- where pagetype= #{pagetype}
- and
- rescode = restype
- and node = #{node}
- </select>
- <select id="selectSecondTitleList" resultType="cn.ubitech.ttc.entity.PageSetting">
- select *
- from page_setting
- where pagetype= #{pagetype}
- and
- rescode != restype
- and restype = #{restype}
- and title != "主键"
- and title != "是否有效"
- and title != "图片"
- and node = #{node}
- </select>
- </mapper>
|