From 3a2bec5f5be1e6172e85961666c651f4bbaa1c9a Mon Sep 17 00:00:00 2001 From: 21819 Date: Fri, 8 Mar 2024 19:24:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8D=E6=BB=A1=E6=84=8F?= =?UTF-8?q?=E4=BF=A1=E4=BB=B6sql=E8=AF=AD=E5=8F=A5=E6=9E=84=E9=80=A0?= =?UTF-8?q?=E4=BC=98=E5=85=88=E7=BA=A7=E5=AF=BC=E8=87=B4=E7=9A=84=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/biutag/lan/service/WorkService.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java index 7da1b70..0cd1b2f 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java @@ -454,9 +454,11 @@ public class WorkService extends ServiceImpl { .le(StrUtil.isNotBlank(mailQuery.getMailTimeStartEnd()), "TO_CHAR(m.mail_time, 'YYYY-MM-DD')", mailQuery.getMailTimeStartEnd()) .eq(StrUtil.isNotBlank(mailQuery.getSource()), "m.source", mailQuery.getSource()) .eq(StrUtil.isNotBlank(mailQuery.getMailLevel()), "m.mail_level", mailQuery.getMailLevel()) - .nested(i -> i.eq("m.satisfaction_status", "不满意") - .or().eq("m.verify_feedback", "不满意")) - .or().apply("m.id = ma.mail_id"); + .nested(i -> + i.eq("m.satisfaction_status", "不满意") + .or().eq("m.verify_feedback", "不满意") + .or().apply("m.id = ma.mail_id") + ); mailCategorySearch(mailQuery, queryWrapper); deptSearch(mailQuery, queryWrapper); roleCheck(queryWrapper); @@ -472,7 +474,6 @@ public class WorkService extends ServiceImpl { queryWrapper.like("w.contact_phone", mailQuery.getContactFieldValue()); break; } - } // 排序 queryWrapper.orderByDesc("m.mail_time"); @@ -513,13 +514,19 @@ public class WorkService extends ServiceImpl { } else if (roleId.equals(RoleEnum.SECOND_DEPT_LEADER.getRoleId()) || roleId.equals(RoleEnum.SECOND_DEPT_CLASSES.getRoleId())) { //数据,领导只能看到自己管辖的部门 Integer deptId = AdminThreadLocal.getDeptId(); - queryWrapper.eq("m.second_dept_id", deptId); + queryWrapper.and(i -> + i.eq("m.second_dept_id", deptId) + ); } else if (roleId.equals(RoleEnum.THREE_DEPT_LEADER.getRoleId()) || roleId.equals(RoleEnum.THREE_DEPT_CLASSES.getRoleId())) { Integer deptId = AdminThreadLocal.getDeptId(); - queryWrapper.eq("m.three_dept_id", deptId); + queryWrapper.and(i -> + i.eq("m.three_dept_id", deptId) + ); } else { String empNo = AdminThreadLocal.getEmpNo(); - queryWrapper.eq("w.police_emp_no", empNo); + queryWrapper.and(i -> + i.eq("w.police_emp_no", empNo) + ); } }