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