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.

73 lines
2.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.iformall.mapper.WxPayAccountMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxPayAccount">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="mch_id" jdbcType="VARCHAR" property="mchId"/>
  7. <result column="sub_mch_id" jdbcType="VARCHAR" property="subMchId"/>
  8. <result column="api_key" jdbcType="VARCHAR" property="apiKey"/>
  9. <result column="notify_url" jdbcType="VARCHAR" property="notifyUrl"/>
  10. <result column="cert_path" jdbcType="VARCHAR" property="certPath"/>
  11. <result column="type" jdbcType="INTEGER" property="type"/>
  12. <result column="share" jdbcType="INTEGER" property="share"/>
  13. <result column="rate" jdbcType="INTEGER" property="rate"/>
  14. </resultMap>
  15. <sql id="allColumns">
  16. `id`,`mch_id`,`sub_mch_id`,`api_key`,`notify_url`,`cert_path`,`type`,`share`,`rate`
  17. </sql>
  18. <sql id="dynamicWhereConditions">
  19. where 1 = 1
  20. <if test=" null != id ">
  21. and `id` = #{id}
  22. </if>
  23. <if test=" null != mchId ">
  24. and `mch_id` = #{mchId}
  25. </if>
  26. <if test=" null != subMchId ">
  27. and `sub_mch_id` = #{subMchId}
  28. </if>
  29. <if test=" null != apiKey ">
  30. and `api_key` like concat('%', #{apiKey},'%')
  31. </if>
  32. <if test=" null != notifyUrl ">
  33. and `notify_url` like concat('%', #{notifyUrl},'%')
  34. </if>
  35. <if test=" null != certPath ">
  36. and `cert_path` like concat('%', #{certPath},'%')
  37. </if>
  38. <if test=" null != type ">
  39. and `type` = #{type}
  40. </if>
  41. <if test=" null != share ">
  42. and `share` = #{share}
  43. </if>
  44. <if test=" null != rate ">
  45. and `rate` = #{rate}
  46. </if>
  47. <if test=" null != ids ">
  48. and id in
  49. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  50. #{idItem}
  51. </foreach>
  52. </if>
  53. <if test=" null != sortColumns">order by ${sortColumns}</if>
  54. </sql>
  55. <select id="findList" parameterType="com.iformall.domain.po.WxPayAccount" resultMap="BaseResultMap">
  56. select
  57. <include refid="allColumns"/>
  58. from wx_pay_account
  59. <include refid="dynamicWhereConditions"/>
  60. </select>
  61. </mapper>