Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

53 řádky
1.5 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.WxChannelMapper">
  4. <resultMap id="BaseResultMap" type="com.simple.domain.po.WxChannel">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="channel_id" jdbcType="INTEGER" property="channelId" />
  7. <result column="title" jdbcType="VARCHAR" property="title" />
  8. <result column="img" jdbcType="VARCHAR" property="img" />
  9. </resultMap>
  10. <sql id="allColumns">
  11. `id`,`tenant_id`,`channel_id`,`title`,`img`
  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 != channelId ">
  19. and `channel_id` = #{channelId}
  20. </if>
  21. <if test=" null != title ">
  22. and `title` like concat('%', #{title},'%')
  23. </if>
  24. <if test=" null != img ">
  25. and `img` like concat('%', #{img},'%')
  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.simple.domain.po.WxChannel" resultMap="BaseResultMap">
  36. select <include refid="allColumns" /> from wx_channel
  37. <include refid="dynamicWhereConditions" />
  38. </select>
  39. </mapper>