infoByGbDeviceId 调整
This commit is contained in:
parent
2e42490440
commit
5cbd6a6b49
@ -21,6 +21,8 @@ import org.springframework.context.annotation.Bean;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Tag(name = "设备信息")
|
@Tag(name = "设备信息")
|
||||||
@RestController
|
@RestController
|
||||||
@ -55,8 +57,8 @@ public class DeviceController {
|
|||||||
|
|
||||||
@Operation(summary = "根据国标id(20位) 查询指定设备信息")
|
@Operation(summary = "根据国标id(20位) 查询指定设备信息")
|
||||||
@GetJson("/info/gbDeviceId")
|
@GetJson("/info/gbDeviceId")
|
||||||
public JsonResponse<WvpProxyDevice> infoByGbDeviceId(@RequestParam String gbDeviceId) {
|
public JsonResponse<List<WvpProxyDevice>> infoByGbDeviceId(@RequestParam String gbDeviceId) {
|
||||||
WvpProxyDevice wvpProxyDevice = deviceService.getDeviceByGbDeviceId(gbDeviceId).orElse(null);
|
List<WvpProxyDevice> wvpProxyDevice = deviceService.getDeviceByGbDeviceId(gbDeviceId);
|
||||||
return JsonResponse.success(wvpProxyDevice);
|
return JsonResponse.success(wvpProxyDevice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;
|
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;
|
||||||
@ -35,8 +36,8 @@ public class DeviceService {
|
|||||||
s.where(WvpProxyDeviceDynamicSqlSupport.deviceCode,isEqualTo(deviceCode)));
|
s.where(WvpProxyDeviceDynamicSqlSupport.deviceCode,isEqualTo(deviceCode)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<WvpProxyDevice> getDeviceByGbDeviceId(String gbDeviceId){
|
public List<WvpProxyDevice> getDeviceByGbDeviceId(String gbDeviceId){
|
||||||
return deviceMapper.selectOne(s->
|
return deviceMapper.select(s->
|
||||||
s.where(WvpProxyDeviceDynamicSqlSupport.gbDeviceId,isEqualTo(gbDeviceId)));
|
s.where(WvpProxyDeviceDynamicSqlSupport.gbDeviceId,isEqualTo(gbDeviceId)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user