You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

61 lines
2.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.iformall.mapper.WxUserDataRuleMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxUserDataRule">
  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="user_id" jdbcType="BIGINT" property="userId"/>
  9. <result column="type" jdbcType="INTEGER" property="type"/>
  10. <result column="building_floor" jdbcType="VARCHAR" property="buildingFloor"/>
  11. <result column="business" jdbcType="VARCHAR" property="business"/>
  12. <result column="target" jdbcType="VARCHAR" property="target"/>
  13. <result column="shop_type" jdbcType="VARCHAR" property="shopType"/>
  14. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  15. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  16. </resultMap>
  17. <sql id="allColumns">
  18. `id`,`tenant_id`,`parent_tenant_id`,`user_id`,`type`,`building_floor`,`business`,`target`,`shop_type`,`create_time`,`update_time`
  19. </sql>
  20. <sql id="dynamicWhereConditions">
  21. where 1 = 1
  22. <if test=" null != id ">
  23. and `id` = #{id}
  24. </if>
  25. <if test=" null != tenantId and '' != tenantId">
  26. and `tenant_id` = #{tenantId}
  27. </if>
  28. <if test=" null != parentTenantId and '' != parentTenantId">
  29. and `parent_tenant_id` = #{parentTenantId}
  30. </if>
  31. <if test=" null != userId ">
  32. and `user_id` = #{userId}
  33. </if>
  34. <if test=" null != type ">
  35. and `type` = #{type}
  36. </if>
  37. <if test=" null != ids ">
  38. and id in
  39. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  40. #{idItem}
  41. </foreach>
  42. </if>
  43. <if test=" null != sortColumns">order by ${sortColumns}</if>
  44. </sql>
  45. <select id="findList" parameterType="com.iformall.domain.po.WxUserDataRule" resultMap="BaseResultMap">
  46. select
  47. <include refid="allColumns"/>
  48. from wx_user_data_rule
  49. <include refid="dynamicWhereConditions"/>
  50. </select>
  51. </mapper>