sensory get all general
This commit is contained in:
1 parent
b0e2e2ba75
commit
a8a5564078
5 files changed
+314
No files matched your search
@@ -128,6 +128,11 @@ public class SensorsController {
|
||||
List<temperatureFamily > getTemperatureById(@PathVariable("id") int id) {
|
||||
return sensorsDbApi.getTemperatureById(id);
|
||||
}
|
||||
@RequestMapping(value = APIServicePaths.GET_ALL_GENERAL)
|
||||
@ResponseBody
|
||||
List<Sensor_new > getAllGeneral() {
|
||||
return sensorsDbApi.getAllGeneral();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ public class SensorsDbApi {
|
||||
private static final String GET_ALL_SPEED_ID = "SELECT * FROM speedFamily nt WHERE nt.deviceSpecificationId = ?";
|
||||
private static final String GET_ALL_QUEUE_ID = "SELECT * FROM queueFamily nt WHERE nt.deviceSpecificationId = ?";
|
||||
private static final String GET_ALL_COUNTER_ID = "SELECT * FROM counterFamily nt WHERE nt.deviceSpecificationId = ?";
|
||||
private static final String GET_ALL_GENERAL = "SELECT sd.*, at.name as areaTypeName FROM sensorDevices sd LEFT JOIN deviceSpecifications ds ON sd.id = ds.sensorDevice_id LEFT JOIN areatypes at ON ds.areatype_id = at.id";
|
||||
|
||||
|
||||
private static final String OBJECT_COLUM_NNAME = "name";
|
||||
@@ -85,6 +86,9 @@ public class SensorsDbApi {
|
||||
public List<Sensor> getObjectsDetail() {
|
||||
return sensorsJdbcTemplate.query(GET_ALL_DETAIL_OBJECTS,new SensorsRowMapper());
|
||||
}
|
||||
public List<Sensor_new> getAllGeneral() {
|
||||
return sensorsJdbcTemplate.query(GET_ALL_GENERAL,new SensorsRowMapper_new());
|
||||
}
|
||||
|
||||
|
||||
public List<clockFamily> getClocks() {
|
||||
|
||||
@@ -42,6 +42,7 @@ public final class APIServicePaths {
|
||||
public static final String GET_QUEUE = "/queue";
|
||||
public static final String GET_SPEED = "/speed";
|
||||
public static final String GET_TEMPERATURE = "/temperature";
|
||||
public static final String GET_ALL_GENERAL = "/getallgeneral";
|
||||
|
||||
//PROFILE
|
||||
public static final String PROFILE_CONTROLLER = "/profile";
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package hello.agh.edu.bazy.row.mappers.sensors;
|
||||
|
||||
import hello.agh.edu.bazy.row.sensors.Sensor;
|
||||
import hello.agh.edu.bazy.row.sensors.Sensor_new;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* Created by lukasgol on 24.01.15.
|
||||
*/
|
||||
public class SensorsRowMapper_new implements RowMapper<Sensor_new> {
|
||||
|
||||
|
||||
@Override
|
||||
public Sensor_new mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||
Sensor_new sensor=new Sensor_new();
|
||||
sensor.setSensorId(rs.getInt("id"));
|
||||
sensor.setName(rs.getString("name"));
|
||||
sensor.setProducer(rs.getString("producer"));
|
||||
sensor.setModel(rs.getString("Model"));
|
||||
sensor.setDimensions(rs.getString("dimensions"));
|
||||
sensor.setWeight(rs.getString("weight"));
|
||||
sensor.setWirelessradiofrequency(rs.getString("wirelessradiofrequency"));
|
||||
sensor.setWirelessprotocol(rs.getString("wirelessprotocol"));
|
||||
sensor.setBluetooth(rs.getString("bluetooth"));
|
||||
sensor.setAvglifespan(rs.getFloat("avglifespan"));
|
||||
sensor.setCommunicatedistancemeters(rs.getInt("communicatedistancemeters"));
|
||||
sensor.setInstallingtime(rs.getString("installingtime"));
|
||||
sensor.setProtectionstandard(rs.getString("protectionstandard"));
|
||||
sensor.setProtectionstandard(rs.getString("protectionstandard"));
|
||||
sensor.setWorkcondition(rs.getString("workcondition"));
|
||||
sensor.setOperationmintemperature(rs.getFloat("operationmintemperature"));
|
||||
sensor.setOperationmaxtemperature(rs.getFloat("operationmaxtemperature"));
|
||||
sensor.setOperationmaxhumidity(rs.getFloat("operationmaxhumidity"));
|
||||
sensor.setStoragemintemparature(rs.getFloat("storagemintemparature"));
|
||||
sensor.setStoragemaxtemperature(rs.getFloat("storagemaxtemperature"));
|
||||
sensor.setPowersupply(rs.getString("powersupply"));
|
||||
sensor.setBatterypower(rs.getString("batterypower"));
|
||||
sensor.setBatterylife(rs.getString("batterylife"));
|
||||
sensor.setWirelessupdate(rs.getString("wirelessupdate"));
|
||||
|
||||
sensor.setAreatypename(rs.getString("areatypename"));
|
||||
return sensor;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
package hello.agh.edu.bazy.row.sensors;
|
||||
|
||||
/**
|
||||
* Created by lukasgol on 24.01.15.
|
||||
*/
|
||||
public class Sensor_new {
|
||||
int SensorId;
|
||||
String name;
|
||||
String producer;
|
||||
String model;
|
||||
String dimensions;
|
||||
String weight;
|
||||
String wirelessradiofrequency;
|
||||
String wirelessprotocol;
|
||||
String bluetooth;
|
||||
float avglifespan;
|
||||
int communicatedistancemeters;
|
||||
String installingtime;
|
||||
String protectionstandard;
|
||||
String workcondition;
|
||||
float operationmintemperature;
|
||||
float operationmaxtemperature;
|
||||
float operationmaxhumidity;
|
||||
float storagemintemparature;
|
||||
float storagemaxtemperature;
|
||||
String powersupply;
|
||||
String batterypower;
|
||||
String batterylife;
|
||||
String wirelessupdate;
|
||||
String areatypename;
|
||||
|
||||
public Sensor_new() {
|
||||
|
||||
}
|
||||
|
||||
public int getSensorId() {
|
||||
return SensorId;
|
||||
}
|
||||
|
||||
public void setSensorId(int sensorId) {
|
||||
SensorId = sensorId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getProducer() {
|
||||
return producer;
|
||||
}
|
||||
|
||||
public void setProducer(String producer) {
|
||||
this.producer = producer;
|
||||
}
|
||||
|
||||
public String getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public void setModel(String model) {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public String getDimensions() {
|
||||
return dimensions;
|
||||
}
|
||||
|
||||
public void setDimensions(String dimensions) {
|
||||
this.dimensions = dimensions;
|
||||
}
|
||||
|
||||
public String getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(String weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public String getWirelessradiofrequency() {
|
||||
return wirelessradiofrequency;
|
||||
}
|
||||
|
||||
public void setWirelessradiofrequency(String wirelessradiofrequency) {
|
||||
this.wirelessradiofrequency = wirelessradiofrequency;
|
||||
}
|
||||
|
||||
public String getWirelessprotocol() {
|
||||
return wirelessprotocol;
|
||||
}
|
||||
|
||||
public void setWirelessprotocol(String wirelessprotocol) {
|
||||
this.wirelessprotocol = wirelessprotocol;
|
||||
}
|
||||
|
||||
public String getBluetooth() {
|
||||
return bluetooth;
|
||||
}
|
||||
|
||||
public void setBluetooth(String bluetooth) {
|
||||
this.bluetooth = bluetooth;
|
||||
}
|
||||
|
||||
public float getAvglifespan() {
|
||||
return avglifespan;
|
||||
}
|
||||
|
||||
public void setAvglifespan(float avglifespan) {
|
||||
this.avglifespan = avglifespan;
|
||||
}
|
||||
|
||||
public int getCommunicatedistancemeters() {
|
||||
return communicatedistancemeters;
|
||||
}
|
||||
|
||||
public void setCommunicatedistancemeters(int communicatedistancemeters) {
|
||||
this.communicatedistancemeters = communicatedistancemeters;
|
||||
}
|
||||
|
||||
public String getInstallingtime() {
|
||||
return installingtime;
|
||||
}
|
||||
|
||||
public void setInstallingtime(String installingtime) {
|
||||
this.installingtime = installingtime;
|
||||
}
|
||||
|
||||
public String getProtectionstandard() {
|
||||
return protectionstandard;
|
||||
}
|
||||
|
||||
public void setProtectionstandard(String protectionstandard) {
|
||||
this.protectionstandard = protectionstandard;
|
||||
}
|
||||
|
||||
public String getWorkcondition() {
|
||||
return workcondition;
|
||||
}
|
||||
|
||||
public void setWorkcondition(String workcondition) {
|
||||
this.workcondition = workcondition;
|
||||
}
|
||||
|
||||
public float getOperationmintemperature() {
|
||||
return operationmintemperature;
|
||||
}
|
||||
|
||||
public void setOperationmintemperature(float operationmintemperature) {
|
||||
this.operationmintemperature = operationmintemperature;
|
||||
}
|
||||
|
||||
public float getOperationmaxtemperature() {
|
||||
return operationmaxtemperature;
|
||||
}
|
||||
|
||||
public void setOperationmaxtemperature(float operationmaxtemperature) {
|
||||
this.operationmaxtemperature = operationmaxtemperature;
|
||||
}
|
||||
|
||||
public float getOperationmaxhumidity() {
|
||||
return operationmaxhumidity;
|
||||
}
|
||||
|
||||
public void setOperationmaxhumidity(float operationmaxhumidity) {
|
||||
this.operationmaxhumidity = operationmaxhumidity;
|
||||
}
|
||||
|
||||
public float getStoragemintemparature() {
|
||||
return storagemintemparature;
|
||||
}
|
||||
|
||||
public void setStoragemintemparature(float storagemintemparature) {
|
||||
this.storagemintemparature = storagemintemparature;
|
||||
}
|
||||
|
||||
public float getStoragemaxtemperature() {
|
||||
return storagemaxtemperature;
|
||||
}
|
||||
|
||||
public void setStoragemaxtemperature(float storagemaxtemperature) {
|
||||
this.storagemaxtemperature = storagemaxtemperature;
|
||||
}
|
||||
|
||||
public String getPowersupply() {
|
||||
return powersupply;
|
||||
}
|
||||
|
||||
public void setPowersupply(String powersupply) {
|
||||
this.powersupply = powersupply;
|
||||
}
|
||||
|
||||
public String getBatterypower() {
|
||||
return batterypower;
|
||||
}
|
||||
|
||||
public void setBatterypower(String batterypower) {
|
||||
this.batterypower = batterypower;
|
||||
}
|
||||
|
||||
public String getBatterylife() {
|
||||
return batterylife;
|
||||
}
|
||||
|
||||
public void setBatterylife(String batterylife) {
|
||||
this.batterylife = batterylife;
|
||||
}
|
||||
|
||||
public String getWirelessupdate() {
|
||||
return wirelessupdate;
|
||||
}
|
||||
|
||||
public void setWirelessupdate(String wirelessupdate) {
|
||||
this.wirelessupdate = wirelessupdate;
|
||||
}
|
||||
|
||||
public String getAreatypename() {
|
||||
return areatypename;
|
||||
}
|
||||
|
||||
public void setAreatypename(String areatypename) {
|
||||
this.areatypename = areatypename;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Sensor{" +
|
||||
"SensorId=" + SensorId +
|
||||
", name='" + name + '\'' +
|
||||
", producer='" + producer + '\'' +
|
||||
", model='" + model + '\'' +
|
||||
", dimensions='" + dimensions + '\'' +
|
||||
", weight='" + weight + '\'' +
|
||||
", wirelessradiofrequency='" + wirelessradiofrequency + '\'' +
|
||||
", wirelessprotocol='" + wirelessprotocol + '\'' +
|
||||
", bluetooth='" + bluetooth + '\'' +
|
||||
", avglifespan=" + avglifespan +
|
||||
", communicatedistancemeters=" + communicatedistancemeters +
|
||||
", installingtime='" + installingtime + '\'' +
|
||||
", protectionstandard='" + protectionstandard + '\'' +
|
||||
", workcondition='" + workcondition + '\'' +
|
||||
", operationmintemperature=" + operationmintemperature +
|
||||
", operationmaxtemperature=" + operationmaxtemperature +
|
||||
", operationmaxhumidity=" + operationmaxhumidity +
|
||||
", storagemintemparature=" + storagemintemparature +
|
||||
", storagemaxtemperature=" + storagemaxtemperature +
|
||||
", powersupply='" + powersupply + '\'' +
|
||||
", batterypower='" + batterypower + '\'' +
|
||||
", batterylife='" + batterylife + '\'' +
|
||||
", wirelessupdate='" + wirelessupdate + '\''+
|
||||
'}';
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user