添加查询站点已关联设备业务方法,零碎修改等
This commit is contained in:
parent
560c232fa0
commit
6c835034cd
@ -1,6 +1,8 @@
|
|||||||
package com.fastbee.ggroup.domain;
|
package com.fastbee.ggroup.domain;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
@ -23,6 +25,7 @@ public class GSiteMonitorInfo extends BaseEntity
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 站点ID,主键,自增长 */
|
/** 站点ID,主键,自增长 */
|
||||||
|
@TableId(type = com.baomidou.mybatisplus.annotation.IdType.AUTO)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 监测站点 */
|
/** 监测站点 */
|
||||||
|
@ -17,6 +17,9 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface GSiteDeviceMapper extends MPJBaseMapper<GSiteDevice>
|
public interface GSiteDeviceMapper extends MPJBaseMapper<GSiteDevice>
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询站点设备关系
|
* 查询站点设备关系
|
||||||
*
|
*
|
||||||
|
@ -14,6 +14,12 @@ import com.fastbee.iot.domain.Device;
|
|||||||
|
|
||||||
public interface IGSiteDeviceService
|
public interface IGSiteDeviceService
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询站点未关联的设备列表
|
||||||
|
*/
|
||||||
|
public List<GSiteDevice> selectUnbindDeviceList(Long siteId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询站点设备关系
|
* 查询站点设备关系
|
||||||
*
|
*
|
||||||
|
@ -3,6 +3,7 @@ package com.fastbee.ggroup.service.impl;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.fastbee.ggroup.domain.GSites;
|
||||||
import com.fastbee.ggroup.domain.dto.GSiteDeviceDto;
|
import com.fastbee.ggroup.domain.dto.GSiteDeviceDto;
|
||||||
import com.fastbee.ggroup.mapper.GSitesMapper;
|
import com.fastbee.ggroup.mapper.GSitesMapper;
|
||||||
import com.fastbee.iot.domain.Device;
|
import com.fastbee.iot.domain.Device;
|
||||||
@ -33,6 +34,23 @@ public class GSiteDeviceServiceImpl implements IGSiteDeviceService
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DeviceMapper deviceMapper;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询站点设备关系
|
* 查询站点设备关系
|
||||||
*
|
*
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
<include refid="selectGSiteDeviceVo"/>
|
<include refid="selectGSiteDeviceVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectUnbindDeviceList" resultType="com.fastbee.ggroup.domain.GSiteDevice"></select>
|
||||||
|
|
||||||
<insert id="insertGSiteDevice" parameterType="GSiteDevice" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertGSiteDevice" parameterType="GSiteDevice" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into g_site_device
|
insert into g_site_device
|
||||||
|
@ -339,4 +339,8 @@ public interface IDeviceService
|
|||||||
Map<String, Object> getvideourl(JiankongDeviceParam jiankongDeviceParam);
|
Map<String, Object> getvideourl(JiankongDeviceParam jiankongDeviceParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user