StableVersion4.3/HL_FristAidPlatform_DataBase/Service/T_Service_FirstAid_PhoneBoo...

61 lines
2.0 KiB
C#
Raw Permalink 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_PhoneBook
public class T_Service_FirstAid_PhoneBookDB : BaseDB, IT_Service_FirstAid_PhoneBook
{
public SqlSugarClient db = GetClient();
/// <summary>
/// 增加一条数据
/// </summary>
public bool Add(T_Service_FirstAid_PhoneBook model)
{
return db.Insertable(model).ExecuteCommand() == 0 ? false : true;
}
/// <summary>
/// 更新一条数据
/// </summary>
public bool Update(T_Service_FirstAid_PhoneBook model)
{
return db.Updateable(model).ExecuteCommand() == 0 ? false : true;
}
/// <summary>
/// 删除一条数据
/// </summary>
public bool Delete(string GUID)
{
return db.Deleteable<T_Service_FirstAid_PhoneBook>().Where(it => it.GUID == GUID).ExecuteCommand() == 0 ? false : true;
}
/// <summary>
/// 获取单个数据
/// </summary>
public T_Service_FirstAid_PhoneBook Get(string GUID)
{
return db.Queryable<T_Service_FirstAid_PhoneBook>().Where(it => it.GUID == GUID).Single();
}
/// <summary>
/// 获得数据列表
/// </summary>
public TableModel<T_Service_FirstAid_PhoneBook> GetPageList(int pageIndex, int pageSize)
{
int total = 0;
List<T_Service_FirstAid_PhoneBook> data = db.Queryable<T_Service_FirstAid_PhoneBook>().Where(it => it.DeleteFlag == 0).ToPageList(pageIndex, pageSize, ref total);
TableModel<T_Service_FirstAid_PhoneBook> t = new TableModel<T_Service_FirstAid_PhoneBook>();
t.Code = 0;
t.PageCount = data.Count;
t.TotalNumber = total;
t.Data = data;
t.Msg = "成功";
return t;
}
}
}