| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.lf.server.mapper.sys.UserMapper"> |
| | | <resultMap id="resultMap" type="com.lf.server.entity.sys.UserEntity"> |
| | | <mapper namespace="com.terra.system.mapper.sys.UserMapper"> |
| | | <resultMap id="resultMap" type="com.terra.system.entity.sys.UserEntity"> |
| | | <id property="id" column="id"></id> |
| | | <result property="natives" column="native"></result> |
| | | <result property="createUser" column="create_user"></result> |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultMap="resultMap" resultType="com.lf.server.entity.sys.UserEntity"> |
| | | <select id="selectByPage" resultMap="resultMap" resultType="com.terra.system.entity.sys.UserEntity"> |
| | | select a.*,fn_get_fullname(a.depcode, 1) depName from lf.sys_user a |
| | | <where> |
| | | 1 = 1 |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByPageForRole" resultMap="resultMap" resultType="com.lf.server.entity.sys.UserEntity"> |
| | | <select id="selectByPageForRole" resultMap="resultMap" resultType="com.terra.system.entity.sys.UserEntity"> |
| | | select a.*,fn_get_fullname(a.depcode, 1) depName from lf.sys_user a |
| | | <where> |
| | | not exists (select b.id from lf.sys_role_user b where b.userid = a.id |
| | |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectUserAll" resultMap="resultMap" resultType="com.lf.server.entity.sys.UserEntity"> |
| | | <select id="selectUserAll" resultMap="resultMap" resultType="com.terra.system.entity.sys.UserEntity"> |
| | | select a.*, fn_get_fullname(a.depcode, 1) depName from lf.sys_user a order by a.id desc |
| | | </select> |
| | | |
| | | <select id="selectUser" resultMap="resultMap" resultType="com.lf.server.entity.sys.UserEntity"> |
| | | <select id="selectUser" resultMap="resultMap" resultType="com.terra.system.entity.sys.UserEntity"> |
| | | select a.*, fn_get_fullname(a.depcode, 1) depName from lf.sys_user a where a.id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectByUid" resultMap="resultMap" resultType="com.lf.server.entity.sys.UserEntity"> |
| | | <select id="selectByUid" resultMap="resultMap" resultType="com.terra.system.entity.sys.UserEntity"> |
| | | select * from lf.sys_user where uid = #{uid} |
| | | </select> |
| | | |
| | | <select id="selectByToken" resultType="com.lf.server.entity.sys.UserEntity"> |
| | | <select id="selectByToken" resultType="com.terra.system.entity.sys.UserEntity"> |
| | | select * from lf.sys_user where id = ( |
| | | select create_user from lf.sys_token where token=#{token} and expire > now() limit 1) |
| | | </select> |
| | |
| | | where c.is_admin = 1 and a.id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectAdminUsers" resultType="com.lf.server.entity.sys.UserEntity"> |
| | | <select id="selectAdminUsers" resultType="com.terra.system.entity.sys.UserEntity"> |
| | | select c.*, fn_get_fullname(b.depcode, 1) depName |
| | | from lf.sys_role_user a inner join lf.sys_user b on a.userid = b.id |
| | | inner join lf.sys_role c on a.roleid = a.id |
| | | where c.is_admin = #{type} |
| | | </select> |
| | | |
| | | <select id="selectRoleByUserId" resultType="com.lf.server.entity.sys.RoleEntity"> |
| | | <select id="selectRoleByUserId" resultType="com.terra.system.entity.sys.RoleEntity"> |
| | | select c.*, fn_get_fullname(a.depcode, 1) depName,fn_uname(c.create_user) createName,fn_uname(c.update_user) updateName |
| | | from lf.sys_user a inner join lf.sys_role_user b on a.id = b.userid |
| | | inner join lf.sys_role c on b.roleid = c.id |
| | | where a.id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectUserByRoleId" resultType="com.lf.server.entity.sys.RoleEntity"> |
| | | <select id="selectUserByRoleId" resultType="com.terra.system.entity.sys.RoleEntity"> |
| | | select a.*, fn_get_fullname(a.depcode, 1) depName |
| | | from lf.sys_user a inner join lf.sys_role_user b on a.id = b.userid inner join lf.sys_role c on b.roleid = c.id |
| | | where c.id = #{roleId} |
| | | </select> |
| | | |
| | | <insert id="insertUser" parameterType="com.lf.server.entity.sys.UserEntity"> |
| | | <insert id="insertUser" parameterType="com.terra.system.entity.sys.UserEntity"> |
| | | insert into lf.sys_user |
| | | (depid,depcode,uid,uname,salt,sex,native,contact,job,email,addr,edu,idcard,status,create_user,create_time,bak) |
| | | values |