47 lines
1.7 KiB
C#
47 lines
1.7 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_Service_FollowUpTemplateChildDB : BaseDB, IT_Service_FollowUpTemplateChild
|
|
{
|
|
public SqlSugarClient db = GetClient();
|
|
|
|
public bool Add(T_Service_FollowUpTemplateChild model)
|
|
{
|
|
return db.Insertable(model).ExecuteCommand() == 0 ? false : true;
|
|
}
|
|
|
|
public bool Delete(string ID)
|
|
{
|
|
return db.Deleteable<T_Service_FollowUpTemplateChild>(it => it.ID.ToString() == ID).ExecuteCommand() == 0 ? false : true; ;
|
|
}
|
|
|
|
public T_Service_FollowUpTemplateChild Get(string ID)
|
|
{
|
|
return db.Queryable<T_Service_FollowUpTemplateChild>().First(it => it.ID.ToString() == ID);
|
|
}
|
|
|
|
public TableModel<T_Service_FollowUpTemplateChild> GetPageList(int pageIndex, int pageSize, string parentGUID)
|
|
{
|
|
int total = 0;
|
|
List<T_Service_FollowUpTemplateChild> data = db.Queryable<T_Service_FollowUpTemplateChild>().Where(it => it.DeleteFlag == 0 && it.ParentGUID == parentGUID).ToPageList(pageIndex, pageSize, ref total);
|
|
TableModel<T_Service_FollowUpTemplateChild> t = new TableModel<T_Service_FollowUpTemplateChild>();
|
|
t.Code = 0;
|
|
t.PageCount = data.Count;
|
|
t.TotalNumber = total;
|
|
t.Data = data;
|
|
t.Msg = "成功";
|
|
return t;
|
|
}
|
|
|
|
public bool Update(T_Service_FollowUpTemplateChild model)
|
|
{
|
|
return db.Updateable(model).ExecuteCommand() == 0 ? false : true;
|
|
}
|
|
}
|
|
}
|