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 (