|
@@ -223,94 +223,104 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
limit 1
|
|
|
</select>
|
|
|
<select id="getListByPostId" resultType="com.ruoyi.common.core.domain.entity.SysUser">
|
|
|
- select u.user_id,
|
|
|
- u.dept_id,
|
|
|
- u.user_name,
|
|
|
- u.nick_name,
|
|
|
- u.email,
|
|
|
- u.avatar,
|
|
|
- u.phonenumber,
|
|
|
- u.password,
|
|
|
- u.sex,
|
|
|
- u.status,
|
|
|
- u.del_flag,
|
|
|
- u.login_ip,
|
|
|
- u.login_date,
|
|
|
- u.create_by,
|
|
|
- u.create_time,
|
|
|
- u.remark,
|
|
|
- u.tenant_id,
|
|
|
- u.user_code
|
|
|
- from sys_user_post sup
|
|
|
- inner join sys_user u on sup.user_id = u.user_id
|
|
|
- where sup.post_id = #{postId}
|
|
|
- </select>
|
|
|
+ select u.user_id,
|
|
|
+ u.dept_id,
|
|
|
+ u.user_name,
|
|
|
+ u.nick_name,
|
|
|
+ u.email,
|
|
|
+ u.avatar,
|
|
|
+ u.phonenumber,
|
|
|
+ u.password,
|
|
|
+ u.sex,
|
|
|
+ u.status,
|
|
|
+ u.del_flag,
|
|
|
+ u.login_ip,
|
|
|
+ u.login_date,
|
|
|
+ u.create_by,
|
|
|
+ u.create_time,
|
|
|
+ u.remark,
|
|
|
+ u.tenant_id,
|
|
|
+ u.user_code
|
|
|
+ from sys_user_post sup
|
|
|
+ inner join sys_user u on sup.user_id = u.user_id
|
|
|
+ where sup.post_id = #{postId}
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="getListByRoleId" resultType="com.ruoyi.common.core.domain.entity.SysUser">
|
|
|
- select u.user_id,
|
|
|
- u.dept_id,
|
|
|
- u.user_name,
|
|
|
- u.nick_name,
|
|
|
- u.email,
|
|
|
- u.avatar,
|
|
|
- u.phonenumber,
|
|
|
- u.password,
|
|
|
- u.sex,
|
|
|
- u.status,
|
|
|
- u.del_flag,
|
|
|
- u.login_ip,
|
|
|
- u.login_date,
|
|
|
- u.create_by,
|
|
|
- u.create_time,
|
|
|
- u.remark,
|
|
|
- u.tenant_id,
|
|
|
- u.user_code
|
|
|
- from sys_user_role sur
|
|
|
- inner join sys_user u on sur.user_id = u.user_id
|
|
|
- where sur.role_id = #{roleId}
|
|
|
- </select>
|
|
|
+ <select id="getListByRoleId" resultType="com.ruoyi.common.core.domain.entity.SysUser">
|
|
|
+ select u.user_id,
|
|
|
+ u.dept_id,
|
|
|
+ u.user_name,
|
|
|
+ u.nick_name,
|
|
|
+ u.email,
|
|
|
+ u.avatar,
|
|
|
+ u.phonenumber,
|
|
|
+ u.password,
|
|
|
+ u.sex,
|
|
|
+ u.status,
|
|
|
+ u.del_flag,
|
|
|
+ u.login_ip,
|
|
|
+ u.login_date,
|
|
|
+ u.create_by,
|
|
|
+ u.create_time,
|
|
|
+ u.remark,
|
|
|
+ u.tenant_id,
|
|
|
+ u.user_code
|
|
|
+ from sys_user_role sur
|
|
|
+ inner join sys_user u on sur.user_id = u.user_id
|
|
|
+ where sur.role_id = #{roleId}
|
|
|
+ </select>
|
|
|
+ <select id="getRoleByUserIdList" resultType="com.ruoyi.common.core.domain.entity.SysRole">
|
|
|
+ select sr.role_id, sr.role_name, sur.user_id
|
|
|
+ from sys_user_role sur
|
|
|
+ left join sys_role sr on sur.role_id = sr.role_id
|
|
|
+ where sr.status = 0
|
|
|
+ and sur.user_id in
|
|
|
+ <foreach collection="userIdList" item="userId" open="(" separator="," close=")">
|
|
|
+ #{userId}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
|
|
|
- <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
|
|
- insert into sys_user(
|
|
|
- <if test="userId != null and userId != 0">user_id,</if>
|
|
|
- <if test="deptId != null and deptId != 0">dept_id,</if>
|
|
|
- <if test="userName != null and userName != ''">user_name,</if>
|
|
|
- <if test="nickName != null and nickName != ''">nick_name,</if>
|
|
|
- <if test="email != null and email != ''">email,</if>
|
|
|
- <if test="avatar != null and avatar != ''">avatar,</if>
|
|
|
- <if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
|
|
- <if test="sex != null and sex != ''">sex,</if>
|
|
|
- <if test="password != null and password != ''">password,</if>
|
|
|
- <if test="status != null and status != ''">status,</if>
|
|
|
- <if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
- <if test="remark != null and remark != ''">remark,</if>
|
|
|
- <if test="tenantId != null and tenantId != ''">tenant_id,</if>
|
|
|
- <if test="userType != null and userType != ''">user_type,</if>
|
|
|
- <if test="jobNumber != null and jobNumber != ''">job_number,</if>
|
|
|
- <if test="userCode != null and userCode != ''">user_code,</if>
|
|
|
- create_time
|
|
|
- )values(
|
|
|
- <if test="userId != null and userId != ''">#{userId},</if>
|
|
|
- <if test="deptId != null and deptId != ''">#{deptId},</if>
|
|
|
- <if test="userName != null and userName != ''">#{userName},</if>
|
|
|
- <if test="nickName != null and nickName != ''">#{nickName},</if>
|
|
|
- <if test="email != null and email != ''">#{email},</if>
|
|
|
- <if test="avatar != null and avatar != ''">#{avatar},</if>
|
|
|
- <if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
|
|
- <if test="sex != null and sex != ''">#{sex},</if>
|
|
|
- <if test="password != null and password != ''">#{password},</if>
|
|
|
- <if test="status != null and status != ''">#{status},</if>
|
|
|
- <if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
- <if test="remark != null and remark != ''">#{remark},</if>
|
|
|
- <if test="tenantId != null and tenantId != ''">#{tenantId},</if>
|
|
|
- <if test="userType != null and userType != ''">#{userType},</if>
|
|
|
- <if test="jobNumber != null and jobNumber != ''">#{jobNumber},</if>
|
|
|
- <if test="userCode != null and userCode != ''">#{userCode},</if>
|
|
|
- sysdate()
|
|
|
- )
|
|
|
- </insert>
|
|
|
-
|
|
|
- <update id="updateUser" parameterType="SysUser">
|
|
|
+ <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
|
|
+ insert into sys_user(
|
|
|
+ <if test="userId != null and userId != 0">user_id,</if>
|
|
|
+ <if test="deptId != null and deptId != 0">dept_id,</if>
|
|
|
+ <if test="userName != null and userName != ''">user_name,</if>
|
|
|
+ <if test="nickName != null and nickName != ''">nick_name,</if>
|
|
|
+ <if test="email != null and email != ''">email,</if>
|
|
|
+ <if test="avatar != null and avatar != ''">avatar,</if>
|
|
|
+ <if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
|
|
+ <if test="sex != null and sex != ''">sex,</if>
|
|
|
+ <if test="password != null and password != ''">password,</if>
|
|
|
+ <if test="status != null and status != ''">status,</if>
|
|
|
+ <if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
+ <if test="remark != null and remark != ''">remark,</if>
|
|
|
+ <if test="tenantId != null and tenantId != ''">tenant_id,</if>
|
|
|
+ <if test="userType != null and userType != ''">user_type,</if>
|
|
|
+ <if test="jobNumber != null and jobNumber != ''">job_number,</if>
|
|
|
+ <if test="userCode != null and userCode != ''">user_code,</if>
|
|
|
+ create_time
|
|
|
+ )values(
|
|
|
+ <if test="userId != null and userId != ''">#{userId},</if>
|
|
|
+ <if test="deptId != null and deptId != ''">#{deptId},</if>
|
|
|
+ <if test="userName != null and userName != ''">#{userName},</if>
|
|
|
+ <if test="nickName != null and nickName != ''">#{nickName},</if>
|
|
|
+ <if test="email != null and email != ''">#{email},</if>
|
|
|
+ <if test="avatar != null and avatar != ''">#{avatar},</if>
|
|
|
+ <if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
|
|
+ <if test="sex != null and sex != ''">#{sex},</if>
|
|
|
+ <if test="password != null and password != ''">#{password},</if>
|
|
|
+ <if test="status != null and status != ''">#{status},</if>
|
|
|
+ <if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
+ <if test="remark != null and remark != ''">#{remark},</if>
|
|
|
+ <if test="tenantId != null and tenantId != ''">#{tenantId},</if>
|
|
|
+ <if test="userType != null and userType != ''">#{userType},</if>
|
|
|
+ <if test="jobNumber != null and jobNumber != ''">#{jobNumber},</if>
|
|
|
+ <if test="userCode != null and userCode != ''">#{userCode},</if>
|
|
|
+ sysdate()
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateUser" parameterType="SysUser">
|
|
|
update sys_user
|
|
|
<set>
|
|
|
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|