后台服务
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.

60 Zeilen
1.7 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.WxUserChannelMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxUserChannel">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="channel_name" jdbcType="VARCHAR" property="channelName" />
  7. <result column="scene_address" jdbcType="VARCHAR" property="sceneAddress" />
  8. <result column="description" jdbcType="VARCHAR" property="description" />
  9. </resultMap>
  10. <sql id="allColumns">
  11. `id`,`channel_name`,`scene_address`,`description`
  12. </sql>
  13. <sql id="dynamicWhereConditions">
  14. where 1 = 1
  15. <if test=" null != id ">
  16. and `id` = #{id}
  17. </if>
  18. <if test=" null != channelName ">
  19. and `channel_name` = #{channelName}
  20. </if>
  21. <if test=" null != sceneAddress ">
  22. and `scene_address` = #{sceneAddress}
  23. </if>
  24. <if test=" null != description ">
  25. and `description` like concat('%', #{description},'%')
  26. </if>
  27. <if test=" null != ids ">
  28. and id in
  29. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  30. #{idItem}
  31. </foreach>
  32. </if>
  33. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  34. </sql>
  35. <select id="findList" parameterType="com.iformall.domain.po.WxUserChannel" resultMap="BaseResultMap">
  36. select <include refid="allColumns" /> from wx_user_channel
  37. <include refid="dynamicWhereConditions" />
  38. </select>
  39. <select id="findDistinctChannel" resultMap="BaseResultMap">
  40. select distinct channel_name from wx_user_channel
  41. <include refid="dynamicWhereConditions" />
  42. </select>
  43. </mapper>