后台服务
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

MallRoleMapper.xml 2.2 KiB

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