StableVersion4.3/HL_FristAidPlatform_DataBase/Service/T_Service_Apoplexy_XGZLDB.cs

104 lines
3.8 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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