StableVersion4.3/HL_FristAidPlatform_DataBase/Service/T_Service_FirstAid_DeviceMa...

61 lines
2.1 KiB
C#
Raw Normal View History

2024-03-11 09:47:34 +08:00
using HL_FristAidPlatform_Help;
using HL_FristAidPlatform_IDataBase;
using HL_FristAidPlatform_Models;
using SqlSugar;
using System.Collections.Generic;
namespace HL_FristAidPlatform_DataBase
{
//T_Service_FirstAid_DeviceManagement
public class T_Service_FirstAid_DeviceManagementDB : BaseDB, IT_Service_FirstAid_DeviceManagement
{
public SqlSugarClient db = GetClient();
/// <summary>
/// 增加一条数据
/// </summary>
public bool Add(T_Service_FirstAid_DeviceManagement model)
{
return db.Insertable(model).ExecuteCommand() == 0 ? false : true;
}
/// <summary>
/// 更新一条数据
/// </summary>
public bool Update(T_Service_FirstAid_DeviceManagement model)
{
return db.Updateable(model).ExecuteCommand() == 0 ? false : true;
}
/// <summary>
/// 删除一条数据
/// </summary>
public bool Delete(string GUID)
{
return db.Deleteable<T_Service_FirstAid_DeviceManagement>().Where(it => it.GUID == GUID).ExecuteCommand() == 0 ? false : true;
}
/// <summary>
/// 获取单个数据
/// </summary>
public T_Service_FirstAid_DeviceManagement Get(string GUID)
{
return db.Queryable<T_Service_FirstAid_DeviceManagement>().Where(it => it.GUID == GUID).Single();
}
/// <summary>
/// 获得数据列表
/// </summary>
public TableModel<T_Service_FirstAid_DeviceManagement> GetPageList(int pageIndex, int pageSize)
{
int total = 0;
List<T_Service_FirstAid_DeviceManagement> data = db.Queryable<T_Service_FirstAid_DeviceManagement>().Where(it => it.DeleteFlag == 0).ToPageList(pageIndex, pageSize, ref total);
TableModel<T_Service_FirstAid_DeviceManagement> t = new TableModel<T_Service_FirstAid_DeviceManagement>();
t.Code = 0;
t.PageCount = data.Count;
t.TotalNumber = total;
t.Data = data;
t.Msg = "成功";
return t;
}
}
}