SinglePageMapper.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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="com.caimei.www.mapper.SinglePageDao">
  4. <select id="getFreePageById" resultType="com.caimei.www.pojo.page.PageContent">
  5. select a.id, a.type, a.title, a.keywords, a.description, f.content
  6. from cm_page a
  7. left join cm_page_freedom f on a.id=f.pageId
  8. where a.type=4 and a.enabledStatus=1 and f.type=1
  9. and a.id=#{id}
  10. </select>
  11. <select id="getTopicPageById" resultType="com.caimei.www.pojo.page.PageContent">
  12. select a.id, a.type, a.title, a.keywords, a.description, a.headImage as image, a.headText as content
  13. from cm_page a
  14. where a.type=1 and a.enabledStatus=1
  15. and a.id=#{id}
  16. </select>
  17. <select id="getLivePageData" resultType="com.caimei.www.pojo.page.PageContent">
  18. select a.id, a.type, a.title, a.keywords, a.description, a.headImage as image, a.headText as content
  19. from cm_page a
  20. where a.id=1 and a.type=3 and a.enabledStatus=1
  21. </select>
  22. <select id="getFloorByPageId" resultType="com.caimei.www.pojo.page.PageFloor">
  23. select id, pageId as type, title, link
  24. from cm_page_centre
  25. where pageId=#{id}
  26. and enabledStatus=1
  27. order by sort desc,createDate desc
  28. </select>
  29. <select id="getDataByFloorId" resultType="com.caimei.www.pojo.page.ImageLink">
  30. select a.id as id,
  31. a.title as title,
  32. a.link as link,
  33. a.image as image
  34. from cm_page_image a
  35. right join cm_page_centre_image b on b.imageId=a.id
  36. where b.centreId=#{floorId} and a.enabledStatus=1
  37. order by a.sort desc,a.createDate desc
  38. </select>
  39. <select id="getLiveTeachers" resultType="com.caimei.www.pojo.page.ImageLink">
  40. select a.id as id,
  41. a.title as title,
  42. a.link as link,
  43. a.image as image
  44. from cm_page_image a
  45. where a.type=3 and a.enabledStatus=1
  46. order by a.sort desc,a.createDate desc
  47. </select>
  48. <select id="getHelpPageById" resultType="com.caimei.www.pojo.page.PageContent">
  49. select
  50. helpPageID as id,
  51. helpPageTypeID as type,
  52. title,
  53. contentTxt as description,
  54. content
  55. from helppage
  56. where helpPageID=#{id}
  57. and validFlag=1 and showFlag=1
  58. </select>
  59. <select id="getMaxSuggestionId" resultType="java.lang.Integer">
  60. select MAX(suggestionID) from suggestion
  61. </select>
  62. <insert id="suggestionSave" parameterType="com.caimei.www.pojo.save.Suggestion">
  63. insert into suggestion
  64. (suggestionID, suggestionTypeID, userID, title, content, linkMan, mobile, addTime)
  65. values (#{suggestionID,jdbcType=INTEGER},
  66. #{suggestionTypeID,jdbcType=INTEGER},
  67. #{userID,jdbcType=INTEGER},
  68. #{title,jdbcType=VARCHAR},
  69. #{content,jdbcType=VARCHAR},
  70. #{linkMan,jdbcType=VARCHAR},
  71. #{mobile,jdbcType=VARCHAR},
  72. #{addTime,jdbcType=VARCHAR})
  73. </insert>
  74. <select id="findMobileContent" resultType="string">
  75. SELECT content FROM cm_page_freedom WHERE pageId = #{id} AND type = 2
  76. </select>
  77. <select id="getInstrumentPageIdById" resultType="java.lang.Integer">
  78. select id from cm_page a
  79. where
  80. a.type=5 and a.enabledStatus=1
  81. and a.id=#{id}
  82. </select>
  83. <select id="getPageTitleById" resultType="java.lang.String">
  84. select title from cm_page where id=#{id}
  85. </select>
  86. <select id="getActivityPageIdById" resultType="java.lang.Integer">
  87. select id from cm_page a
  88. where
  89. a.type=6 and a.enabledStatus=1
  90. and a.id=#{id}
  91. </select>
  92. <select id="getPageTypeSort" resultType="java.lang.Integer">
  93. select typeSort from cm_page
  94. where id = #{pageId} and enabledStatus = '1'
  95. </select>
  96. <select id="getBeautyPageIdById" resultType="java.lang.Integer">
  97. select id from cm_page a
  98. where
  99. a.type=7 and a.enabledStatus=1
  100. and a.id=#{id}
  101. </select>
  102. </mapper>