using HL_FristAidPlatform_Help;
using HL_FristAidPlatform_IDataBase;
using HL_FristAidPlatform_Models;
using SqlSugar;
using System.Collections.Generic;
namespace HL_FristAidPlatform_DataBase
{
///
/// CEA/CAS 手术操作表(CEACZ)
///
public class T_Service_Apoplexy_CEACZDB : BaseDB, IT_Service_Apoplexy_CEACZ
{
public SqlSugarClient db = GetClient();
///
/// 增加一条数据
///
///
///
public T_Service_Apoplexy_CEACZ Add(T_Service_Apoplexy_CEACZ model)
{
return db.Insertable(model).ExecuteReturnEntity();
}
///
/// 更新一条数据
///
public int Update(T_Service_Apoplexy_CEACZ model)
{
return db.Updateable(model).ExecuteCommand();
}
///
/// 删除一条数据
///
public bool Delete(long ID)
{
return db.Deleteable(it => it.ID == ID).ExecuteCommand() == 0 ? false : true; ;
}
///
/// 获得前几行数据
///
public T_Service_Apoplexy_CEACZ Get(long ID)
{
return db.Queryable().First(it => it.ID == ID);
}
public T_Service_Apoplexy_CEACZ GetByPatientGuid1(string patientGuid)
{
return db.Queryable().First(it => it.PatientGuid == patientGuid);
}
///
/// 获得数据列表
///
public TableModel GetPageList(int pageIndex, int pageSize)
{
int total = 0;
List data = db.Queryable().Where(it => it.DeleteFlag == 0).ToPageList(pageIndex, pageSize, ref total);
TableModel t = new TableModel();
t.Code = 0;
t.PageCount = data.Count;
t.TotalNumber = total;
t.Data = data;
t.Msg = "成功";
return t;
}
///
/// 根据患者编号(GUID)+所属报表类型 获取数据信息
///
/// 病人编号(GUID)
/// 所属报表类型0:公用;1:脑出血手术数据直报表;2:颅内动脉瘤手术数据直报表;3:CEACAS数据直报表;4:静脉溶栓血管内介入治疗数据直报表;9:卒中联盟数据报表
///
public TableModel GetByPatientGuidAndReportType(string patientGuid, int reportType)
{
List data = db.Queryable().Where(it => it.PatientGuid == patientGuid && it.DeleteFlag == 0).ToList();
TableModel t = new TableModel();
t.Code = 0;
t.PageCount = data.Count;
t.TotalNumber = data.Count;
t.Data = data;
t.Msg = "成功";
return t;
}
}
}