Selaa lähdekoodia

【CHG】修改数据权限

ZhaoMn 3 vuotta sitten
vanhempi
commit
f977da1839

+ 9 - 4
railway-business/src/main/resources/mapper/safetool/SecExperimentMapper.xml

@@ -117,10 +117,15 @@
     select e.id,e.state,e.scheduled_time,e.end_time,e.exp_date,e.dept_name,e.lab_name,u.real_name
     from sec_experiment e
     left join sys_user u on e.create_by = u.user_name
-    where (e.lab_id =#{deptId} or e.dept_id =#{deptId})
-    <if test="scheduledTime!=null and scheduledTime!=''">
-      and e.scheduled_time =#{scheduledTime}
-    </if>
+    <where>
+      e.del_flag = '0'
+      <if test="deptId!=null and deptId!=''">
+        and (e.lab_id =#{deptId} or e.dept_id =#{deptId})
+      </if>
+      <if test="scheduledTime!=null and scheduledTime!=''">
+        and e.scheduled_time =#{scheduledTime}
+      </if>
+    </where>
     <if test="orderby!=null and orderby!=''">
       order by end_time ${orderby}
     </if>

+ 9 - 5
railway-business/src/main/resources/mapper/safetool/SecScheduledMapper.xml

@@ -139,11 +139,15 @@
     inner join base_safety_tool t on t.tool_id = r.tool_id
     left join sys_dept d1 on s.dept_id = d1.dept_id
     left join sys_dept d2 on s.lab_id = d2.dept_id
-    where s.del_flag = '0' and s.state = 0 and t.del_flag = '0' and t.state = '1'
-    and s.dept_id=#{deptId}
-    <if test="labId!=null and labId!=''">
-      and s.lab_id=#{labId}
-    </if>
+    <where>
+      s.del_flag = '0' and s.state = 0 and t.del_flag = '0' and t.state = '1'
+      <if test="deptId!=null and deptId!=''">
+        and s.dept_id=#{deptId}
+      </if>
+      <if test="labId!=null and labId!=''">
+        and s.lab_id=#{labId}
+      </if>
+    </where>
     group by s.id
     <if test="orderby!=null and orderby!=''">
       order by scheduled_time ${orderby}