sqlsugar 5.4.95升级到 5.4.116 测试增删改查 生成entity

master
lxw 6 months ago
parent 4810d7f93a
commit 20e069a2a8

@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="log4net" Version="2.0.15"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3"/>
<PackageReference Include="SqlSugarCore" Version="5.1.4.95"/>
<PackageReference Include="SqlSugarCore" Version="5.1.4.115"/>
</ItemGroup>
<ItemGroup>

@ -0,0 +1,83 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///电池分组表
///</summary>
[SugarTable("battery_group")]
public partial class BatteryGroup
{
public BatteryGroup(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
/// <summary>
/// Desc:id
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(IsPrimaryKey=true,IsIdentity=true,ColumnName="id")]
public int Id {get;set;}
/// <summary>
/// Desc:电池编码
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="battery_no")]
public string BatteryNo {get;set;}
/// <summary>
/// Desc:电池分组编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="group")]
public int? Group {get;set;}
/// <summary>
/// Desc:电池分组数量
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="group_count")]
public int? GroupCount {get;set;}
}
}

@ -0,0 +1,51 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///电池信息表
///</summary>
[SugarTable("battery_info")]
public partial class BatteryInfo
{
public BatteryInfo(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
}
}

@ -0,0 +1,195 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///仓位信息表
///</summary>
[SugarTable("bin_info")]
public partial class BinInfo
{
public BinInfo(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
/// <summary>
/// Desc:id
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="id")]
public string Id {get;set;}
/// <summary>
/// Desc:仓位编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="no")]
public string No {get;set;}
/// <summary>
/// Desc:仓位编码
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="code")]
public string Code {get;set;}
/// <summary>
/// Desc:仓位名称
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="name")]
public string Name {get;set;}
/// <summary>
/// Desc:电池编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="battery_no")]
public string BatteryNo {get;set;}
/// <summary>
/// Desc:充电机编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="charger_no")]
public string ChargerNo {get;set;}
/// <summary>
/// Desc:充电枪编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="charger_gun_no")]
public string ChargerGunNo {get;set;}
/// <summary>
/// Desc:水冷编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="water_cool_no")]
public string WaterCoolNo {get;set;}
/// <summary>
/// Desc:是否有电插头;0-无电插头1-有电插头
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="elec_plugin_flag")]
public int? ElecPluginFlag {get;set;}
/// <summary>
/// Desc:电插头状态;0-未知1-已经连接2-未连接
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="elec_plugin_status")]
public string ElecPluginStatus {get;set;}
/// <summary>
/// Desc:是否有水插头;0-无水插头1-有水插头
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(ColumnName="water_plugin_flag")]
public string WaterPluginFlag {get;set;}
/// <summary>
/// Desc:预约锁定;0-未锁定1-锁定
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="amt_lock")]
public string AmtLock {get;set;}
/// <summary>
/// Desc:soc
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="soc")]
public decimal? Soc {get;set;}
/// <summary>
/// Desc:soe
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="soe")]
public decimal? Soe {get;set;}
/// <summary>
/// Desc:soh
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="soh")]
public decimal? Soh {get;set;}
/// <summary>
/// Desc:电池入仓顺序
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="battery_enter_seq")]
public int? BatteryEnterSeq {get;set;}
/// <summary>
/// Desc:充电状态;0-未知1-正在充电2-无电池3-禁用
/// Default:0
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="charge_status")]
public int? ChargeStatus {get;set;}
/// <summary>
/// Desc:仓位状态;0-禁用1-启用
/// Default:1
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="status")]
public int? Status {get;set;}
}
}

@ -0,0 +1,243 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///充电订单;充电订单表
///</summary>
[SugarTable("charge_order")]
public partial class ChargeOrder
{
public ChargeOrder(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
/// <summary>
/// Desc:id
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(IsPrimaryKey=true,IsIdentity=true,ColumnName="id")]
public int Id {get;set;}
/// <summary>
/// Desc:订单编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="sn")]
public string Sn {get;set;}
/// <summary>
/// Desc:电池编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="battery_no")]
public string BatteryNo {get;set;}
/// <summary>
/// Desc:启动报文状态;0-初始化1-启动成功
/// Default:0
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="cmd_status")]
public int? CmdStatus {get;set;}
/// <summary>
/// Desc:充电机编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="charger_no")]
public string ChargerNo {get;set;}
/// <summary>
/// Desc:充电枪编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="charger_gun_no")]
public string ChargerGunNo {get;set;}
/// <summary>
/// Desc:充电开始时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="start_time")]
public DateTime? StartTime {get;set;}
/// <summary>
/// Desc:充电结束时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="end_time")]
public DateTime? EndTime {get;set;}
/// <summary>
/// Desc:充电开始soc
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="start_soc")]
public int? StartSoc {get;set;}
/// <summary>
/// Desc:充电结束soc
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="stop_soc")]
public int? StopSoc {get;set;}
/// <summary>
/// Desc:充电时长
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="charge_time_count")]
public string ChargeTimeCount {get;set;}
/// <summary>
/// Desc:充电电量
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="elec_count")]
public decimal? ElecCount {get;set;}
/// <summary>
/// Desc:充电开始交流表电量
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="start_ac_elec")]
public decimal? StartAcElec {get;set;}
/// <summary>
/// Desc:充电结束交流表电量
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="stop_ac_elec")]
public decimal? StopAcElec {get;set;}
/// <summary>
/// Desc:充电开始直流表电量
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="start_dc_elec")]
public decimal? StartDcElec {get;set;}
/// <summary>
/// Desc:充电结束直流表电量
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="stop_dc_elec")]
public decimal? StopDcElec {get;set;}
/// <summary>
/// Desc:停止原因;0满电自动停止1-人工停止
/// Default:0
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="stop_reason")]
public int? StopReason {get;set;}
/// <summary>
/// Desc:尖时段电量
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="sharp_elec_count")]
public decimal? SharpElecCount {get;set;}
/// <summary>
/// Desc:峰时段电量
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="peak_elec_count")]
public decimal? PeakElecCount {get;set;}
/// <summary>
/// Desc:平时段电量
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="flat_elec_count")]
public decimal? FlatElecCount {get;set;}
/// <summary>
/// Desc:谷时段电量
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="valley_elec_count")]
public decimal? ValleyElecCount {get;set;}
/// <summary>
/// Desc:电价版本号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="elec_price_model_version")]
public string ElecPriceModelVersion {get;set;}
/// <summary>
/// Desc:换电订单编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="swap_order_sn")]
public string SwapOrderSn {get;set;}
/// <summary>
/// Desc:上传云平台状态;0-未上传1-已上传
/// Default:0
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="cloud_report_status")]
public int? CloudReportStatus {get;set;}
}
}

@ -0,0 +1,83 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///电价模型板板;电价模型版本表,生失效时间左开右闭且不能重叠
///</summary>
[SugarTable("elec_price_model_version")]
public partial class ElecPriceModelVersion
{
public ElecPriceModelVersion(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
/// <summary>
/// Desc:主键
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(IsPrimaryKey=true,IsIdentity=true,ColumnName="id")]
public int Id {get;set;}
/// <summary>
/// Desc:版本号;版本号,唯一
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="version")]
public string Version {get;set;}
/// <summary>
/// Desc:生效时间;生效时间(左开右闭)
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="start_time")]
public DateTime? StartTime {get;set;}
/// <summary>
/// Desc:失效时间;失效时间(左开右闭)
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="end_time")]
public DateTime? EndTime {get;set;}
}
}

@ -0,0 +1,99 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///电价模型详情
///</summary>
[SugarTable("elec_price_model_version_detail")]
public partial class ElecPriceModelVersionDetail
{
public ElecPriceModelVersionDetail(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
/// <summary>
/// Desc:id
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(IsPrimaryKey=true,IsIdentity=true,ColumnName="id")]
public int Id {get;set;}
/// <summary>
/// Desc:版本号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="version")]
public string Version {get;set;}
/// <summary>
/// Desc:开始时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="start_time")]
public DateTime? StartTime {get;set;}
/// <summary>
/// Desc:结束时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="end_time")]
public DateTime? EndTime {get;set;}
/// <summary>
/// Desc:价格;以分为单位存储
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="price")]
public int? Price {get;set;}
/// <summary>
/// Desc:尖峰平谷类型;1-尖2-峰3-平4-谷
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="type")]
public int? Type {get;set;}
}
}

@ -0,0 +1,51 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///设备报警等级
///</summary>
[SugarTable("equip_alarm_level")]
public partial class EquipAlarmLevel
{
public EquipAlarmLevel(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
}
}

@ -0,0 +1,51 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///设备报警处理方法
///</summary>
[SugarTable("equip_alarm_process_method")]
public partial class EquipAlarmProcessMethod
{
public EquipAlarmProcessMethod(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
}
}

@ -0,0 +1,51 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///设备报警处理记录
///</summary>
[SugarTable("equip_alarm_process_record")]
public partial class EquipAlarmProcessRecord
{
public EquipAlarmProcessRecord(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
}
}

@ -0,0 +1,51 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///设备报警记录
///</summary>
[SugarTable("equip_alarm_record")]
public partial class EquipAlarmRecord
{
public EquipAlarmRecord(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
}
}

@ -0,0 +1,51 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///设备报警类型
///</summary>
[SugarTable("equip_alarm_type")]
public partial class EquipAlarmType
{
public EquipAlarmType(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
}
}

@ -0,0 +1,51 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///设备报警类型阀值
///</summary>
[SugarTable("equip_alarm_type_value")]
public partial class EquipAlarmTypeValue
{
public EquipAlarmTypeValue(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
}
}

@ -0,0 +1,91 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///设备信息表
///</summary>
[SugarTable("equip_info")]
public partial class EquipInfo
{
public EquipInfo(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
/// <summary>
/// Desc:id
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(IsPrimaryKey=true,IsIdentity=true,ColumnName="id")]
public int Id {get;set;}
/// <summary>
/// Desc:设备编码
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="code")]
public string Code {get;set;}
/// <summary>
/// Desc:设备名称
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="name")]
public string Name {get;set;}
/// <summary>
/// Desc:设备类型编码
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="type_code")]
public string TypeCode {get;set;}
/// <summary>
/// Desc:设备状态;0-未知1-正常2-报警3-停用
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="status")]
public int? Status {get;set;}
}
}

@ -0,0 +1,91 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///设备通信信息表
///</summary>
[SugarTable("equip_net_info")]
public partial class EquipNetInfo
{
public EquipNetInfo(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
/// <summary>
/// Desc:设备id
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="id")]
public string Id {get;set;}
/// <summary>
/// Desc:设备编码
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="code")]
public string Code {get;set;}
/// <summary>
/// Desc:连接地址
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="net_addr")]
public string NetAddr {get;set;}
/// <summary>
/// Desc:连接端口
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="net_port")]
public string NetPort {get;set;}
/// <summary>
/// Desc:目的地址;十六进制如0a,02,03,04
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="dest_addr")]
public string DestAddr {get;set;}
}
}

@ -0,0 +1,83 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///设备类型表
///</summary>
[SugarTable("equip_type")]
public partial class EquipType
{
public EquipType(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
/// <summary>
/// Desc:id
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="id")]
public string Id {get;set;}
/// <summary>
/// Desc:类型编码
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="code")]
public string Code {get;set;}
/// <summary>
/// Desc:类型名称
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="name")]
public string Name {get;set;}
/// <summary>
/// Desc:是否启用;0-禁用1-启用
/// Default:1
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="enabled")]
public int? Enabled {get;set;}
}
}

@ -0,0 +1,99 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///选包规则表
///</summary>
[SugarTable("select_battery_rule")]
public partial class SelectBatteryRule
{
public SelectBatteryRule(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
/// <summary>
/// Desc:id
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(IsPrimaryKey=true,IsIdentity=true,ColumnName="id")]
public int Id {get;set;}
/// <summary>
/// Desc:规则编码
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="code")]
public string Code {get;set;}
/// <summary>
/// Desc:规则名称
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="name")]
public string Name {get;set;}
/// <summary>
/// Desc:是否启用;1-启用;
/// Default:1
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="enabled")]
public int? Enabled {get;set;}
/// <summary>
/// Desc:限制值
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="limit_value")]
public decimal? LimitValue {get;set;}
/// <summary>
/// Desc:备注
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="remart")]
public string Remart {get;set;}
}
}

@ -0,0 +1,155 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///换电预约表
///</summary>
[SugarTable("swap_amt_order")]
public partial class SwapAmtOrder
{
public SwapAmtOrder(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
/// <summary>
/// Desc:id
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(IsPrimaryKey=true,IsIdentity=true,ColumnName="id")]
public int Id {get;set;}
/// <summary>
/// Desc:预约单号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="sn")]
public string Sn {get;set;}
/// <summary>
/// Desc:支付状态
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="pay_status")]
public int? PayStatus {get;set;}
/// <summary>
/// Desc:车辆vin码
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="vin")]
public string Vin {get;set;}
/// <summary>
/// Desc:车辆mac
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="mac")]
public string Mac {get;set;}
/// <summary>
/// Desc:预约电池数量
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="battery_count")]
public int? BatteryCount {get;set;}
/// <summary>
/// Desc:预约时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="amt_time")]
public DateTime? AmtTime {get;set;}
/// <summary>
/// Desc:预约到期时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="expire_time")]
public DateTime? ExpireTime {get;set;}
/// <summary>
/// Desc:预约状态;1预约成功2预约取消3预约失败4换电完成5换电失败6换电中7预约过期
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="status")]
public int? Status {get;set;}
/// <summary>
/// Desc:预约电池仓号列表
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="amt_bin_no_list")]
public string AmtBinNoList {get;set;}
/// <summary>
/// Desc:取消时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="cancel_time")]
public DateTime? CancelTime {get;set;}
/// <summary>
/// Desc:换电完成时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="swap_finish_time")]
public DateTime? SwapFinishTime {get;set;}
/// <summary>
/// Desc:换电订单编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="swap_order_sn")]
public string SwapOrderSn {get;set;}
}
}

@ -0,0 +1,147 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///换电订单表
///</summary>
[SugarTable("swap_order")]
public partial class SwapOrder
{
public SwapOrder(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
/// <summary>
/// Desc:id
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(IsPrimaryKey=true,IsIdentity=true,ColumnName="id")]
public int Id {get;set;}
/// <summary>
/// Desc:订单编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="sn")]
public string Sn {get;set;}
/// <summary>
/// Desc:车牌号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="vehicle_no")]
public string VehicleNo {get;set;}
/// <summary>
/// Desc:车辆mac
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="vehicle_mac")]
public string VehicleMac {get;set;}
/// <summary>
/// Desc:车辆vin码
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="vehicle_vin")]
public string VehicleVin {get;set;}
/// <summary>
/// Desc:车辆进场时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="vehicle_enter_time")]
public DateTime? VehicleEnterTime {get;set;}
/// <summary>
/// Desc:车辆离场时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="vehicle_leave_time")]
public DateTime? VehicleLeaveTime {get;set;}
/// <summary>
/// Desc:换电开始时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="swap_begin_time")]
public DateTime? SwapBeginTime {get;set;}
/// <summary>
/// Desc:换电结束时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="swap_end_time")]
public DateTime? SwapEndTime {get;set;}
/// <summary>
/// Desc:换电结果;0-未知1-成功2-失败
/// Default:0
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="swap_result")]
public int? SwapResult {get;set;}
/// <summary>
/// Desc:失败原因
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="fail_reason")]
public string FailReason {get;set;}
/// <summary>
/// Desc:上传云平台状态;0-未上传1-已上传
/// Default:0
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="cloud_report_status")]
public int? CloudReportStatus {get;set;}
}
}

@ -0,0 +1,243 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///换电订单电池
///</summary>
[SugarTable("swap_order_battery")]
public partial class SwapOrderBattery
{
public SwapOrderBattery(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
/// <summary>
/// Desc:id
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(IsPrimaryKey=true,IsIdentity=true,ColumnName="id")]
public int Id {get;set;}
/// <summary>
/// Desc:换电订单编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="swap_order_sn")]
public string SwapOrderSn {get;set;}
/// <summary>
/// Desc:亏电包编码
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="down_battery_no")]
public string DownBatteryNo {get;set;}
/// <summary>
/// Desc:亏电包soc
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="down_battery_soc")]
public decimal? DownBatterySoc {get;set;}
/// <summary>
/// Desc:亏电包soe
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="down_battery_soe")]
public decimal? DownBatterySoe {get;set;}
/// <summary>
/// Desc:亏电包真实soc
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="down_battery_real_soc")]
public decimal? DownBatteryRealSoc {get;set;}
/// <summary>
/// Desc:亏电包上次换电结算时soc
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="down_battery_last_soc")]
public decimal? DownBatteryLastSoc {get;set;}
/// <summary>
/// Desc:亏电包上次换电结算时soe
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="down_battery_last_soe")]
public decimal? DownBatteryLastSoe {get;set;}
/// <summary>
/// Desc:亏电包站内充电能量(累计)
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="down_battery_in_chage_elec_count")]
public decimal? DownBatteryInChageElecCount {get;set;}
/// <summary>
/// Desc:亏电包站外插枪充电能量(累计)
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="down_battery_out_chage_elec_count")]
public decimal? DownBatteryOutChageElecCount {get;set;}
/// <summary>
/// Desc:亏电包站外回充能量(累计)
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="down_battery_out_re_chagre_count")]
public decimal? DownBatteryOutReChagreCount {get;set;}
/// <summary>
/// Desc:亏电包站外放电能量(累计)
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="down_battery_in_dischage_elec_count")]
public decimal? DownBatteryInDischageElecCount {get;set;}
/// <summary>
/// Desc:亏电包站内放电电能量(累计)
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="down_battery_out_dischage_elec_count")]
public decimal? DownBatteryOutDischageElecCount {get;set;}
/// <summary>
/// Desc:放电池仓位号 亏电包仓号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="down_battery_bin_no")]
public int? DownBatteryBinNo {get;set;}
/// <summary>
/// Desc:满电包编码
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="up_battery_no")]
public string UpBatteryNo {get;set;}
/// <summary>
/// Desc:满电包soc
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="up_battery_soc")]
public decimal? UpBatterySoc {get;set;}
/// <summary>
/// Desc:满电包soe
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="up_battery_soe")]
public decimal? UpBatterySoe {get;set;}
/// <summary>
/// Desc:满电包真实soc
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="up_battery_real_soc")]
public decimal? UpBatteryRealSoc {get;set;}
/// <summary>
/// Desc:满电包站内充电能量(累计)
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="up_battery_in_chage_elec_count")]
public decimal? UpBatteryInChageElecCount {get;set;}
/// <summary>
/// Desc:满电包站外插枪充电能量(累计)
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="up_battery_out_chage_elec_count")]
public decimal? UpBatteryOutChageElecCount {get;set;}
/// <summary>
/// Desc:满电包站外回充能量(累计)
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="up_battery_out_re_chagre_count")]
public decimal? UpBatteryOutReChagreCount {get;set;}
/// <summary>
/// Desc:满电包站外放电能量(累计)
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="up_battery_in_dischage_elec_count")]
public decimal? UpBatteryInDischageElecCount {get;set;}
/// <summary>
/// Desc:满电包站内放电电能量(累计)
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="up_battery_out_dischage_elec_count")]
public decimal? UpBatteryOutDischageElecCount {get;set;}
/// <summary>
/// Desc:取电池仓位号 满电包仓号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="up_battery_bin_no")]
public int? UpBatteryBinNo {get;set;}
}
}

@ -0,0 +1,83 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///换电步序表
///</summary>
[SugarTable("swap_order_step")]
public partial class SwapOrderStep
{
public SwapOrderStep(){
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
/// <summary>
/// Desc:id
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(IsPrimaryKey=true,IsIdentity=true,ColumnName="id")]
public int Id {get;set;}
/// <summary>
/// Desc:换电订单编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="swap_order_sn")]
public string SwapOrderSn {get;set;}
/// <summary>
/// Desc:步序;0-未知1-空闲200-rfid扫描300-云平台验证;
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="step")]
public int? Step {get;set;}
/// <summary>
/// Desc:步序名称
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="step_name")]
public string StepName {get;set;}
}
}

@ -7,7 +7,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SqlSugarCore" Version="5.1.4.95"/>
<PackageReference Include="SqlSugarCore" Version="5.1.4.115"/>
</ItemGroup>
<ItemGroup>
<Folder Include="DbModel\Station\" />
</ItemGroup>
</Project>

@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="SqlSugar.IOC" Version="2.0.0"/>
<PackageReference Include="SqlSugarCore" Version="5.1.4.95"/>
<PackageReference Include="SqlSugarCore" Version="5.1.4.115" />
</ItemGroup>
<ItemGroup>

@ -0,0 +1,14 @@
using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac.Attribute;
using SqlSugar;
namespace Repository.Station;
[Scope("SingleInstance")]
public class BatteryGroupRepository:BaseRepository<BatteryGroup>
{
public BatteryGroupRepository(ISqlSugarClient sqlSugar) : base(sqlSugar)
{
}
}

@ -14,7 +14,7 @@
<PackageReference Include="DotNetty.Handlers" Version="0.7.5"/>
<PackageReference Include="DotNetty.Transport" Version="0.7.5"/>
<PackageReference Include="log4net" Version="2.0.15"/>
<PackageReference Include="SqlSugarCore" Version="5.1.4.95"/>
<PackageReference Include="SqlSugarCore" Version="5.1.4.115"/>
</ItemGroup>
<ItemGroup>

@ -0,0 +1,84 @@
using Entity.DbModel.Station;
using Microsoft.AspNetCore.Mvc;
using Repository.Station;
using SqlSugar;
namespace WebStarter.Controllers;
[ApiController]
[Route("[controller]")]
public class GenController : ControllerBase
{
private readonly ISqlSugarClient _sqlSugarClient;
private readonly BatteryGroupRepository _batteryGroupRepository;
public GenController(ISqlSugarClient sqlSugarClient, BatteryGroupRepository batteryGroupRepository)
{
_sqlSugarClient = sqlSugarClient;
_batteryGroupRepository = batteryGroupRepository;
}
/// <summary>
/// 生成文件
/// </summary>
/// <returns></returns>
[HttpGet("gen/t/{id}")]
public void Get(int id)
{
Console.WriteLine();
_sqlSugarClient.DbFirst
.IsCreateAttribute() //创建sqlsugar自带特性
.FormatFileName(it => ToPascalCase(it)) //格式化文件名(文件名和表名不一样情况)
.FormatClassName(it => ToPascalCase(it)) //格式化类名 (类名和表名不一样的情况)
.FormatPropertyName(it => ToPascalCase(it)) //格式化属性名 (属性名和字段名不一样情况)
.CreateClassFile("D:\\lxw\\work\\pro\\c#\\hn_back_main\\Entity\\DbModel\\Station",
"Entity.DbModel.Station");
Console.WriteLine("生成完毕");
}
[HttpGet("test115")]
public void Test115()
{
_batteryGroupRepository.Insert(new List<BatteryGroup>()
{
new BatteryGroup()
{
BatteryNo = "1",
Group = 1,
},
new BatteryGroup()
{
BatteryNo = "2",
Group = 2,
},
});
List<BatteryGroup> batteryGroups = _batteryGroupRepository.Query();
BatteryGroup batteryGroup = batteryGroups[0];
_batteryGroupRepository.Delete(batteryGroup);
BatteryGroup batteryGroup1 = batteryGroups[1];
batteryGroup1.Group = 3;
_batteryGroupRepository.Update(batteryGroup1);
Console.WriteLine("测试完毕");
}
static string ToPascalCase(string input)
{
if (string.IsNullOrEmpty(input))
return input;
string[] strings = input.Split("_");
string res = "";
foreach (var s in strings)
{
string first = s.First().ToString().ToUpper();
string te = first + s.Substring(1);
res += te;
}
return res;
}
}

@ -23,6 +23,7 @@ public class WeatherForecastController : ControllerBase
}
[HttpGet(Name = "GetWeatherForecast")]
public IEnumerable<WeatherForecast> Get()
{
var sysUsers = _sysUserServices.Query();

@ -12,7 +12,7 @@
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0"/>
<PackageReference Include="log4net" Version="2.0.15"/>
<PackageReference Include="SqlSugar.IOC" Version="2.0.0"/>
<PackageReference Include="SqlSugarCore" Version="5.1.4.95"/>
<PackageReference Include="SqlSugarCore" Version="5.1.4.115"/>
</ItemGroup>
<ItemGroup>

Loading…
Cancel
Save