You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.8 KiB
55 lines
1.8 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Monitor.Models;
|
|
using DataBase.MySql.Tool;
|
|
using Monitor.LogService;
|
|
|
|
namespace Module.EMeter.ModbusTcp
|
|
{
|
|
/// <summary>
|
|
/// 电表值存储到MySQL
|
|
/// </summary>
|
|
public class ElecMeterParamToMySQL
|
|
{
|
|
/// <summary>
|
|
/// 新增电表能耗累计值信息到数据表
|
|
/// </summary>
|
|
/// <param name="eqmNo">仪表编码</param>
|
|
/// <param name="val">能耗累计值</param>
|
|
/// <param name="time">采集时刻</param>
|
|
public async void AddTotalEnergyToMySql(string eqmNo,UInt32 val,DateTime time)
|
|
{
|
|
TEgEmeterTotalEnergyValue mdlVal = new TEgEmeterTotalEnergyValue()
|
|
{
|
|
FEmeterNo = eqmNo,
|
|
FTotalValue = val,
|
|
FTime = time
|
|
};
|
|
await new SEgEMeterTotalEnergyValue().AddEMeterTotalEnergyValue(mdlVal);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 新增电表小时能耗信息到数据表
|
|
/// </summary>
|
|
/// <param name="eqmNo">仪表编码</param>
|
|
/// <param name="val">小时能耗值</param>
|
|
/// <param name="startTime">开始时刻</param>
|
|
/// <param name="endTime">结束时刻</param>
|
|
public async void AddHourEnergyToMySql(string eqmNo, UInt32 val, DateTime startTime,DateTime endTime)
|
|
{
|
|
TEgEmeterHourEnergyValue mdlVal = new TEgEmeterHourEnergyValue()
|
|
{
|
|
FEmeterNo = eqmNo,
|
|
FHourValue = val,
|
|
FStartTime = startTime,
|
|
FEndTime = endTime
|
|
};
|
|
await new SEgEMeterHourEnergyValue().AddEMeterHourEnergyValue(mdlVal);
|
|
}
|
|
|
|
}
|
|
}
|