PortalManageMapper.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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="jnpf.base.mapper.PortalManageMapper">
  4. <sql id="selectPages">
  5. SELECT
  6. <!-- 门户管理表 -->
  7. bpm.f_id id,
  8. bpm.f_enabled_mark enabledMark,
  9. bpm.f_platform platform,
  10. bpm.f_description description,
  11. bpm.F_Tenant_Id tenantId,
  12. bpm.f_sort_code sortCode,
  13. bpm.f_system_id systemId,
  14. bpm.f_portal_id portalId,
  15. bpm.f_creator_time creatorTime,
  16. bpm.f_last_modify_time lastModifyTime,
  17. <!-- 门户表 -->
  18. bp.f_category categoryId,
  19. bp.f_full_name portalName,
  20. bd.f_full_name categoryName,
  21. <!-- 用户表 -->
  22. us.F_Real_Name createUserName,
  23. us.F_Account createUserAccount,
  24. us2.F_Real_Name modifyUserName,
  25. us2.F_Account modifyUserAccount
  26. FROM
  27. base_portal_manage bpm
  28. LEFT JOIN
  29. base_portal bp
  30. ON
  31. bpm.f_portal_id = bp.f_id
  32. LEFT JOIN
  33. base_user us
  34. ON
  35. bpm.F_Creator_User_Id = us.f_id
  36. LEFT JOIN
  37. base_user us2
  38. ON
  39. bpm.F_Last_Modify_User_Id = us2.f_id
  40. LEFT JOIN
  41. base_dictionary_data bd
  42. ON bp.f_category = bd.f_id
  43. WHERE 1 = 1
  44. <if test="pmPage.keyword != null and pmPage.keyword != ''">
  45. AND (bp.f_full_name LIKE #{pmPage.keyword} OR bpm.f_description LIKE #{pmPage.keyword})
  46. </if>
  47. <if test="pmPage.category != null and pmPage.category != ''">
  48. AND
  49. bp.f_category = #{pmPage.category}
  50. </if>
  51. <if test="pmPage.enabledMark != null">
  52. AND
  53. bpm.f_enabled_mark = #{pmPage.enabledMark}
  54. <!-- AND bp.f_enabled_mark = #{pmPage.enabledMark} -->
  55. </if>
  56. <if test="pmPage.platform != null and pmPage.platform != ''">
  57. AND
  58. bpm.f_platform LIKE #{pmPage.platform}
  59. </if>
  60. <if test="pmPage.systemId != null and pmPage.systemId != ''">
  61. AND
  62. bpm.f_system_id = #{pmPage.systemId}
  63. </if>
  64. <if test="pmPage.state != null and pmPage.state != ''">
  65. AND
  66. bp.F_state != #{pmPage.state}
  67. </if>
  68. </sql>
  69. <select id="selectPortalManageDoPage" resultType="jnpf.base.model.portalManage.PortalManagePageDO" parameterType="jnpf.base.model.portalManage.PortalManagePage">
  70. SELECT
  71. *
  72. FROM (<include refid="selectPages"></include>) TempTable
  73. ORDER BY
  74. sortCode ASC,
  75. creatorTime DESC
  76. </select>
  77. <select id="selectPortalManageDoList" resultType="jnpf.base.model.portalManage.PortalManagePageDO" parameterType="jnpf.base.model.portalManage.PortalManagePage">
  78. SELECT
  79. *
  80. FROM (<include refid="selectPages"></include>) TempTable
  81. ORDER BY
  82. sortCode ASC,
  83. creatorTime DESC
  84. </select>
  85. <select id="selectPortalBySystemIds" resultType="jnpf.base.model.portalManage.PortalManagePageDO" parameterType="java.lang.String">
  86. SELECT
  87. bpm.f_id id,
  88. bpm.f_enabled_mark enabledMark,
  89. bpm.f_platform platform,
  90. bpm.f_description description,
  91. bpm.f_sort_code sortCode,
  92. bpm.f_system_id systemId,
  93. bpm.f_portal_id portalId,
  94. bpm.f_creator_time creatorTime,
  95. bpm.f_last_modify_time lastModifyTime,
  96. bp.f_category categoryId,
  97. bp.f_full_name portalName,
  98. bd.f_full_name categoryName
  99. FROM
  100. base_portal bp
  101. LEFT JOIN base_portal_manage bpm ON bpm.f_portal_id = bp.f_id
  102. LEFT JOIN base_dictionary_data bd ON bp.f_category = bd.f_id
  103. WHERE bpm.f_system_id IN
  104. <foreach collection="systemIds"
  105. item="systemId" index="index" separator="," open="(" close=")">
  106. #{systemId}
  107. </foreach>
  108. <if test="collect != null and collect.size > 0">
  109. AND bpm.f_id IN
  110. <foreach collection="collect"
  111. item="managerId" index="index" separator="," open="(" close=")">
  112. #{managerId}
  113. </foreach>
  114. </if>
  115. AND bpm.f_enabled_mark = 1
  116. ORDER BY
  117. bpm.f_sort_code ASC,
  118. bpm.f_creator_time DESC
  119. </select>
  120. </mapper>