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.
 
 
 
 
 

51 regels
1.3 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.WxImgUrlMapper">
  4. <resultMap id="BaseResultMap" type="com.simple.domain.po.WxImgUrl">
  5. <id column="id" jdbcType="INTEGER" property="id" />
  6. <result column="address" jdbcType="VARCHAR" property="address" />
  7. <result column="sign" jdbcType="VARCHAR" property="sign" />
  8. </resultMap>
  9. <sql id="allColumns">
  10. `id`,`address`,`sign`
  11. </sql>
  12. <sql id="dynamicWhereConditions">
  13. where 1 = 1
  14. <if test=" null != id ">
  15. and `id` = #{id}
  16. </if>
  17. <if test=" null != address ">
  18. and `address` like concat('%', #{address},'%')
  19. </if>
  20. <if test=" null != sign ">
  21. and `sign` like concat('%', #{sign},'%')
  22. </if>
  23. <if test=" null != ids ">
  24. and id in
  25. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  26. #{idItem}
  27. </foreach>
  28. </if>
  29. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  30. </sql>
  31. <select id="findList" parameterType="com.simple.domain.po.WxImgUrl" resultMap="BaseResultMap">
  32. select <include refid="allColumns" /> from wx_img_url
  33. <include refid="dynamicWhereConditions" />
  34. </select>
  35. </mapper>