Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

100 строки
3.1 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.simple.mapper.MallPermissionMapper">
  4. <resultMap id="BaseResultMap" type="com.simple.domain.po.MallPermission">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="name" jdbcType="VARCHAR" property="name" />
  7. <result column="available" jdbcType="VARCHAR" property="available" />
  8. <result column="parent_id" jdbcType="BIGINT" property="parentId" />
  9. <result column="parent_ids" jdbcType="VARCHAR" property="parentIds" />
  10. <result column="permission" jdbcType="VARCHAR" property="permission" />
  11. <result column="resource_type" jdbcType="VARCHAR" property="resourceType" />
  12. <result column="url" jdbcType="VARCHAR" property="url" />
  13. <result column="sort" jdbcType="INTEGER" property="sort" />
  14. </resultMap>
  15. <sql id="allColumns">
  16. `id`,`name`,`available`,`parent_id`,`parent_ids`,`permission`,`resource_type`,`url`,`sort`
  17. </sql>
  18. <sql id="dynamicWhereConditions">
  19. where 1 = 1
  20. <if test=" null != id ">
  21. and `id` = #{id}
  22. </if>
  23. <if test=" null != name ">
  24. and `name` like concat('%', #{name},'%')
  25. </if>
  26. <if test=" null != nameLike and '' != nameLike "> and `name` like concat('%', #{nameLike},'%')</if>
  27. <if test=" null != available ">
  28. and `available` like concat('%', #{available},'%')
  29. </if>
  30. <if test=" null != parentId ">
  31. and `parent_id` = #{parentId}
  32. </if>
  33. <if test=" null != parentIds ">
  34. and `parent_ids` like concat('%', #{parentIds},'%')
  35. </if>
  36. <if test=" null != permission ">
  37. and `permission` like concat('%', #{permission},'%')
  38. </if>
  39. <if test=" null != permissions ">
  40. and `permission` in
  41. <foreach collection="permissions" item="item_permission" open="(" close=")" separator=",">
  42. #{item_permission}
  43. </foreach>
  44. </if>
  45. <if test=" null != resourceType ">
  46. and `resource_type` like concat('%', #{resourceType},'%')
  47. </if>
  48. <if test=" null != url ">
  49. and `url` like concat('%', #{url},'%')
  50. </if>
  51. <if test=" null != sort ">
  52. and `sort` = #{sort}
  53. </if>
  54. <if test=" null != sortFrom "> and `sort` >= #{sortFrom} </if>
  55. <if test=" null != sortTo "> and #{sortTo} >= `sort` </if>
  56. <if test=" null != sortGte "> and `sort` >= #{sortGte} </if>
  57. <if test=" null != sortGt "> and `sort` > #{sortGt} </if>
  58. <if test=" null != sortLte "> and #{sortLte} >= `sort` </if>
  59. <if test=" null != sortLt "> and #{sortLt} > `sort` </if>
  60. <if test=" null != ids ">
  61. and id in
  62. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  63. #{idItem}
  64. </foreach>
  65. </if>
  66. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  67. </sql>
  68. <select id="findList" parameterType="com.simple.domain.po.MallPermission" resultMap="BaseResultMap">
  69. select <include refid="allColumns" /> from mall_permission
  70. <include refid="dynamicWhereConditions" />
  71. </select>
  72. </mapper>