This commit is contained in:
2026-07-09 08:40:32 +08:00
parent caf4e2c415
commit 8f7a35e3c7
44 changed files with 1328 additions and 188 deletions

View File

@@ -3,8 +3,6 @@ package com.maibu.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.maibu.core.business.DeviceModel;
import java.util.List;
/**
* @author jsmbz
* @description 针对表【iot_device_model(设备模型表)】的数据库操作Service
@@ -13,6 +11,7 @@ import java.util.List;
public interface SysDeviceModelService {
/**
* 新增设备模型
*
* @param deviceModel
* @return
*/
@@ -20,7 +19,8 @@ public interface SysDeviceModelService {
/**
* 分页查询设备模型列表
* @param page 分页对象
*
* @param page 分页对象
* @param deviceModel 查询条件
* @return 分页结果
*/
@@ -28,6 +28,7 @@ public interface SysDeviceModelService {
/**
* selectDeviceModelById
*
* @param id
* @return
*/
@@ -35,6 +36,7 @@ public interface SysDeviceModelService {
/**
* updateDeviceModel
*
* @param deviceModel
* @return
*/
@@ -42,6 +44,7 @@ public interface SysDeviceModelService {
/**
* 删除(逻辑删除模型)
*
* @param id
* @return
*/

View File

@@ -5,6 +5,9 @@ import com.maibu.core.domain.entity.SysSite;
import com.maibu.exception.ServiceException;
import com.maibu.mapper.SysRegionMapper;
import com.maibu.mapper.SysSiteMapper;
import com.maibu.memory.GlobalMemory;
import com.maibu.memory.SiteMemory;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -13,7 +16,6 @@ import org.springframework.util.CollectionUtils;
import java.util.List;
@Service
public class SysSiteService {
@@ -23,21 +25,25 @@ public class SysSiteService {
@Autowired
private SysRegionService sysRegionService;
public List<SysSite> list(SysSite site) {
LambdaQueryWrapper<SysSite> queryWrapper = new LambdaQueryWrapper<>();
if (site != null && !StringUtils.isEmpty(site.getSiteName())) {
queryWrapper.like(SysSite::getSiteName, site.getSiteName());
}
if (site != null && site.getOrgId()!=null) {
if (site != null && site.getOrgId() != null) {
queryWrapper.eq(SysSite::getOrgId, site.getOrgId());
}
queryWrapper.orderByAsc(SysSite::getOrgId);
return sysSiteMapper.selectList(queryWrapper);
}
public boolean save(SysSite org) {
return sysSiteMapper.saveOrUpdate(org);
public boolean save(SysSite site) {
boolean b = sysSiteMapper.saveOrUpdate(site);
SiteMemory siteMemory = GlobalMemory.getSiteMemory(site.getOrgId(), site.getId());
if (siteMemory != null) {
siteMemory.setSysSite(site);
}
return b;
}
@Transactional
@@ -46,7 +52,6 @@ public class SysSiteService {
return sysSiteMapper.deleteBatchIds(ids);
}
public boolean checkExistSite(Long id) {
List<SysSite> sysSites = selectByOrgId(id);
if (CollectionUtils.isEmpty(sysSites)) {