43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using HL_FristAidPlatform_Help;
|
|
using HL_FristAidPlatform_IDataBase;
|
|
using HL_FristAidPlatform_Models;
|
|
using SqlSugar;
|
|
using System.Collections.Generic;
|
|
|
|
namespace HL_FristAidPlatform_DataBase
|
|
{
|
|
public class T_SYS_UIDB : BaseDB, IT_SYS_UI
|
|
{
|
|
public SqlSugarClient db = GetClient();
|
|
|
|
public TableModel<T_SYS_UI> GetPageList(int pageIndex, int pageSize)
|
|
{
|
|
int total = 0;
|
|
List<T_SYS_UI> data = db.Queryable<T_SYS_UI>().ToPageList(pageIndex, pageSize, ref total);
|
|
TableModel<T_SYS_UI> t = new TableModel<T_SYS_UI>();
|
|
t.Code = 0;
|
|
t.PageCount = data.Count;
|
|
t.TotalNumber = total;
|
|
t.Data = data;
|
|
t.Msg = "成功";
|
|
return t;
|
|
}
|
|
public T_SYS_UI Get(long id)
|
|
{
|
|
return db.Queryable<T_SYS_UI>().First(it => it.Id == id);
|
|
}
|
|
public bool Add(T_SYS_UI user)
|
|
{
|
|
return db.Insertable(user).IgnoreColumns(ignoreNullColumn: true).ExecuteCommand() == 1 ? true : false;
|
|
}
|
|
public bool Dels(dynamic[] ids)
|
|
{
|
|
return db.Deleteable<T_SYS_UI>().In(new dynamic[] { ids }).ExecuteCommand() == 1 ? true : false;
|
|
}
|
|
public bool Update(T_SYS_UI user)
|
|
{
|
|
return db.Updateable(user).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand() == 1 ? true : false;
|
|
}
|
|
}
|
|
}
|