Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

172 řádky
5.7 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.MallUserInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.MallUserInfo">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="username" jdbcType="VARCHAR" property="username"/>
  8. <result column="name" jdbcType="VARCHAR" property="name"/>
  9. <result column="password" jdbcType="VARCHAR" property="password"/>
  10. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  11. <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime"/>
  12. <result column="status" jdbcType="INTEGER" property="status"/>
  13. <result column="is_admin" jdbcType="INTEGER" property="isAdmin"/>
  14. <result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
  15. <result column="phone" jdbcType="VARCHAR" property="phone"/>
  16. <<<<<<< HEAD
  17. =======
  18. <result column="bopen_id" jdbcType="VARCHAR" property="bopenId"/>
  19. <result column="web_open_id" jdbcType="VARCHAR" property="webOpenId"/>
  20. >>>>>>> [移动塔台登录][修改]:移动塔台登录修改
  21. <result column="flow_permission" property="flowPermission"/>
  22. </resultMap>
  23. <sql id="allColumns">
  24. <<<<<<< HEAD
  25. `id`,`tenant_id`,`username`,`name`,`password`,`create_time`,`last_login_time`,`status`,`is_admin`,`nick_name`,`phone`,`flow_permission`
  26. =======
  27. `id`,`tenant_id`,`username`,`name`,`password`,`create_time`,`last_login_time`,`status`,`is_admin`,`nick_name`,`phone`,`bopen_id`,`web_open_id`,`flow_permission`
  28. >>>>>>> [移动塔台登录][修改]:移动塔台登录修改
  29. </sql>
  30. <sql id="dynamicWhereConditions">
  31. where 1 = 1
  32. <if test=" null != id ">
  33. and `id` = #{id}
  34. </if>
  35. <if test=" null != tenantId ">
  36. and `tenant_id` = #{tenantId}
  37. </if>
  38. <if test=" null != username ">
  39. and `username` like concat('%', #{username},'%')
  40. </if>
  41. <if test=" null != nickName ">
  42. and `nick_name` like concat('%', #{nickName},'%')
  43. </if>
  44. <if test=" null != name ">
  45. and `name` like concat('%', #{name},'%')
  46. </if>
  47. <if test=" null != password ">
  48. and `password` like concat('%', #{password},'%')
  49. </if>
  50. <if test=" null != createTime ">
  51. and `create_time` = #{createTime}
  52. </if>
  53. <if test=" null != lastLoginTime ">
  54. and `last_login_time` = #{lastLoginTime}
  55. </if>
  56. <if test=" null != status ">
  57. and `status` = #{status}
  58. </if>
  59. <if test=" null != isAdmin ">
  60. and `is_admin` = #{isAdmin}
  61. </if>
  62. <if test=" null != phone ">
  63. and `phone` = #{phone}
  64. </if>
  65. <if test=" null != bopenId ">
  66. and `bopen_id` = #{bopenId}
  67. </if>
  68. <if test=" null != webOpenId ">
  69. and `web_open_id` = #{webOpenId}
  70. </if>
  71. <if test=" null != flowPermission ">
  72. and JSON_CONTAINS(flow_permission->'$[*]', #{flowPermission}, '$')
  73. </if>
  74. <if test=" null != ids ">
  75. and id in
  76. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  77. #{idItem}
  78. </foreach>
  79. </if>
  80. <if test=" null != sortColumns">order by ${sortColumns}</if>
  81. </sql>
  82. <select id="findList" parameterType="com.iformall.domain.po.MallUserInfo" resultMap="BaseResultMap">
  83. select
  84. <include refid="allColumns"/>
  85. from mall_user_info
  86. <include refid="dynamicWhereConditions"/>
  87. </select>
  88. <select id="selectByUserName" resultMap="BaseResultMap">
  89. select
  90. <include refid="allColumns"/>
  91. from mall_user_info
  92. where 1=1
  93. <if test=" null != username ">
  94. and username=#{username}
  95. </if>
  96. </select>
  97. <select id="selectByBOpenId" resultMap="BaseResultMap">
  98. select
  99. <include refid="allColumns"/>
  100. from mall_user_info
  101. where 1=1
  102. <if test=" null != tenantId ">
  103. and `tenant_id`=#{tenantId}
  104. </if>
  105. <if test=" null != bopenId ">
  106. and `bopen_id`=#{bopenId}
  107. </if>
  108. </select>
  109. <select id="selectByWebOpenId" resultMap="BaseResultMap">
  110. select
  111. <include refid="allColumns"/>
  112. from mall_user_info
  113. where 1=1
  114. <if test=" null != webOpenId ">
  115. and `web_open_id`=#{webOpenId}
  116. </if>
  117. </select>
  118. <select id="selectByPhone" resultMap="BaseResultMap">
  119. select
  120. <include refid="allColumns"/>
  121. from mall_user_info
  122. where 1=1
  123. <if test=" null != tenantId ">
  124. and `tenant_id`=#{tenantId}
  125. </if>
  126. <if test=" null != phone ">
  127. and `phone`=#{phone}
  128. </if>
  129. </select>
  130. <select id="hasButtonPermission" resultType="java.lang.Integer">
  131. SELECT 1
  132. FROM mall_user_role ur, mall_user_role_permission rp, mall_permission p
  133. WHERE rp.role_id = ur.role_id
  134. AND rp.permission_id = p.id
  135. AND p.resource_type = 1
  136. AND ur.uid = #{userId}
  137. AND p.permission = #{permission}
  138. </select>
  139. <select id="cntByUserName" resultType="java.lang.Long">
  140. select count(*) from mall_user_info where 1=1
  141. <if test=" null != username ">
  142. and username=#{username}
  143. </if>
  144. <if test=" null != phone ">
  145. and `phone` = #{phone}
  146. </if>
  147. <if test=" null != id ">
  148. and `id` != #{id}
  149. </if>
  150. </select>
  151. </mapper>