添加查询站点已关联设备业务方法,零碎修改等

This commit is contained in:
mi9688 2024-12-02 17:47:50 +08:00
parent 560c232fa0
commit 6c835034cd
6 changed files with 35 additions and 0 deletions

View File

@ -1,6 +1,8 @@
package com.fastbee.ggroup.domain;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
@ -23,6 +25,7 @@ public class GSiteMonitorInfo extends BaseEntity
private static final long serialVersionUID = 1L;
/** 站点ID主键自增长 */
@TableId(type = com.baomidou.mybatisplus.annotation.IdType.AUTO)
private Long id;
/** 监测站点 */

View File

@ -17,6 +17,9 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface GSiteDeviceMapper extends MPJBaseMapper<GSiteDevice>
{
/**
* 查询站点设备关系
*

View File

@ -14,6 +14,12 @@ import com.fastbee.iot.domain.Device;
public interface IGSiteDeviceService
{
/**
* 查询站点未关联的设备列表
*/
public List<GSiteDevice> selectUnbindDeviceList(Long siteId);
/**
* 查询站点设备关系
*

View File

@ -3,6 +3,7 @@ package com.fastbee.ggroup.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.fastbee.ggroup.domain.GSites;
import com.fastbee.ggroup.domain.dto.GSiteDeviceDto;
import com.fastbee.ggroup.mapper.GSitesMapper;
import com.fastbee.iot.domain.Device;
@ -33,6 +34,23 @@ public class GSiteDeviceServiceImpl implements IGSiteDeviceService
@Autowired
private DeviceMapper deviceMapper;
/**
* 查询设备
* @param siteId
* @return
*/
@Override
public List<GSiteDevice> selectUnbindDeviceList(Long siteId) {
MPJLambdaWrapper<Device> objectMPJLambdaWrapper = new MPJLambdaWrapper<Device>()
.select(Device::getDeviceId, Device::getDeviceName)
.select(GSiteDevice::getSiteId, GSiteDevice::getDeviceId)
.leftJoin(GSites.class, GSites::getId, GSiteDevice::getSiteId);
List<GSiteDevice> gSiteDevices = deviceMapper.selectJoinList(GSiteDevice.class, objectMPJLambdaWrapper);
return gSiteDevices;
}
/**
* 查询站点设备关系
*

View File

@ -26,6 +26,7 @@
<include refid="selectGSiteDeviceVo"/>
where id = #{id}
</select>
<select id="selectUnbindDeviceList" resultType="com.fastbee.ggroup.domain.GSiteDevice"></select>
<insert id="insertGSiteDevice" parameterType="GSiteDevice" useGeneratedKeys="true" keyProperty="id">
insert into g_site_device

View File

@ -339,4 +339,8 @@ public interface IDeviceService
Map<String, Object> getvideourl(JiankongDeviceParam jiankongDeviceParam);
/**
*
*/
}