89 lines
3.3 KiB
C#
89 lines
3.3 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_Apoplexy_NCXYWBDB : BaseDB, IT_Service_Apoplexy_NCXYWB
|
||
{
|
||
public SqlSugarClient db = GetClient();
|
||
|
||
/// <summary>
|
||
/// 增加一条数据
|
||
/// </summary>
|
||
/// <param name="model"></param>
|
||
/// <returns></returns>
|
||
public T_Service_Apoplexy_NCXYWB Add(T_Service_Apoplexy_NCXYWB model)
|
||
{
|
||
return db.Insertable(model).ExecuteReturnEntity();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新一条数据
|
||
/// </summary>
|
||
public int Update(T_Service_Apoplexy_NCXYWB model)
|
||
{
|
||
return db.Updateable(model).ExecuteCommand();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除一条数据
|
||
/// </summary>
|
||
public bool Delete(long ID)
|
||
{
|
||
return db.Deleteable<T_Service_Apoplexy_NCXYWB>(it => it.ID == ID).ExecuteCommand() == 0 ? false : true; ;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获得前几行数据
|
||
/// </summary>
|
||
public T_Service_Apoplexy_NCXYWB Get(long ID)
|
||
{
|
||
return db.Queryable<T_Service_Apoplexy_NCXYWB>().First(it => it.ID == ID);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获得前几行数据PatientGuid
|
||
/// </summary>
|
||
public T_Service_Apoplexy_NCXYWB GetByPatientGuid(string PatientGuid)
|
||
{
|
||
return db.Queryable<T_Service_Apoplexy_NCXYWB>().First(it => it.PatientGuid == PatientGuid);
|
||
}
|
||
/// <summary>
|
||
/// 获得数据列表
|
||
/// </summary>
|
||
public TableModel<T_Service_Apoplexy_NCXYWB> GetPageList(int pageIndex, int pageSize)
|
||
{
|
||
int total = 0;
|
||
List<T_Service_Apoplexy_NCXYWB> data = db.Queryable<T_Service_Apoplexy_NCXYWB>().Where(it => it.DeleteFlag == 0).ToPageList(pageIndex, pageSize, ref total);
|
||
TableModel<T_Service_Apoplexy_NCXYWB> t = new TableModel<T_Service_Apoplexy_NCXYWB>();
|
||
t.Code = 0;
|
||
t.PageCount = data.Count;
|
||
t.TotalNumber = total;
|
||
t.Data = data;
|
||
t.Msg = "成功";
|
||
return t;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 根据患者编号(GUID)+所属报表类型 获取数据信息
|
||
/// </summary>
|
||
/// <param name="patientGuid">病人编号(GUID)</param>
|
||
/// <param name="reportType">所属报表类型0:公用;1:脑出血手术数据直报表;2:颅内动脉瘤手术数据直报表;3:CEACAS数据直报表;4:静脉溶栓血管内介入治疗数据直报表;9:卒中联盟数据报表</param>
|
||
/// <returns></returns>
|
||
public TableModel<T_Service_Apoplexy_NCXYWB> GetByPatientGuidAndReportType(string patientGuid, int reportType)
|
||
{
|
||
List<T_Service_Apoplexy_NCXYWB> data = db.Queryable<T_Service_Apoplexy_NCXYWB>().Where(it => it.PatientGuid == patientGuid && it.DeleteFlag == 0).ToList();
|
||
TableModel<T_Service_Apoplexy_NCXYWB> t = new TableModel<T_Service_Apoplexy_NCXYWB>();
|
||
t.Code = 0;
|
||
t.PageCount = data.Count;
|
||
t.TotalNumber = data.Count;
|
||
t.Data = data;
|
||
t.Msg = "成功";
|
||
return t;
|
||
}
|
||
}
|
||
}
|