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

66 строки
1.9 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.MallRoleMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.MallRole">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  7. <result column="name" jdbcType="VARCHAR" property="name" />
  8. <result column="available" jdbcType="VARCHAR" property="available" />
  9. <result column="description" jdbcType="VARCHAR" property="description" />
  10. </resultMap>
  11. <sql id="allColumns">
  12. `id`,`tenant_id`,`name`,`available`,`description`
  13. </sql>
  14. <sql id="dynamicWhereConditions">
  15. where 1 = 1
  16. <if test=" null != id ">
  17. and `id` = #{id}
  18. </if>
  19. <if test=" null != tenantId ">
  20. and `tenant_id` = #{tenantId}
  21. </if>
  22. <if test=" null != name and '' != name ">
  23. and `name` like concat('%', #{name},'%')
  24. </if>
  25. <if test=" null != available ">
  26. and `available` like concat('%', #{available},'%')
  27. </if>
  28. <if test=" null != description ">
  29. and `description` like concat('%', #{description},'%')
  30. </if>
  31. <if test=" null != ids ">
  32. and id in
  33. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  34. #{idItem}
  35. </foreach>
  36. </if>
  37. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  38. </sql>
  39. <select id="findList" parameterType="com.iformall.domain.po.MallRole" resultMap="BaseResultMap">
  40. select <include refid="allColumns" /> from mall_role
  41. <include refid="dynamicWhereConditions" />
  42. </select>
  43. <select id="countByName" resultType="java.lang.Integer" parameterType="java.util.HashMap">
  44. select count(1) from mall_role where name=#{name}
  45. <if test="id!=null"> and id !=#{id}</if>
  46. </select>
  47. </mapper>