No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 

118 líneas
4.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.iformall.mapper.WxMerchantBUserMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMerchantBUser">
  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="phone" jdbcType="VARCHAR" property="phone"/>
  9. <result column="user_pwd" jdbcType="VARCHAR" property="userPwd"/>
  10. <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
  11. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  12. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  13. <result column="app_id" jdbcType="VARCHAR" property="appId"/>
  14. <result column="token" jdbcType="VARCHAR" property="token"/>
  15. <result column="expire_time" jdbcType="TIMESTAMP" property="expireTime"/>
  16. <result column="name" jdbcType="VARCHAR" property="name"/>
  17. <result column="status" jdbcType="INTEGER" property="status"/>
  18. </resultMap>
  19. <sql id="allColumns">
  20. `id`,`tenant_id`,`parent_tenant_id`,`phone`,`user_pwd`,`merchant_id`,`create_date`,`update_date`,`app_id`,`token`,`expire_time`,`name`,`status`
  21. </sql>
  22. <sql id="dynamicWhereConditions">
  23. where 1 = 1
  24. <if test=" null != id ">
  25. and `id` = #{id}
  26. </if>
  27. <if test=" null != tenantId and '' != tenantId">
  28. and `tenant_id` = #{tenantId}
  29. </if>
  30. <if test=" null != parentTenantId and '' != parentTenantId">
  31. and `parent_tenant_id` = #{parentTenantId}
  32. </if>
  33. <if test=" null != phone ">
  34. and `phone` = #{phone}
  35. </if>
  36. <if test=" null != userPwd ">
  37. and `user_pwd` like concat('%', #{userPwd},'%')
  38. </if>
  39. <if test=" null != merchantId ">
  40. and `merchant_id` = #{merchantId}
  41. </if>
  42. <if test=" null != createDate ">
  43. and `create_date` = #{createDate}
  44. </if>
  45. <if test=" null != updateDate ">
  46. and `update_date` = #{updateDate}
  47. </if>
  48. <if test=" null != appId ">
  49. and `app_id` like concat('%', #{appId},'%')
  50. </if>
  51. <if test=" null != token ">
  52. and `token` like concat('%', #{token},'%')
  53. </if>
  54. <if test=" null != expireTime ">
  55. and `expire_time` = #{expireTime}
  56. </if>
  57. <if test=" null != name ">
  58. and `name` = #{name}
  59. </if>
  60. <if test=" null != status ">
  61. and `status` = #{status}
  62. </if>
  63. <if test=" null != ids ">
  64. and id in
  65. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  66. #{idItem}
  67. </foreach>
  68. </if>
  69. <if test=" null != sortColumns">order by ${sortColumns}</if>
  70. </sql>
  71. <select id="findList" parameterType="com.iformall.domain.po.WxMerchantBUser" resultMap="BaseResultMap">
  72. select
  73. <include refid="allColumns"/>
  74. from wx_merchant_b_user
  75. <include refid="dynamicWhereConditions"/>
  76. </select>
  77. <select id="findSelMerchantList" parameterType="com.iformall.domain.po.WxMerchantBUser" resultType="com.iformall.domain.vo.WxMerchantBuInfoVo">
  78. select
  79. mbu.tenant_id, mbu.parent_tenant_id, m.name tenant_name,
  80. mc.name merchant_name, mbu.id bu_user_id, mbu.merchant_id, mc.img_url
  81. from wx_merchant_b_user mbu, wx_merchant mc, wx_mall m
  82. <where> m.tenant_id = mbu.parent_tenant_id
  83. and mbu.merchant_id = mc.id and mc.status = 1
  84. <if test=" null != appId ">
  85. and mbu.`app_id` = #{appId}
  86. </if>
  87. <if test=" null != phone ">
  88. and mbu.`phone` = #{phone}
  89. </if>
  90. <if test=" null != status ">
  91. and mbu.`status` = #{status}
  92. </if>
  93. </where>
  94. </select>
  95. <select id="findByToken" resultMap="BaseResultMap">
  96. select * from wx_merchant_b_user
  97. where `token` = #{token}
  98. </select>
  99. </mapper>