fix: 告警通知,电话次数问题修复。

This commit is contained in:
tianyongbao
2026-03-10 08:34:12 +08:00
parent fe85fb2b75
commit cd1e8249ce

View File

@@ -52,7 +52,7 @@ public class MessageWarnServiceImpl implements IMessageWarnService {
.selectAs(Device::getDeviceName, MessageWarnVo::getDeviceName) .selectAs(Device::getDeviceName, MessageWarnVo::getDeviceName)
.selectAs(Device::getSerialNum, MessageWarnVo::getSerialNum) .selectAs(Device::getSerialNum, MessageWarnVo::getSerialNum)
.selectAs(Pond::getPondName, MessageWarnVo::getPondName) .selectAs(Pond::getPondName, MessageWarnVo::getPondName)
.select("(SELECT COUNT(*) FROM aqu_map_message_warn_call_notice map WHERE map.message_warn_id = t.id AND map.tenant_id = t.tenant_id) AS callNoticeCount") .select("(SELECT COUNT(DISTINCT n.mobile_phone) FROM aqu_map_message_warn_call_notice map INNER JOIN aqu_call_notice n ON n.id = map.call_notice_id WHERE map.message_warn_id = t.id AND map.tenant_id = t.tenant_id) AS callNoticeCount")
.leftJoin(AquUser.class, AquUser::getId, MessageWarn::getUserId) .leftJoin(AquUser.class, AquUser::getId, MessageWarn::getUserId)
.leftJoin(Device.class, Device::getId, MessageWarn::getDeviceId) .leftJoin(Device.class, Device::getId, MessageWarn::getDeviceId)
.leftJoin(Pond.class, Pond::getId, Device::getPondId) .leftJoin(Pond.class, Pond::getId, Device::getPondId)
@@ -101,7 +101,7 @@ public class MessageWarnServiceImpl implements IMessageWarnService {
.selectAs(Device::getDeviceName, MessageWarnVo::getDeviceName) .selectAs(Device::getDeviceName, MessageWarnVo::getDeviceName)
.selectAs(Device::getSerialNum, MessageWarnVo::getSerialNum) .selectAs(Device::getSerialNum, MessageWarnVo::getSerialNum)
.selectAs(Pond::getPondName, MessageWarnVo::getPondName) .selectAs(Pond::getPondName, MessageWarnVo::getPondName)
.select("(SELECT COUNT(*) FROM aqu_map_message_warn_call_notice map WHERE map.message_warn_id = t.id AND map.tenant_id = t.tenant_id) AS callNoticeCount") .select("(SELECT COUNT(DISTINCT n.mobile_phone) FROM aqu_map_message_warn_call_notice map INNER JOIN aqu_call_notice n ON n.id = map.call_notice_id WHERE map.message_warn_id = t.id AND map.tenant_id = t.tenant_id) AS callNoticeCount")
.leftJoin(AquUser.class, AquUser::getId, MessageWarn::getUserId) .leftJoin(AquUser.class, AquUser::getId, MessageWarn::getUserId)
.leftJoin(Device.class, Device::getId, MessageWarn::getDeviceId) .leftJoin(Device.class, Device::getId, MessageWarn::getDeviceId)
.leftJoin(Pond.class, Pond::getId, Device::getPondId) .leftJoin(Pond.class, Pond::getId, Device::getPondId)