92 lines
3.6 KiB
C#
92 lines
3.6 KiB
C#
|
using HL_FristAidPlatform_Help;
|
|||
|
using HL_FristAidPlatform_IDataBase;
|
|||
|
using HL_FristAidPlatform_Models;
|
|||
|
using SqlSugar;
|
|||
|
using System.Collections.Generic;
|
|||
|
namespace HL_FristAidPlatform_DataBase
|
|||
|
{
|
|||
|
//T_Service_EMR_EmergencyRoom
|
|||
|
public class T_Service_Apoplexy_EmergencyRoomDB : BaseDB, IT_Service_Apoplexy_EmergencyRoom
|
|||
|
{
|
|||
|
public SqlSugarClient db = GetClient();
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 增加一条数据
|
|||
|
/// </summary>
|
|||
|
public bool Add(T_Service_Apoplexy_EmergencyRoom model)
|
|||
|
{
|
|||
|
return db.Insertable(model).ExecuteCommand() == 0 ? false : true;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 更新一条数据
|
|||
|
/// </summary>
|
|||
|
public bool Update(T_Service_Apoplexy_EmergencyRoom model)
|
|||
|
{
|
|||
|
return db.Updateable(model).IgnoreColumns(ignoreAllNullColumns: true).Where(it => it.PatientGuid == model.PatientGuid).ExecuteCommand() == 0 ? false : true;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获得数据列表
|
|||
|
/// </summary>
|
|||
|
public TableModel<T_Service_Apoplexy_EmergencyRoom> GetPageList(int pageIndex, int pageSize)
|
|||
|
{
|
|||
|
int total = 0;
|
|||
|
List<T_Service_Apoplexy_EmergencyRoom> data = db.Queryable<T_Service_Apoplexy_EmergencyRoom>().Where(it => it.DeleteFlag == 0).ToPageList(pageIndex, pageSize, ref total);
|
|||
|
TableModel<T_Service_Apoplexy_EmergencyRoom> t = new TableModel<T_Service_Apoplexy_EmergencyRoom>();
|
|||
|
t.Code = 0;
|
|||
|
t.PageCount = data.Count;
|
|||
|
t.TotalNumber = total;
|
|||
|
t.Data = data;
|
|||
|
t.Msg = "成功";
|
|||
|
return t;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 根据ID获得数据
|
|||
|
/// </summary>
|
|||
|
public T_Service_Apoplexy_EmergencyRoom Get(long ID)
|
|||
|
{
|
|||
|
return db.Queryable<T_Service_Apoplexy_EmergencyRoom>().First(it => it.ID == ID);
|
|||
|
}
|
|||
|
|
|||
|
public T_Service_Apoplexy_EmergencyRoom GetByPatientGuid1(string patientGuid)
|
|||
|
{
|
|||
|
return db.Queryable<T_Service_Apoplexy_EmergencyRoom>().First(it => it.PatientGuid == patientGuid);
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// 根据患者编号(GUID) 获取数据信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="patientGuid">病人编号(GUID)</param>
|
|||
|
/// <returns></returns>
|
|||
|
public TableModel<T_Service_Apoplexy_EmergencyRoom> GetByPatientGuid(string patientGuid)
|
|||
|
{
|
|||
|
List<T_Service_Apoplexy_EmergencyRoom> data = db.Queryable<T_Service_Apoplexy_EmergencyRoom>().Where(it => it.PatientGuid == patientGuid && it.DeleteFlag == 0).ToList();
|
|||
|
TableModel<T_Service_Apoplexy_EmergencyRoom> t = new TableModel<T_Service_Apoplexy_EmergencyRoom>();
|
|||
|
t.Code = 0;
|
|||
|
t.PageCount = data.Count;
|
|||
|
t.TotalNumber = data.Count;
|
|||
|
t.Data = data;
|
|||
|
t.Msg = "成功";
|
|||
|
return t;
|
|||
|
}
|
|||
|
|
|||
|
public bool Delete(long ID)
|
|||
|
{
|
|||
|
return db.Deleteable<T_Service_Apoplexy_EmergencyRoom>(it => it.ID == ID).ExecuteCommand() == 0 ? false : true; ;
|
|||
|
}
|
|||
|
|
|||
|
public TableModel<T_Service_Apoplexy_EmergencyRoom> GetModelByReport(string where)
|
|||
|
{
|
|||
|
string sql = "select * from T_Service_EMR_EmergencyRoom where 1=1 and " + where + "";
|
|||
|
List<T_Service_Apoplexy_EmergencyRoom> data = db.Ado.SqlQuery<T_Service_Apoplexy_EmergencyRoom>(sql);
|
|||
|
TableModel<T_Service_Apoplexy_EmergencyRoom> t = new TableModel<T_Service_Apoplexy_EmergencyRoom>();
|
|||
|
t.Code = 0;
|
|||
|
t.PageCount = data.Count;
|
|||
|
t.TotalNumber = data.Count;
|
|||
|
t.Data = data;
|
|||
|
t.Msg = "成功";
|
|||
|
return t;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|