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.
 
 
 
 
 

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