后台服务
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

80 righe
2.9 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.AliPayCUserMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.AliPayCUser">
  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="name" jdbcType="VARCHAR" property="name"/>
  9. <result column="alipay_user_id" jdbcType="VARCHAR" property="alipayUserId"/>
  10. <result column="phone" jdbcType="VARCHAR" property="phone"/>
  11. <result column="card_open" jdbcType="INTEGER" property="cardOpen"/>
  12. <result column="user_id" jdbcType="BIGINT" property="userId"/>
  13. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  14. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  15. </resultMap>
  16. <sql id="allColumns">
  17. `id`,`tenant_id`,`parent_tenant_id`,`name`,`alipay_user_id`,`phone`,`card_open`,`user_id`,`update_date`,`create_date`
  18. </sql>
  19. <sql id="dynamicWhereConditions">
  20. where 1=1
  21. <if test=" null != id ">
  22. and `id` = #{id}
  23. </if>
  24. <if test=" null != tenantId and '' != tenantId">
  25. and `tenant_id` = #{tenantId}
  26. </if>
  27. <if test=" null != parentTenantId and '' != parentTenantId">
  28. and `parent_tenant_id` = #{parentTenantId}
  29. </if>
  30. <if test=" null != name ">
  31. and `name` like concat('%', #{name},'%')
  32. </if>
  33. <if test=" null != alipayUserId ">
  34. and `alipay_user_id` = #{alipayUserId}
  35. </if>
  36. <if test=" null != phone ">
  37. and `phone` = #{phone}
  38. </if>
  39. <if test=" null != userId ">
  40. and `user_id` = #{userId}
  41. </if>
  42. <if test=" null != ids ">
  43. and id in
  44. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  45. #{idItem}
  46. </foreach>
  47. </if>
  48. <if test=" null != sortColumns">order by ${sortColumns}</if>
  49. </sql>
  50. <select id="findList" parameterType="com.iformall.domain.po.AliPayCUser" resultMap="BaseResultMap">
  51. select
  52. <include refid="allColumns"/>
  53. from alipay_c_user
  54. <include refid="dynamicWhereConditions"/>
  55. and id &gt; 1
  56. </select>
  57. <select id="findByAliPayUserId" parameterType="com.iformall.domain.po.AliPayCUser" resultMap="BaseResultMap">
  58. select <include refid="allColumns"/> from alipay_c_user
  59. where `alipay_user_id` = #{alipayUserId} and `tenant_id` = #{tenantId}
  60. </select>
  61. <update id="updateUserId" parameterType="com.iformall.domain.po.AliPayCUser">
  62. update alipay_c_user set user_id=#{userId}
  63. where id = #{id} and `tenant_id` = #{tenantId}
  64. </update>
  65. </mapper>