|
@@ -15,10 +15,10 @@ namespace MeterVision.db
|
|
|
{
|
|
|
// 构建插入的 SQL 语句
|
|
|
string sql = "INSERT INTO t_station (id,station_id, station_name, device_sn,meter_type, bright_val, flow_rate, " +
|
|
|
- "dial_region, num_count, ind_count, num_region, ht_region, last_num_unit, last_ind_unit, " +
|
|
|
+ "dial_region, num_count, ind_count, feature_region, last_unit, " +
|
|
|
"last_value, last_time, create_time, stand_id) " +
|
|
|
"VALUES (@StationId, @StationName, @DeviceSn, @MeterType, @BrightVal, @FlowRate, " +
|
|
|
- "@DialRegion, @NumCount, @IndCount, @NumRegion, @HtRegion, @LastNumUnit, @LastIndUnit, " +
|
|
|
+ "@DialRegion, @NumCount, @IndCount, @FeatureRegion, @LastUnit, " +
|
|
|
"@LastValue, @LastTime, @CreateTime, @StandId)";
|
|
|
|
|
|
// 创建参数数组
|
|
@@ -34,10 +34,8 @@ namespace MeterVision.db
|
|
|
new SQLiteParameter("@DialRegion", tStation.DialRegion),
|
|
|
new SQLiteParameter("@NumCount", tStation.NumCount),
|
|
|
new SQLiteParameter("@IndCount", tStation.IndCount),
|
|
|
- new SQLiteParameter("@NumRegion", tStation.NumRegion),
|
|
|
- new SQLiteParameter("@HtRegion", tStation.HtRegion),
|
|
|
- new SQLiteParameter("@LastNumUnit", tStation.LastNumUnit),
|
|
|
- new SQLiteParameter("@LastIndUnit", tStation.LastIndUnit),
|
|
|
+ new SQLiteParameter("@FeatureRegion", tStation.FeatureRegion),
|
|
|
+ new SQLiteParameter("@LastUnit", tStation.LastUnit),
|
|
|
new SQLiteParameter("@LastValue", tStation.LastValue),
|
|
|
new SQLiteParameter("@LastTime", tStation.LastTime),
|
|
|
new SQLiteParameter("@CreateTime", tStation.CreateTime),
|
|
@@ -63,8 +61,8 @@ namespace MeterVision.db
|
|
|
public static bool InsertTStations(List<StationInfo> stationInfos)
|
|
|
{
|
|
|
string sql = @"
|
|
|
- INSERT INTO t_station (id, stand_id,create_time, station_id, device_sn, num_count, last_num_unit)
|
|
|
- VALUES (@Id, @StandId, @CreateTime, @StationId, @DeviceSn, @NumCount, @LastNumUnit);";
|
|
|
+ INSERT INTO t_station (id, stand_id,create_time, station_id, device_sn, num_count, last_unit)
|
|
|
+ VALUES (@Id, @StandId, @CreateTime, @StationId, @DeviceSn, @NumCount, @LastUnit);";
|
|
|
|
|
|
try
|
|
|
{
|
|
@@ -85,7 +83,7 @@ namespace MeterVision.db
|
|
|
new SQLiteParameter("@StationId", stationInfo.StationId),
|
|
|
new SQLiteParameter("@DeviceSn", stationInfo.DeviceSn),
|
|
|
new SQLiteParameter("@NumCount", stationInfo.NumCount),
|
|
|
- new SQLiteParameter("@LastNumUnit", stationInfo.LastUnit2)
|
|
|
+ new SQLiteParameter("@LastUnit", stationInfo.LastUnit2)
|
|
|
};
|
|
|
|
|
|
// 执行插入操作
|
|
@@ -115,7 +113,7 @@ namespace MeterVision.db
|
|
|
// 定义 SQL 查询语句的基础部分
|
|
|
string sql = @"
|
|
|
SELECT id,station_id, station_name, device_sn,meter_type, bright_val, flow_rate, dial_region,
|
|
|
- num_count, ind_count, num_region, ht_region, last_num_unit, last_ind_unit,
|
|
|
+ num_count, ind_count, feature_region, last_unit,
|
|
|
last_value, last_time, create_time,stand_id
|
|
|
FROM t_station ";
|
|
|
|
|
@@ -160,10 +158,8 @@ namespace MeterVision.db
|
|
|
DialRegion = reader.GetString(reader.GetOrdinal("dial_region")),
|
|
|
NumCount = reader.GetInt32(reader.GetOrdinal("num_count")),
|
|
|
IndCount = reader.GetInt32(reader.GetOrdinal("ind_count")),
|
|
|
- NumRegion = reader.GetString(reader.GetOrdinal("num_region")),
|
|
|
- HtRegion = reader.GetString(reader.GetOrdinal("ht_region")),
|
|
|
- LastNumUnit = reader.GetDouble(reader.GetOrdinal("last_num_unit")),
|
|
|
- LastIndUnit = reader.GetDouble(reader.GetOrdinal("last_ind_unit")),
|
|
|
+ FeatureRegion = reader.GetString(reader.GetOrdinal("feature_region")),
|
|
|
+ LastUnit = reader.GetDouble(reader.GetOrdinal("last_unit")),
|
|
|
LastValue = reader.GetDouble(reader.GetOrdinal("last_value")),
|
|
|
LastTime = reader.GetString(reader.GetOrdinal("last_time")),
|
|
|
CreateTime = reader.GetString(reader.GetOrdinal("create_time")),
|
|
@@ -286,7 +282,7 @@ namespace MeterVision.db
|
|
|
// 查询分页数据
|
|
|
string sql = $@"
|
|
|
SELECT id, station_id, station_name, device_sn, meter_type, bright_val, flow_rate, dial_region,
|
|
|
- num_count, ind_count, num_region, ht_region, last_num_unit, last_ind_unit,
|
|
|
+ num_count, ind_count, feature_region, last_unit,
|
|
|
last_value, last_time, create_time, stand_id
|
|
|
{baseSql}
|
|
|
ORDER BY station_id ASC
|
|
@@ -327,10 +323,8 @@ namespace MeterVision.db
|
|
|
DialRegion = reader.GetString(reader.GetOrdinal("dial_region")),
|
|
|
NumCount = reader.GetInt32(reader.GetOrdinal("num_count")),
|
|
|
IndCount = reader.GetInt32(reader.GetOrdinal("ind_count")),
|
|
|
- NumRegion = reader.GetString(reader.GetOrdinal("num_region")),
|
|
|
- HtRegion = reader.GetString(reader.GetOrdinal("ht_region")),
|
|
|
- LastNumUnit = reader.GetDouble(reader.GetOrdinal("last_num_unit")),
|
|
|
- LastIndUnit = reader.GetDouble(reader.GetOrdinal("last_ind_unit")),
|
|
|
+ FeatureRegion = reader.GetString(reader.GetOrdinal("feature_region")),
|
|
|
+ LastUnit = reader.GetDouble(reader.GetOrdinal("last_unit")),
|
|
|
LastValue = reader.GetDouble(reader.GetOrdinal("last_value")),
|
|
|
LastTime = reader.GetString(reader.GetOrdinal("last_time")),
|
|
|
CreateTime = reader.GetString(reader.GetOrdinal("create_time")),
|
|
@@ -391,10 +385,8 @@ namespace MeterVision.db
|
|
|
dial_region = @DialRegion,
|
|
|
num_count = @NumCount,
|
|
|
ind_count = @IndCount,
|
|
|
- num_region = @NumRegion,
|
|
|
- ht_region = @HtRegion,
|
|
|
- last_num_unit = @LastNumUnit,
|
|
|
- last_ind_unit = @LastIndUnit,
|
|
|
+ feature_region = @FeatureRegion,
|
|
|
+ last_unit = @LastUnit,
|
|
|
last_value = @LastValue,
|
|
|
last_time = @LastTime
|
|
|
WHERE id = @Id";
|
|
@@ -411,10 +403,8 @@ namespace MeterVision.db
|
|
|
new SQLiteParameter("@DialRegion", tStation.DialRegion),
|
|
|
new SQLiteParameter("@NumCount", tStation.NumCount),
|
|
|
new SQLiteParameter("@IndCount", tStation.IndCount),
|
|
|
- new SQLiteParameter("@NumRegion", tStation.NumRegion),
|
|
|
- new SQLiteParameter("@HtRegion", tStation.HtRegion),
|
|
|
- new SQLiteParameter("@LastNumUnit", tStation.LastNumUnit),
|
|
|
- new SQLiteParameter("@LastIndUnit", tStation.LastIndUnit),
|
|
|
+ new SQLiteParameter("@FeatureRegion", tStation.FeatureRegion),
|
|
|
+ new SQLiteParameter("@LastUnit", tStation.LastUnit),
|
|
|
new SQLiteParameter("@LastValue", tStation.LastValue),
|
|
|
new SQLiteParameter("@LastTime", tStation.LastTime)
|
|
|
};
|