|
@@ -232,12 +232,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="params.businessDataScope != null and params.businessDataScope != ''">
|
|
<if test="params.businessDataScope != null and params.businessDataScope != ''">
|
|
|
${params.businessDataScope}
|
|
${params.businessDataScope}
|
|
|
</if>
|
|
</if>
|
|
|
- <!-- 限制待下发工单只能创建人本部门查看 -->
|
|
|
|
|
- <if test="params.currentUser != null and params.currentUser != ''">
|
|
|
|
|
- and ((t.work_order_status != 'to_issue' and t.work_order_status != 'accept_return') or t.create_by in
|
|
|
|
|
|
|
+ <!-- 限制待下发工单只能创建人本部门查看(create_by不等于admin时才限制;create_by等于admin时只有运行员能看到) -->
|
|
|
|
|
+ <if test="params.currentUser != null and params.currentUser != ''">
|
|
|
|
|
+ and ((t.work_order_status != 'to_issue' and t.work_order_status != 'accept_return')
|
|
|
|
|
+ or (t.create_by = 'admin' and exists (
|
|
|
|
|
+ select 1 from sys_user_role sur
|
|
|
|
|
+ left join sys_role sr on sur.role_id = sr.role_id
|
|
|
|
|
+ where sur.user_id = (select user_id from sys_user where user_name = #{params.currentUser,jdbcType=VARCHAR} and del_flag='0')
|
|
|
|
|
+ and sr.role_key = 'YXS43'
|
|
|
|
|
+ ))
|
|
|
|
|
+ or (t.create_by != 'admin' and t.create_by in
|
|
|
(select user_name from sys_user t1
|
|
(select user_name from sys_user t1
|
|
|
left join sys_dept t2 on t1.dept_id = t2.dept_id
|
|
left join sys_dept t2 on t1.dept_id = t2.dept_id
|
|
|
- where t2.dept_id = (select dept_id from sys_user where user_name = #{params.currentUser,jdbcType=VARCHAR} and del_flag='0')))
|
|
|
|
|
|
|
+ where t2.dept_id = (select dept_id from sys_user where user_name = #{params.currentUser,jdbcType=VARCHAR} and del_flag='0'))))
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
order by create_time desc
|
|
order by create_time desc
|