Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 

57 linhas
1.6 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.WxChannelMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.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. <result column="batch" jdbcType="INTEGER" property="batch" />
  10. </resultMap>
  11. <sql id="allColumns">
  12. `id`,`channel_id`,`title`,`img`,`batch`
  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 != channelId ">
  20. and `channel_id` = #{channelId}
  21. </if>
  22. <if test=" null != title ">
  23. and `title` like concat('%', #{title},'%')
  24. </if>
  25. <if test=" null != img ">
  26. and `img` like concat('%', #{img},'%')
  27. </if>
  28. <if test=" null != batch ">
  29. and `batch` = #{batch}
  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.WxChannel" resultMap="BaseResultMap">
  40. select <include refid="allColumns" /> from wx_channel
  41. <include refid="dynamicWhereConditions" />
  42. </select>
  43. </mapper>