后台服务
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

115 rindas
4.3 KiB

  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.iformall.mapper.MallPermissionMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.MallPermission">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="name" jdbcType="VARCHAR" property="name"/>
  7. <result column="parent_id" jdbcType="BIGINT" property="parentId"/>
  8. <result column="available" jdbcType="VARCHAR" property="available"/>
  9. <result column="permission" jdbcType="VARCHAR" property="permission"/>
  10. <result column="resource_type" jdbcType="VARCHAR" property="resourceType"/>
  11. <result column="module_color" jdbcType="VARCHAR" property="moduleColor"/>
  12. <result column="module_color_num" jdbcType="VARCHAR" property="moduleColorNum"/>
  13. <result column="url" jdbcType="VARCHAR" property="url"/>
  14. <result column="icon" jdbcType="VARCHAR" property="icon"/>
  15. <result column="version_type" jdbcType="VARCHAR" property="versionType"/>
  16. <result column="sort" jdbcType="INTEGER" property="sort"/>
  17. </resultMap>
  18. <sql id="allColumns">
  19. `id`,`name`,`parent_id`,`available`,`permission`,`resource_type`,`module_color`,`module_color_num`,`url`,`icon`,`sort`
  20. </sql>
  21. <sql id="dynamicWhereConditions">
  22. where 1 = 1
  23. <if test=" null != id ">
  24. and `id` = #{id}
  25. </if>
  26. <if test=" null != name ">
  27. and `name` = #{name}
  28. </if>
  29. <if test=" null != nameLike and '' != nameLike ">
  30. and `name` like concat('%', #{nameLike},'%')
  31. </if>
  32. <if test=" null != parentId ">
  33. and `parent_id` = #{parentId}
  34. </if>
  35. <if test=" null != available ">
  36. and `available` like concat('%', #{available},'%')
  37. </if>
  38. <if test=" null != permission ">
  39. and `permission` like concat('%', #{permission},'%')
  40. </if>
  41. <if test=" null != permissions ">
  42. and `permission` in
  43. <foreach collection="permissions" item="item_permission" open="(" close=")" separator=",">
  44. #{item_permission}
  45. </foreach>
  46. </if>
  47. <if test=" null != resourceType ">
  48. and `resource_type` like concat('%', #{resourceType},'%')
  49. </if>
  50. <if test=" null != url ">
  51. and `url` = #{url}
  52. </if>
  53. <if test=" null != icon ">
  54. and `icon` = #{icon}
  55. </if>
  56. <if test=" null != sort ">
  57. and `sort` = #{sort}
  58. </if>
  59. <if test=" null != sortFrom ">and `sort` >= #{sortFrom}</if>
  60. <if test=" null != sortTo ">and #{sortTo} >= `sort`</if>
  61. <if test=" null != sortGte ">and `sort` >= #{sortGte}</if>
  62. <if test=" null != sortGt ">and `sort` > #{sortGt}</if>
  63. <if test=" null != sortLte ">and #{sortLte} >= `sort`</if>
  64. <if test=" null != sortLt ">and #{sortLt} > `sort`</if>
  65. <if test=" null != ids ">
  66. and id in
  67. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  68. #{idItem}
  69. </foreach>
  70. </if>
  71. <if test=" null != sortColumns">order by ${sortColumns}</if>
  72. </sql>
  73. <select id="findList" parameterType="com.iformall.domain.po.MallPermission" resultMap="BaseResultMap">
  74. select
  75. <include refid="allColumns"/>
  76. from mall_permission
  77. <include refid="dynamicWhereConditions"/>
  78. </select>
  79. <select id="queryListParentId" parameterType="long" resultMap="BaseResultMap">
  80. select
  81. <include refid="allColumns"/>
  82. from mall_permission
  83. where 1=1 and `parent_id` = #{value} and available = 'Y' order by sort asc
  84. </select>
  85. <select id="queryBtnListByParentId" parameterType="long" resultMap="BaseResultMap">
  86. select
  87. <include refid="allColumns"/>
  88. from mall_permission
  89. where `parent_id` = #{value} and available = 'Y' and `resource_type` = 2 order by sort asc
  90. </select>
  91. <select id="queryNotButtonList" resultMap="BaseResultMap">
  92. select
  93. <include refid="allColumns"/>
  94. from mall_permission
  95. where 1=1 and `resource_type` != 2 and `available` = 'Y' order by sort asc
  96. </select>
  97. </mapper>