From 78f674763d11486f28c83bfb31f8ce802fd156ff Mon Sep 17 00:00:00 2001 From: WendyYang Date: Fri, 7 Apr 2023 18:46:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA=E4=BC=9A?= =?UTF-8?q?=E8=AE=AE=E9=80=89=E6=8B=A9=E9=A1=B9=E7=9B=AE=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/meeting/manage/MeetingManage.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java index eee4e60..a752660 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java @@ -835,12 +835,16 @@ public class MeetingManage { } private void buildOptionProjectQuery(LambdaQueryWrapper query, String meetingType, ProjectStatusEnum status) { + query.eq(Project::getStatus, status.getCode()); String sql = String.format("select 1 from meeting m inner join meeting_inner_project mip on" + " m.is_inner_project = true and m.id = mip.meeting_id and nd_project.id = mip.project_id" + " and m.type = %s and m.status != 3", meetingType); - query.eq(Project::getStatus, status.getCode()); - query.and(q1 -> q1.notExists(sql).or(q2 -> q2.exists(sql + " inner join nd_expert_review ner " + - "on ner.meeting_id = m.id and ner.project_id = mip.project_id and ner.is_final = true and review_result in (2, 3)"))); + String sql2 = String.format("select review_result in (2,3) from " + + " (select ner.review_result from meeting m inner join meeting_inner_project mip on" + + " m.is_inner_project = true and m.id = mip.meeting_id and nd_project.id = mip.project_id" + + " and m.type = %s and m.status != 3 left join nd_expert_review ner on ner.meeting_id = m.id " + + " and ner.project_id = mip.project_id and ner.is_final = true order by m.create_on desc limit 1) t", meetingType); + query.and(q1 -> q1.notExists(sql).or(q2 -> q2.apply(sql2))); } }