Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

58 строки
2.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.simple.mapper.UserInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.simple.domain.po.UserInfo">
  5. <id column="id" jdbcType="VARCHAR" property="id" />
  6. <result column="username" jdbcType="VARCHAR" property="username" />
  7. <result column="name" jdbcType="VARCHAR" property="name" />
  8. <result column="password" jdbcType="VARCHAR" property="password" />
  9. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  10. <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" />
  11. <result column="status" jdbcType="INTEGER" property="status" />
  12. <result column="is_admin" jdbcType="INTEGER" property="isAdmin" />
  13. </resultMap>
  14. <sql id="allColumns">
  15. `id`,`username`,`name`,`password`,`create_time`,`last_login_time`,`status`,`is_admin`
  16. </sql>
  17. <sql id="dynamicWhereConditions">
  18. where 1 = 1
  19. <if test=" null != id "> and `id` = #{id} </if>
  20. <if test=" null != username "> and `username` = #{username} </if>
  21. <if test=" null != name "> and `name` = #{name} </if>
  22. <if test=" null != password "> and `password` = #{password} </if>
  23. <if test=" null != createTime "> and `create_time` = #{createTime} </if>
  24. <if test=" null != lastLoginTime "> and `last_login_time` = #{lastLoginTime} </if>
  25. <if test=" null != status "> and `status` = #{status} </if>
  26. <if test=" null != isAdmin "> and `is_admin` = #{isAdmin} </if>
  27. <if test=" null != ids ">
  28. and id in
  29. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  30. #{idItem}
  31. </foreach>
  32. </if>
  33. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  34. </sql>
  35. <select id="findList" parameterType="com.simple.domain.po.UserInfo" resultMap="BaseResultMap">
  36. select <include refid="allColumns" /> from user_info
  37. <include refid="dynamicWhereConditions" />
  38. </select>
  39. <select id="hasButtonPermission" resultType="java.lang.Integer">
  40. SELECT 1
  41. FROM sys_user_role ur, sys_role_permission rp, sys_permission p
  42. WHERE rp.role_id = ur.role_id
  43. AND rp.permission_id = p.id
  44. AND p.resource_type = 1
  45. AND ur.uid = #{userId}
  46. AND p.permission = #{permission}
  47. </select>
  48. </mapper>