PageSettingMapper.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="cn.ubitech.ttc.dao.PageSettingMapper">
  4. <!-- 开启二级缓存 -->
  5. <cache type="org.mybatis.caches.ehcache.EhcacheCache">
  6. <property name="timeToIdleSeconds" value="120"/>
  7. <property name="timeToLiveSeconds" value="180"/>
  8. <property name="maxEntriesLocalHeap" value="1000"/>
  9. <property name="maxEntriesLocalDisk" value="10000000"/>
  10. <property name="memoryStoreEvictionPolicy" value="LRU"/>
  11. </cache>
  12. <select id="getInfoUnitList" resultType="cn.ubitech.ttc.model.information.InfoUnitModel">
  13. select
  14. p.*,
  15. t.tcname,
  16. t.issetup
  17. from page_setting p, typeentry t
  18. where p.pagecode = #{pagecode} and p.restype = #{restype} and p.node = #{node}
  19. and p.resinnertype = #{resinnertype} and p.isenabled = 1 and p.rescode = t.itemvalue order by p.sort
  20. </select>
  21. <select id="getResInfoUnitList" resultType="cn.ubitech.ttc.model.information.InfoUnitModel">
  22. select
  23. p.*,
  24. t.tcname,
  25. t.issetup
  26. from page_setting p, typeentry t
  27. where p.pagecode = #{pagecode} and p.restype = #{restype} and p.node = #{node}
  28. and p.pagetype = #{pagetype} and p.resinnertype = #{resinnertype} and p.isenabled = 1 and p.rescode = t.itemvalue order by p.sort
  29. </select>
  30. <select id="getSubInfoUnitList" resultType="cn.ubitech.ttc.model.information.InfoUnitModel">
  31. select
  32. p.*,
  33. t.tcname,
  34. t.issetup
  35. from page_setting p, typeentry t
  36. where p.parentpagecode = #{parentpagecode} and p.restype = #{restype} and p.node = #{node}
  37. and p.resinnertype = #{resinnertype} and p.isenabled = 1 and p.rescode = t.itemvalue order by p.sort
  38. </select>
  39. <select id="getPageSettingSectionList" resultType="cn.ubitech.ttc.entity.PageSetting">
  40. SELECT *
  41. FROM page_setting ps
  42. WHERE ps.pagecode = #{pagecode} AND ps.restype = ps.rescode and ps.isenabled = 1 and ps.node = #{node}
  43. order by ps.sort
  44. </select>
  45. <select id="getPageSettingSubSectoinList" resultType="cn.ubitech.ttc.entity.PageSetting">
  46. SELECT *
  47. FROM page_setting ps
  48. WHERE ps.parentpagecode = #{pagecode} AND ps.restype = ps.rescode and ps.isenabled = 1 and ps.node = #{node}
  49. order by ps.sort
  50. </select>
  51. <select id="getPageSettingSubSectoinListByParenttype" resultType="cn.ubitech.ttc.entity.PageSetting">
  52. SELECT *
  53. FROM page_setting ps
  54. WHERE ps.parentpagecode = #{pagecode} AND ps.restype = ps.rescode and ps.isenabled = 1
  55. and ps.node = #{node} and ps.resparenttype = #{parenttype}
  56. order by ps.sort
  57. </select>
  58. <select id="getSubPageSetting" resultType="cn.ubitech.ttc.entity.PageSetting">
  59. SELECT
  60. *
  61. FROM page_setting ps
  62. WHERE ps.node = #{node}
  63. AND ps.parentpagecode = #{pagecode}
  64. AND ps.restype = #{restype}
  65. AND ps.resinnertype = #{resinnertype}
  66. AND ps.rescode = #{rescode}
  67. and ps.isenabled = 1
  68. </select>
  69. <select id="getResSubPageSetting" resultType="cn.ubitech.ttc.entity.PageSetting">
  70. SELECT
  71. *
  72. FROM page_setting ps
  73. WHERE ps.node = #{node}
  74. AND ps.parentpagecode = #{pagecode}
  75. AND ps.restype = #{restype}
  76. AND ps.pagetype = #{pagetype}
  77. AND ps.resinnertype = #{resinnertype}
  78. AND ps.rescode = #{rescode}
  79. and ps.isenabled = 1
  80. </select>
  81. <select id="getByRescodeEqRestype" resultType="cn.ubitech.ttc.entity.PageSetting"
  82. parameterType="cn.ubitech.ttc.entity.PageSetting">
  83. select *
  84. FROM page_setting
  85. WHERE restype=rescode
  86. <include refid="getField"/>
  87. </select>
  88. <sql id="getField">
  89. <if test="pagecode !=null ">
  90. AND pagecode=#{pagecode}
  91. </if>
  92. <if test="node !=null ">
  93. AND node=#{node}
  94. </if>
  95. <if test="restype !=null">
  96. AND restype=#{restype}
  97. </if>
  98. <if test="resinnertype !=null">
  99. AND resinnertype=#{resinnertype}
  100. </if>
  101. </sql>
  102. <select id="selectDistinctList" resultType="java.lang.Long">
  103. select distinct pagecode
  104. from page_setting
  105. where parentpagecode=#{parentpagecode}
  106. <if test="node !=null ">
  107. and node=#{node}
  108. </if>
  109. </select>
  110. <select id="selectFirstIndexList" resultType="cn.ubitech.ttc.entity.PageSetting">
  111. select *
  112. from page_setting
  113. where pagecode=#{pagecode}
  114. and pagetype=#{pagetype}
  115. and node=#{node}
  116. and restype = rescode
  117. order by sort asc
  118. </select>
  119. <select id="selectSecondIndexList" resultType="cn.ubitech.ttc.entity.PageSetting">
  120. select *
  121. from page_setting
  122. where pagecode=#{pagecode}
  123. and pagetype=#{pagetype}
  124. and node=#{node}
  125. and restype=#{restype}
  126. and resinnertype = #{resinnertype}
  127. and restype != rescode
  128. order by sort asc
  129. </select>
  130. <select id="selectFirstTitleList" resultType="cn.ubitech.ttc.entity.PageSetting">
  131. select *
  132. from page_setting
  133. where pagetype= #{pagetype}
  134. and
  135. rescode = restype
  136. and node = #{node}
  137. </select>
  138. <select id="selectSecondTitleList" resultType="cn.ubitech.ttc.entity.PageSetting">
  139. select *
  140. from page_setting
  141. where pagetype= #{pagetype}
  142. and
  143. rescode != restype
  144. and restype = #{restype}
  145. and title != "主键"
  146. and title != "是否有效"
  147. and title != "图片"
  148. and node = #{node}
  149. </select>
  150. </mapper>