From cccad1a85274209adb1287e5f578fa44d3a72e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E8=AF=9A?= <1009578407@qq.com> Date: Wed, 2 Sep 2026 16:26:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=81=8C=E4=BB=A3=E4=BC=9Apc=E7=AB=AF?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8A=95=E7=A5=A8=E7=BA=AA=E5=BD=95=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA=E5=B7=A5=E4=BC=9A?= =?UTF-8?q?=E3=80=81=E4=BB=A3=E8=A1=A8=E5=9B=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CongressVotingStatisticalController.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/budwk/app/zhgh/democratic/congress/controller/CongressVotingStatisticalController.java b/src/main/java/com/budwk/app/zhgh/democratic/congress/controller/CongressVotingStatisticalController.java index b7c43c89..49e79bd5 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/congress/controller/CongressVotingStatisticalController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/congress/controller/CongressVotingStatisticalController.java @@ -91,6 +91,7 @@ public class CongressVotingStatisticalController { @At("/records") @SaCheckPermission("congress.vote.statistical") public Result voteRecords(@Param("issueId") String issueId) { + // H5 投票使用现有职代会代表表写入 rep_id,旧表关联仅作为历史数据兼容回退。 Sql sql = Sqls.create(""" SELECT r.id, @@ -98,10 +99,17 @@ public class CongressVotingStatisticalController { r.name, r.vote_result AS voteResult, r.create_time AS createTime, - COALESCE(rep.union_id, du.union_id) AS unionId, - du.union_name AS unionName, - COALESCE(rep.delegation_name, d.name) AS delegationName + COALESCE(tc_delegate.unionId, rep.union_id, du.union_id) AS unionId, + COALESCE(tc_delegate.unionName, du.union_name) AS unionName, + COALESCE(delegate_delegation.name, rep.delegation_name, d.name) AS delegationName FROM congress_voting_record r + LEFT JOIN teacher_congress_delegate tc_delegate ON tc_delegate.id = r.rep_id + AND tc_delegate.sessionId = r.session_id + AND COALESCE(tc_delegate.delFlag, 0) = 0 + LEFT JOIN teacher_congress_delegation delegate_delegation + ON delegate_delegation.id = COALESCE(r.delegation_id, tc_delegate.delegationId) + AND delegate_delegation.sessionId = r.session_id + AND COALESCE(delegate_delegation.delFlag, 0) = 0 LEFT JOIN congress_rep rep ON rep.id = r.rep_id LEFT JOIN congress_delegation d ON d.id = r.delegation_id LEFT JOIN (