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.
 
 
 
 
 

110 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.simple.mapper.WxMerchantBUserMapper">
  4. <resultMap id="BaseResultMap" type="com.simple.domain.po.WxMerchantBUser">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  7. <result column="b_user_id" jdbcType="BIGINT" property="bUserId" />
  8. <result column="phone" jdbcType="VARCHAR" property="phone" />
  9. <result column="b_user_pwd" jdbcType="VARCHAR" property="bUserPwd" />
  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`,`b_user_id`,`phone`,`b_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 ">
  28. and `tenant_id` like concat('%', #{tenantId},'%')
  29. </if>
  30. <if test=" null != bUserId ">
  31. and `b_user_id` = #{bUserId}
  32. </if>
  33. <if test=" null != phone ">
  34. and `phone` = #{phone}
  35. </if>
  36. <if test=" null != bUserPwd ">
  37. and `b_user_pwd` like concat('%', #{bUserPwd},'%')
  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.simple.domain.po.WxMerchantBUser" resultMap="BaseResultMap">
  72. select <include refid="allColumns" /> from wx_merchant_b_user
  73. <include refid="dynamicWhereConditions" />
  74. </select>
  75. <select id="findByToken" resultMap="BaseResultMap">
  76. select * from wx_merchant_b_user
  77. where `token` = #{token}
  78. </select>
  79. </mapper>