#增加了根据设备编号的时间戳查询设备的接口
This commit is contained in:
@@ -281,6 +281,14 @@ public class DeviceController extends BaseController {
|
||||
return getDataTable(deviceService.getDeviceList(getLoginUser(), device));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备列表 分配页面
|
||||
*/
|
||||
@GetMapping("/getDeviceBySpiltCode")
|
||||
public AjaxResult getDeviceBySpiltCode(@RequestParam String code) {
|
||||
return AjaxResult.success(deviceService.getDeviceBySpiltCode(code));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备授权修改
|
||||
*/
|
||||
|
||||
@@ -91,4 +91,6 @@ public interface DeviceMapper extends BaseMapperX<Device> {
|
||||
*/
|
||||
public List<String> selectSerialNumbersByProductId(@Param("productId") Long productId);
|
||||
|
||||
|
||||
public Device selectDeviceBySpiltCode(@Param("code") String code);
|
||||
}
|
||||
|
||||
@@ -92,6 +92,8 @@ public interface IDeviceService {
|
||||
|
||||
public List<Device> getDeviceList(LoginUser loginUser, Device device);
|
||||
|
||||
public Device getDeviceBySpiltCode(String code);
|
||||
|
||||
public boolean paramModifyAuth(DeviceParamAuthDTO dto);
|
||||
|
||||
public boolean hasPermission(String deviceId);
|
||||
|
||||
@@ -382,6 +382,12 @@ public class DeviceServiceImpl implements IDeviceService {
|
||||
return deviceList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Device getDeviceBySpiltCode(String code) {
|
||||
return deviceMapper.selectDeviceBySpiltCode(code);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean paramModifyAuth(DeviceParamAuthDTO dto) {
|
||||
if (dto != null && !StringUtils.isEmpty(dto.getDeviceId())) {
|
||||
|
||||
@@ -261,6 +261,11 @@
|
||||
where serial_number = #{serialNumber}
|
||||
</select>
|
||||
|
||||
<select id="selectDeviceBySpiltCode" parameterType="String" resultMap="DeviceResult">
|
||||
<include refid="selectDeviceVo"/>
|
||||
where device_name like concat('%', #{code}, '%')
|
||||
</select>
|
||||
|
||||
<select id="selectDeviceCountBySerialNumber" parameterType="String" resultType="int">
|
||||
select count(device_id)
|
||||
from iot_device
|
||||
|
||||
Reference in New Issue
Block a user