83 lines
2.3 KiB
C#
83 lines
2.3 KiB
C#
using System;
|
|
using AIMSDAL;
|
|
using AIMSModel;
|
|
using AIMSObjectQuery;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using HelperDB;
|
|
|
|
namespace AIMSBLL
|
|
{
|
|
public partial class BFeesRecordReport
|
|
{
|
|
|
|
public static DataTable GetUpListByWhere2(string where)
|
|
{
|
|
string sql = string.Format(@"
|
|
SELECT
|
|
ROW_NUMBER() OVER (ORDER BY FeeCode ASC) AS noo,
|
|
FeeCode ,
|
|
ChargName ,
|
|
ChargSpec ,
|
|
sum(convert(float,FeeNum)) FeeNum,
|
|
UnitPrice
|
|
FROM [dbo].[FeesRecord]
|
|
where FeeIsDrug=1 and {0}
|
|
group by FeeCode , ChargName, ChargSpec ,UnitPrice
|
|
order by FeeCode ", where);
|
|
DataTable dt = DBHelper.GetDataTable(sql);
|
|
return dt;
|
|
}
|
|
|
|
public static DataTable GetUpListByWhere(string where)
|
|
{
|
|
string sql = string.Format(@"
|
|
SELECT *,
|
|
info.OperationRoom,
|
|
info.PatientName,
|
|
info.MdrecNo
|
|
FROM[dbo].[FeesRecord]
|
|
left join [dbo].[V_OperationRecordInfo] info on info.RecoredId=[FeesRecord].OperationRecordId
|
|
where FeeIsDrug=1 and {0}
|
|
order by FeeCode ", where);
|
|
DataTable dt = DBHelper.GetDataTable(sql);
|
|
return dt;
|
|
}
|
|
|
|
public static DataTable GetUpListByWhere3(string where)
|
|
{
|
|
string sql = string.Format(@"
|
|
select FeesRecord.id,
|
|
voi.OpeDAY '年月日',
|
|
LimitDrug 入库数量,
|
|
voi.PatientName 姓名,
|
|
voi.Age 年龄,
|
|
voi.Sex 性别,
|
|
pt.IdentityCard 身份证号,
|
|
voi.ApplyDiagnoseInfoName 诊断,
|
|
FeesRecord.Extend2+FeesRecord.Extend1 用量,
|
|
FeesRecord.Extend4 处方单号,
|
|
FeesRecord.InsureNO 批号,
|
|
pt.MdrecNo 病志号或住址,
|
|
FeesRecord.ExecWork 处方医生,
|
|
FeesRecord.Extend5 发药人,
|
|
Conclusion 事故损耗,
|
|
IsInsure 结存数
|
|
FROM FeesRecord
|
|
LEFT JOIN Oris_Patient pt on pt.id=PatientId
|
|
LEFT JOIN V_OperationRecordInfo voi on voi.RecoredId=FeesRecord.OperationRecordId
|
|
where FeeIsDrug=1 and FeesRecord.Extend4<>'' and {0} ", where);
|
|
DataTable dt = DBHelper.GetDataTable(sql);
|
|
return dt;
|
|
}
|
|
|
|
public static DataTable GetDrugByType(string where)
|
|
{
|
|
string sql = string.Format(@" select ChargName from [FeesRecord] where Extend4<>'' and FeeTypeId='{0}' group by ChargName ", where);
|
|
DataTable dt = DBHelper.GetDataTable(sql);
|
|
return dt;
|
|
}
|
|
}
|
|
}
|