49 lines
1.4 KiB
C#
49 lines
1.4 KiB
C#
using HL_FristAidPlatform_Help;
|
|
using HL_FristAidPlatform_IDataBase;
|
|
using HL_FristAidPlatform_Models;
|
|
using SqlSugar;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace HL_FristAidPlatform_DataBase
|
|
{
|
|
public class T_Service_NucleicAcidInfoDB : BaseDB, IT_Service_NucleicAcidInfo
|
|
{
|
|
public SqlSugarClient db = GetClient();
|
|
|
|
/// <summary>
|
|
/// 批量插入
|
|
/// </summary>
|
|
/// <param name="lst"></param>
|
|
/// <returns></returns>
|
|
public int Add(List<T_Service_NucleicAcidInfo> lst)
|
|
{
|
|
return db.Insertable(lst).ExecuteCommand();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取核酸检查总数
|
|
/// </summary>
|
|
/// <param name="patientGuid"></param>
|
|
/// <returns></returns>
|
|
public int GetCount(string patientGuid)
|
|
{
|
|
return db.Queryable<T_Service_NucleicAcidInfo>().Where(i => i.PatientGUID == patientGuid && i.DeleteFlag == 0).Count();
|
|
}
|
|
|
|
|
|
public T_Service_NucleicAcidInfo Get(string guid)
|
|
{
|
|
return db.Queryable<T_Service_NucleicAcidInfo>().First(i => i.GUID == guid);
|
|
}
|
|
|
|
public bool Delete(T_Service_NucleicAcidInfo info)
|
|
{
|
|
return db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand() == 1 ? true : false;
|
|
}
|
|
}
|
|
}
|