From 4a5ac4b600bb4138382a47a1d1d8033149f1a2cf Mon Sep 17 00:00:00 2001 From: 18616268358 <1440265357@qq.com> Date: Tue, 23 May 2023 15:31:01 +0800 Subject: [PATCH] =?UTF-8?q?#20230510=20=E6=AC=A3=E5=BD=B1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=B9=B3=E5=8F=B0=E8=A3=85=E7=BD=AE=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xymanager_dao/src/main/resources/mappers/TerminalsDao.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xymanager_dao/src/main/resources/mappers/TerminalsDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalsDao.xml index 1fb029c..6698439 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalsDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalsDao.xml @@ -169,9 +169,14 @@ left join tower c on a.tower_id = c.id) left join terminal_channel_mapper d on a.id = d.term_id) left join terminal_channels e on d.channel_id = e.id) - left join terminal_photos tp on tp.channel_id = e.id and tp.term_id = a.id ) left join terminal_photo_marks tpm on a.id = tpm.term_id and e.id = tpm.channel_id) left join terminal_photo_mark_paths tpmp on tpmp.mark_id = tpm.id) + left join + ( + SELECT path,term_id,channel_id + from terminal_photos + where id in (select max(id) from terminal_photos GROUP BY term_id,channel_id) + ) tp on tp.channel_id = e.id and tp.term_id = a.id ) WHERE a.status = 1 order by a.create_time desc