101 lines
3.5 KiB
C#
101 lines
3.5 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_ZYYWDB : BaseDB, IT_Service_Apoplexy_ZYYW
|
|
{
|
|
public SqlSugarClient db = GetClient();
|
|
|
|
/// <summary>
|
|
/// 增加一条数据
|
|
/// </summary>
|
|
public T_Service_Apoplexy_ZYYW Add(T_Service_Apoplexy_ZYYW model)
|
|
{
|
|
return db.Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新一条数据
|
|
/// </summary>
|
|
public bool Update(T_Service_Apoplexy_ZYYW model)
|
|
{
|
|
return db.Updateable(model).ExecuteCommand() == 0 ? false : true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除一条数据
|
|
/// </summary>
|
|
public bool Delete(long ID)
|
|
{
|
|
return db.Deleteable<T_Service_Apoplexy_ZYYW>(it => it.ID == ID).ExecuteCommand() == 0 ? false : true; ;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获得数据列表
|
|
/// </summary>
|
|
public TableModel<T_Service_Apoplexy_ZYYW> GetPageList(int pageIndex, int pageSize)
|
|
{
|
|
int total = 0;
|
|
List<T_Service_Apoplexy_ZYYW> data = db.Queryable<T_Service_Apoplexy_ZYYW>().Where(it => it.DeleteFlag == 0).ToPageList(pageIndex, pageSize, ref total);
|
|
TableModel<T_Service_Apoplexy_ZYYW> t = new TableModel<T_Service_Apoplexy_ZYYW>();
|
|
t.Code = 0;
|
|
t.PageCount = data.Count;
|
|
t.TotalNumber = total;
|
|
t.Data = data;
|
|
t.Msg = "成功";
|
|
return t;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获得前几行数据
|
|
/// </summary>
|
|
public T_Service_Apoplexy_ZYYW Get(long ID)
|
|
{
|
|
return db.Queryable<T_Service_Apoplexy_ZYYW>().First(it => it.ID == ID);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据病人编号获取
|
|
/// </summary>
|
|
/// <param name="patientGuid"></param>
|
|
/// <returns></returns>
|
|
public TableModel<T_Service_Apoplexy_ZYYW> GetByPatientGuid(string patientGuid)
|
|
{
|
|
List<T_Service_Apoplexy_ZYYW> data = db.Queryable<T_Service_Apoplexy_ZYYW>().Where(it => it.PatientGuid == patientGuid && it.DeleteFlag == 0).ToList();
|
|
TableModel<T_Service_Apoplexy_ZYYW> t = new TableModel<T_Service_Apoplexy_ZYYW>();
|
|
t.Code = 0;
|
|
t.PageCount = data.Count;
|
|
t.TotalNumber = data.Count;
|
|
t.Data = data;
|
|
t.Msg = "成功";
|
|
return t;
|
|
}
|
|
|
|
public TableModel<T_Service_Apoplexy_ZYYW> GetModelByReport(string where)
|
|
{
|
|
string sql = "SELECT * FROM T_Service_EMR_Hospitalization where DeleteFlag=0 and " + where + "";
|
|
List<T_Service_Apoplexy_ZYYW> data = db.Ado.SqlQuery<T_Service_Apoplexy_ZYYW>(sql);
|
|
TableModel<T_Service_Apoplexy_ZYYW> t = new TableModel<T_Service_Apoplexy_ZYYW>();
|
|
t.Code = 0;
|
|
t.PageCount = data.Count;
|
|
t.TotalNumber = data.Count;
|
|
t.Data = data;
|
|
t.Msg = "成功";
|
|
return t;
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="patientGuid"></param>
|
|
/// <returns></returns>
|
|
public T_Service_Apoplexy_ZYYW GetOfPatientGuid(string patientGuid)
|
|
{
|
|
return db.Queryable<T_Service_Apoplexy_ZYYW>().First(it => it.PatientGuid == patientGuid);
|
|
}
|
|
}
|
|
} |