|
@@ -46,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="ancestors" column="ancestors" />
|
|
<result property="ancestors" column="ancestors" />
|
|
|
<result property="status" column="dept_status" />
|
|
<result property="status" column="dept_status" />
|
|
|
<result property="maxDuration" column="max_duration" />
|
|
<result property="maxDuration" column="max_duration" />
|
|
|
|
|
+ <result property="companyId" column="company_id" />
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<resultMap id="RoleResult" type="SysRole">
|
|
<resultMap id="RoleResult" type="SysRole">
|
|
@@ -59,7 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
<sql id="selectUserVo">
|
|
<sql id="selectUserVo">
|
|
|
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,
|
|
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,
|
|
|
- d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,d.ancestors,d.max_duration,u.open_id,
|
|
|
|
|
|
|
+ d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,d.ancestors,d.max_duration,u.open_id,d.company_id,
|
|
|
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
|
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
|
|
from sys_user u
|
|
from sys_user u
|
|
|
left join sys_dept d on u.dept_id = d.dept_id
|
|
left join sys_dept d on u.dept_id = d.dept_id
|
|
@@ -83,13 +84,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="userName != null and userName != ''">
|
|
<if test="userName != null and userName != ''">
|
|
|
AND u.user_name like concat('%', #{userName}, '%')
|
|
AND u.user_name like concat('%', #{userName}, '%')
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="nickName != null and nickName != ''">
|
|
|
|
|
+ AND u.nick_name like concat('%', #{nickName}, '%')
|
|
|
|
|
+ </if>
|
|
|
<if test="jobNumber != null and jobNumber != ''">
|
|
<if test="jobNumber != null and jobNumber != ''">
|
|
|
AND u.job_number like concat('%', #{jobNumber}, '%')
|
|
AND u.job_number like concat('%', #{jobNumber}, '%')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="fullJob != null and fullJob != ''">
|
|
|
|
|
- AND u.full_job = #{fullJob}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="fullJob != null and fullJob != ''">
|
|
|
|
|
|
|
+ <if test="fullJob != null ">
|
|
|
AND u.full_job = #{fullJob}
|
|
AND u.full_job = #{fullJob}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="postId != null and postId != ''">
|
|
<if test="postId != null and postId != ''">
|
|
@@ -113,9 +114,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="companyId !=null and companyId != 0">
|
|
<if test="companyId !=null and companyId != 0">
|
|
|
AND (u.dept_id = #{companyId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{companyId}, ancestors) ))
|
|
AND (u.dept_id = #{companyId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{companyId}, ancestors) ))
|
|
|
</if>
|
|
</if>
|
|
|
-
|
|
|
|
|
<!-- 数据范围过滤 -->
|
|
<!-- 数据范围过滤 -->
|
|
|
${params.dataScope}
|
|
${params.dataScope}
|
|
|
|
|
+ <if test="projectQuantitySort !=null and durationSort !=null">
|
|
|
|
|
+ order by u.project_quantity
|
|
|
|
|
+ <if test="projectQuantitySort==1">
|
|
|
|
|
+ desc
|
|
|
|
|
+ </if>
|
|
|
|
|
+ ,u.duration
|
|
|
|
|
+ <if test="durationSort==1">
|
|
|
|
|
+ desc
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="projectQuantitySort !=null and durationSort ==null">
|
|
|
|
|
+ order by u.project_quantity
|
|
|
|
|
+ <if test="projectQuantitySort==1">
|
|
|
|
|
+ desc
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="projectQuantitySort ==null and durationSort !=null">
|
|
|
|
|
+ order by
|
|
|
|
|
+ u.duration
|
|
|
|
|
+ <if test="durationSort==1">
|
|
|
|
|
+ desc
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
|
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
|
@@ -199,6 +223,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="projectQuantity != null and projectQuantity != ''">project_quantity,</if>
|
|
<if test="projectQuantity != null and projectQuantity != ''">project_quantity,</if>
|
|
|
<if test="jobNumber != null and jobNumber != ''">job_number,</if>
|
|
<if test="jobNumber != null and jobNumber != ''">job_number,</if>
|
|
|
<if test="fullJob != null and fullJob != ''">full_job,</if>
|
|
<if test="fullJob != null and fullJob != ''">full_job,</if>
|
|
|
|
|
+ <if test="duration != null and duration != ''">duration,</if>
|
|
|
create_time
|
|
create_time
|
|
|
)values(
|
|
)values(
|
|
|
<if test="userId != null and userId != ''">#{userId},</if>
|
|
<if test="userId != null and userId != ''">#{userId},</if>
|
|
@@ -218,6 +243,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="projectQuantity != null and projectQuantity != ''">#{projectQuantity},</if>
|
|
<if test="projectQuantity != null and projectQuantity != ''">#{projectQuantity},</if>
|
|
|
<if test="jobNumber != null and jobNumber != ''">#{jobNumber},</if>
|
|
<if test="jobNumber != null and jobNumber != ''">#{jobNumber},</if>
|
|
|
<if test="fullJob != null and fullJob != ''">#{fullJob},</if>
|
|
<if test="fullJob != null and fullJob != ''">#{fullJob},</if>
|
|
|
|
|
+ <if test="duration != null and duration != ''">#{duration},</if>
|
|
|
sysdate()
|
|
sysdate()
|
|
|
)
|
|
)
|
|
|
</insert>
|
|
</insert>
|
|
@@ -253,6 +279,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="fullJob != null">
|
|
<if test="fullJob != null">
|
|
|
full_job = #{fullJob,jdbcType=INTEGER},
|
|
full_job = #{fullJob,jdbcType=INTEGER},
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="duration != null and duration != ''">duration=#{duration},</if>
|
|
|
update_time = sysdate()
|
|
update_time = sysdate()
|
|
|
</set>
|
|
</set>
|
|
|
where user_id = #{userId}
|
|
where user_id = #{userId}
|