CmsPageMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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.backendsys.mapper.Cms.CmsPageMapper">-->
  4. <!-- -->
  5. <!-- <sql id="includePage">-->
  6. <!-- p.id id,-->
  7. <!-- p.id page_id,-->
  8. <!-- pt.title title,-->
  9. <!-- COALESCE(pt.description, '') description,-->
  10. <!-- p.create_time create_time,-->
  11. <!-- p.update_time update_time-->
  12. <!-- </sql>-->
  13. <!-- <sql id="includePageDetail">-->
  14. <!-- p.id id,-->
  15. <!-- p.id page_id,-->
  16. <!-- p.create_time create_time,-->
  17. <!-- p.update_time update_time-->
  18. <!-- </sql>-->
  19. <!-- -->
  20. <!-- <sql id="includePageTranslation">-->
  21. <!-- id,-->
  22. <!-- page_id,-->
  23. <!-- language,-->
  24. <!-- title,-->
  25. <!-- description,-->
  26. <!-- content-->
  27. <!-- </sql>-->
  28. <!-- <resultMap id="resultMapPage" type="java.util.LinkedHashMap">-->
  29. <!-- <id property="id" column="id" jdbcType="BIGINT" />-->
  30. <!-- <result property="page_id" column="page_id" javaType="java.lang.Long"/>-->
  31. <!-- <result property="title" column="title" />-->
  32. <!-- <result property="description" column="description" />-->
  33. <!-- <result property="create_time" column="create_time" />-->
  34. <!-- <result property="update_time" column="update_time" />-->
  35. <!-- </resultMap>-->
  36. <!-- <resultMap id="resultMapPageDetail" type="java.util.LinkedHashMap">-->
  37. <!-- <id property="id" column="id" jdbcType="BIGINT" />-->
  38. <!-- <result property="page_id" column="page_id" javaType="java.lang.Long"/>-->
  39. <!-- <result property="create_time" column="create_time" />-->
  40. <!-- <result property="update_time" column="update_time" />-->
  41. <!-- <collection property="translations" javaType="java.util.List"-->
  42. <!-- select="queryTranslationsById" column="id">-->
  43. <!-- <id property="id" column="id" />-->
  44. <!-- <result property="title" column="title" />-->
  45. <!-- <result property="content" column="content" />-->
  46. <!-- <result property="description" column="description" />-->
  47. <!-- </collection>-->
  48. <!-- </resultMap>-->
  49. <!-- <sql id="leftJoinTranslations">-->
  50. <!-- LEFT JOIN cms_page_translations pt ON p.id = pt.page_id-->
  51. <!-- </sql>-->
  52. <!-- &lt;!&ndash; 查 列表 &ndash;&gt;-->
  53. <!-- <select id="queryPageList" resultMap="resultMapPage">-->
  54. <!-- SELECT-->
  55. <!-- <include refid="includePage" />-->
  56. <!-- FROM cms_article p-->
  57. <!-- <include refid="leftJoinTranslations" />-->
  58. <!-- WHERE pt.language = #{lang}-->
  59. <!-- </select>-->
  60. <!-- &lt;!&ndash; 查 详情 (带翻译 Array) (二次查询) &ndash;&gt;-->
  61. <!-- <select id="queryPageDetail" resultMap="resultMapPageDetail">-->
  62. <!-- SELECT <include refid="includePageDetail" />-->
  63. <!-- FROM cms_page p-->
  64. <!-- WHERE p.page_sign = #{page_sign}-->
  65. <!-- </select>-->
  66. <!-- &lt;!&ndash; 查 翻译集合 (子查询) &ndash;&gt;-->
  67. <!-- <select id="queryTranslationsById" resultType="java.util.LinkedHashMap">-->
  68. <!-- SELECT <include refid="includePageTranslation" />-->
  69. <!-- FROM cms_page_translations-->
  70. <!-- WHERE page_id = #{id}-->
  71. <!-- </select>-->
  72. <!-- &lt;!&ndash; 查 详情 (公共) (带翻译 Object) (关联查询) &ndash;&gt;-->
  73. <!-- <select id="queryPageDetailPublic" resultMap="resultMapPage">-->
  74. <!-- SELECT <include refid="includePage" />, content-->
  75. <!-- FROM cms_page p-->
  76. <!-- <include refid="leftJoinTranslations" />-->
  77. <!-- WHERE p.page_sign = #{page_sign} AND pt.language = #{lang}-->
  78. <!-- </select>-->
  79. <!-- -->
  80. <!-- &lt;!&ndash; 改 &ndash;&gt;-->
  81. <!-- <update id="updatePage" parameterType="com.backendsys.entity.Cms.CmsPageDTO"-->
  82. <!-- useGeneratedKeys="true" keyProperty="page_id">-->
  83. <!-- <foreach collection="translations" item="translation" separator=";">-->
  84. <!-- UPDATE cms_page_translations-->
  85. <!-- <set>-->
  86. <!-- title = #{translation.title},-->
  87. <!-- content = #{translation.content},-->
  88. <!-- <if test="translation.description != null and translation.description != ''">-->
  89. <!-- description = #{translation.description}-->
  90. <!-- </if>-->
  91. <!-- </set>-->
  92. <!-- WHERE page_sign = ${page_sign} AND language = #{translation.language}-->
  93. <!-- </foreach>-->
  94. <!-- </update>-->
  95. <!--</mapper>-->