2018-05-31
--住院或门诊划价单状态修改
update CustomerConsumptionDetails set ExcutePercent=1,ExecuteStatus=2,ChargeStatus=1,CanExecute=0 where ID in (select CertainProjectID from FinanceTotal where DocType='住院或门诊划价单')
==============================
exec sp_executesql N'SELECT [t0].[Date] AS [ComeDate], [t0].[CustomerID], [t1].[Name] AS [CustomerName], [t0].[ID] AS [Id], [t2].[MemberCardNum], [t3].[Name] AS [RegisterBy], [t5].[Name] AS [RegisterDept],
(CASE
WHEN [t1].[SceneEmployee] IS NOT NULL THEN CONVERT(NVarChar(MAX),[t6].[Name])
ELSE NULL
END) AS [SceneName], [t1].[Sex]
FROM [dbo].[CustomerComeLog] AS [t0]
INNER JOIN [dbo].[CustomerBaseInfo] AS [t1] ON [t1].[ID] = [t0].[CustomerID]
LEFT OUTER JOIN [dbo].[MemberCardInfo] AS [t2] ON [t2].[CustomerID] = [t1].[ID]
INNER JOIN [dbo].[Employee] AS [t3] ON [t3].[ID] = [t0].[HandleBy]
INNER JOIN [dbo].[PositionInfo] AS [t4] ON [t4].[ID] = [t3].[PositionID]
INNER JOIN [dbo].[Department] AS [t5] ON [t5].[ID] = [t4].[DepartmentID]
LEFT OUTER JOIN [dbo].[Employee] AS [t6] ON [t6].[ID] = [t1].[SceneEmployee]
WHERE ([t0].[HandleBy] = @p0) AND ([t1].[Name] LIKE @p1) AND (NOT ([t1].[Remove] = 1)) AND (1 = 1)',N'@p0 varchar(8000),@p1 nvarchar(4000),@p2 int,@p3 varchar(8000),@p4 varchar(8000),@p5 int',@p0='00018',@p1=N'%张%',@p2=0,@p3='%%',@p4='%%',@p5=1
select * from CustomerComeLog
select * from ReturnMoneyForCertainDoc
exec sp_executesql N'SELECT [t0].[Amount], [t0].[ApprovalEmployeeID], [t0].[ID], [t0].[CanExecute], [t0].[ChargeStatus], [t0].[ExcutionNumber], [t0].[ExcutePercent], [t0].[ExecuteStatus], [t0].[HandselItemModeID], [t0].[HasReserveDoctor], [t0].[IsDispute], [t0].[ItemID], [t0].[ItemTypeID], [t0].[KindOfSicknessID], [t0].[NeedInHospital], [t0].[PackageID], [t0].[PayedAmount], [t0].[PlanExcuteDate], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[ReserveDoctorID], [t0].[ReturnMoneyStatus], [t0].[ReturnVisited], [t0].[Sconto], [t0].[Status], [t0].[Version]
FROM [dbo].[CustomerConsumptionDetails] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=1558
exec sp_executesql N'SELECT [t0].[Amount], [t0].[ApprovalEmployeeID], [t0].[ID], [t0].[CanExecute], [t0].[ChargeStatus], [t0].[ExcutionNumber], [t0].[ExcutePercent], [t0].[ExecuteStatus], [t0].[HandselItemModeID], [t0].[HasReserveDoctor], [t0].[IsDispute], [t0].[ItemID], [t0].[ItemTypeID], [t0].[KindOfSicknessID], [t0].[NeedInHospital], [t0].[PackageID], [t0].[PayedAmount], [t0].[PlanExcuteDate], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[ReserveDoctorID], [t0].[ReturnMoneyStatus], [t0].[ReturnVisited], [t0].[Sconto], [t0].[Status], [t0].[Version]
FROM [dbo].[CustomerConsumptionDetails] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=1556
exec sp_executesql N'SELECT [t0].[Aliases], [t0].[ID], [t0].[CategoryID], [t0].[ChangePrice], [t0].[ConsultingItemCategoryID], [t0].[CustomCode], [t0].[ExcuteDepartmentID], [t0].[GoodsCategoryID], [t0].[IncomeCategoryID], [t0].[IntervalOfOneTreatment], [t0].[IntervalOfTreatment], [t0].[IsConsume], [t0].[IsOperation], [t0].[IsPlace], [t0].[IsTreatment], [t0].[TopCategoryID], [t0].[LimitInsteadMoney], [t0].[LimitIntegration], [t0].[LimitSconto], [t0].[MaxPrice], [t0].[MinPrice], [t0].[MustExcute], [t0].[Name], [t0].[NationalCode], [t0].[NeedInHospital], [t0].[PriceOfOneTime], [t0].[Remark], [t0].[SimpleCode], [t0].[Standard], [t0].[StockQuantity], [t0].[Success], [t0].[TimesOfOneTreatment], [t0].[TimesOfTreatment], [t0].[Unit], [t0].[UnitPrice], [t0].[UseInMedicine], [t0].[Valid]
FROM [dbo].[ItemInfo] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 varchar(8000)',@p0='00257'
exec sp_executesql N'SELECT [t0].[Aliases], [t0].[ID], [t0].[CategoryID], [t0].[ChangePrice], [t0].[ConsultingItemCategoryID], [t0].[CustomCode], [t0].[ExcuteDepartmentID], [t0].[GoodsCategoryID], [t0].[IncomeCategoryID], [t0].[IntervalOfOneTreatment], [t0].[IntervalOfTreatment], [t0].[IsConsume], [t0].[IsOperation], [t0].[IsPlace], [t0].[IsTreatment], [t0].[TopCategoryID], [t0].[LimitInsteadMoney], [t0].[LimitIntegration], [t0].[LimitSconto], [t0].[MaxPrice], [t0].[MinPrice], [t0].[MustExcute], [t0].[Name], [t0].[NationalCode], [t0].[NeedInHospital], [t0].[PriceOfOneTime], [t0].[Remark], [t0].[SimpleCode], [t0].[Standard], [t0].[StockQuantity], [t0].[Success], [t0].[TimesOfOneTreatment], [t0].[TimesOfTreatment], [t0].[Unit], [t0].[UnitPrice], [t0].[UseInMedicine], [t0].[Valid]
FROM [dbo].[ItemInfo] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 varchar(8000)',@p0='00258'
exec sp_executesql N'SELECT [t0].[Aliases], [t0].[ID], [t0].[CategoryID], [t0].[ChangePrice], [t0].[ConsultingItemCategoryID], [t0].[CustomCode], [t0].[ExcuteDepartmentID], [t0].[GoodsCategoryID], [t0].[IncomeCategoryID], [t0].[IntervalOfOneTreatment], [t0].[IntervalOfTreatment], [t0].[IsConsume], [t0].[IsOperation], [t0].[IsPlace], [t0].[IsTreatment], [t0].[TopCategoryID], [t0].[LimitInsteadMoney], [t0].[LimitIntegration], [t0].[LimitSconto], [t0].[MaxPrice], [t0].[MinPrice], [t0].[MustExcute], [t0].[Name], [t0].[NationalCode], [t0].[NeedInHospital], [t0].[PriceOfOneTime], [t0].[Remark], [t0].[SimpleCode], [t0].[Standard], [t0].[StockQuantity], [t0].[Success], [t0].[TimesOfOneTreatment], [t0].[TimesOfTreatment], [t0].[Unit], [t0].[UnitPrice], [t0].[UseInMedicine], [t0].[Valid]
FROM [dbo].[ItemInfo] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 varchar(8000)',@p0='00213'
exec sp_executesql N'SELECT [t0].[Aliases], [t0].[ID], [t0].[CategoryID], [t0].[ChangePrice], [t0].[ConsultingItemCategoryID], [t0].[CustomCode], [t0].[ExcuteDepartmentID], [t0].[GoodsCategoryID], [t0].[IncomeCategoryID], [t0].[IntervalOfOneTreatment], [t0].[IntervalOfTreatment], [t0].[IsConsume], [t0].[IsOperation], [t0].[IsPlace], [t0].[IsTreatment], [t0].[TopCategoryID], [t0].[LimitInsteadMoney], [t0].[LimitIntegration], [t0].[LimitSconto], [t0].[MaxPrice], [t0].[MinPrice], [t0].[MustExcute], [t0].[Name], [t0].[NationalCode], [t0].[NeedInHospital], [t0].[PriceOfOneTime], [t0].[Remark], [t0].[SimpleCode], [t0].[Standard], [t0].[StockQuantity], [t0].[Success], [t0].[TimesOfOneTreatment], [t0].[TimesOfTreatment], [t0].[Unit], [t0].[UnitPrice], [t0].[UseInMedicine], [t0].[Valid]
FROM [dbo].[ItemInfo] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 varchar(8000)',@p0='00256'
exec sp_executesql N'SELECT [t0].[Aliases], [t0].[ID], [t0].[CategoryID], [t0].[ChangePrice], [t0].[ConsultingItemCategoryID], [t0].[CustomCode], [t0].[ExcuteDepartmentID], [t0].[GoodsCategoryID], [t0].[IncomeCategoryID], [t0].[IntervalOfOneTreatment], [t0].[IntervalOfTreatment], [t0].[IsConsume], [t0].[IsOperation], [t0].[IsPlace], [t0].[IsTreatment], [t0].[TopCategoryID], [t0].[LimitInsteadMoney], [t0].[LimitIntegration], [t0].[LimitSconto], [t0].[MaxPrice], [t0].[MinPrice], [t0].[MustExcute], [t0].[Name], [t0].[NationalCode], [t0].[NeedInHospital], [t0].[PriceOfOneTime], [t0].[Remark], [t0].[SimpleCode], [t0].[Standard], [t0].[StockQuantity], [t0].[Success], [t0].[TimesOfOneTreatment], [t0].[TimesOfTreatment], [t0].[Unit], [t0].[UnitPrice], [t0].[UseInMedicine], [t0].[Valid]
FROM [dbo].[ItemInfo] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 varchar(8000)',@p0='00060'
exec sp_executesql N'SELECT [t0].[ID], [t0].[DisplayOnConsulting], [t0].[TopCategoryID], [t0].[Name], [t0].[ParentID], [t0].[SimpleCode]
FROM [dbo].[ItemCategory] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 varchar(8000)',@p0='00002'
exec sp_executesql N'SELECT [t0].[ID], [t0].[DisplayOnConsulting], [t0].[TopCategoryID], [t0].[Name], [t0].[ParentID], [t0].[SimpleCode]
FROM [dbo].[ItemCategory] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 varchar(8000)',@p0='00001'
exec sp_executesql N'SELECT [t0].[Amount], [t0].[ApprovalEmployeeID], [t0].[ID], [t0].[CanExecute], [t0].[ChargeStatus], [t0].[ExcutionNumber], [t0].[ExcutePercent], [t0].[ExecuteStatus], [t0].[HandselItemModeID], [t0].[HasReserveDoctor], [t0].[IsDispute], [t0].[ItemID], [t0].[ItemTypeID], [t0].[KindOfSicknessID], [t0].[NeedInHospital], [t0].[PackageID], [t0].[PayedAmount], [t0].[PlanExcuteDate], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[ReserveDoctorID], [t0].[ReturnMoneyStatus], [t0].[ReturnVisited], [t0].[Sconto], [t0].[Status], [t0].[Version]
FROM [dbo].[CustomerConsumptionDetails] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=135919
select * from CustomerConsumptionDetails where ReturnMoneyStatus=2
select * CustomerBaseInfo whr
exec sp_executesql N'SELECT [t0].[AllTotal], [t0].[ArrearsAmount], [t0].[BigCustomerEmployee], [t0].[BigCustomerEmployeeName], [t0].[Came], [t0].[CardNameID], [t0].[CashAmount], [t0].[CashOfMoneyCardAmount], [t0].[CertainProjectID], [t0].[ChargeBy], [t0].[ChargeByName], [t0].[ChargeOrReturn], [t0].[CustomerID], [t0].[CustomerStatus], [t0].[CustomerStatusID], [t0].[Date], [t0].[DocCode], [t0].[DocHandleBy], [t0].[DocHandleByName], [t0].[DocHandleDeptID], [t0].[DocHandleDeptName], [t0].[DocInfoCode], [t0].[DocType], [t0].[SceneEmployee], [t0].[TMKEmployee], [t0].[TempEmployee], [t0].[ID], [t0].[IncomeTypeID], [t0].[GoodsID], [t0].[HandselOfMoneyCardAmount], [t0].[InsteadMoneyAmount], [t0].[IntegrationAmount], [t0].[ItemID], [t0].[LeadersID], [t0].[MedicineID], [t0].[MHDetailsID], [t0].[MoneyCardPercent], [t0].[MoneyCardRealAmount], [t0].[PrePaymentAmount], [t0].[Quantity], [t0].[Quantity2], [t0].[ReturnCertainID], [t0].[ReturnMHID], [t0].[SceneEmployeeName], [t0].[TempEmployeeName], [t0].[TMKDeptID], [t0].[TMKDeptName], [t0].[TMKEmployeeName], [t0].[UnitPrice], [t0].[YearCardAmount]
FROM [dbo].[FinanceTotal] AS [t0]
WHERE [t0].[CustomerID] = @p0
ORDER BY [t0].[Date] DESC',N'@p0 varchar(8000)',@p0='ZBJZ11Z2H0'
exec sp_executesql N'SELECT [t0].[Aliases], [t0].[ID], [t0].[CategoryID], [t0].[ChangePrice], [t0].[ConsultingItemCategoryID], [t0].[CustomCode], [t0].[ExcuteDepartmentID], [t0].[GoodsCategoryID], [t0].[IncomeCategoryID], [t0].[IntervalOfOneTreatment], [t0].[IntervalOfTreatment], [t0].[IsConsume], [t0].[IsOperation], [t0].[IsPlace], [t0].[IsTreatment], [t0].[TopCategoryID], [t0].[LimitInsteadMoney], [t0].[LimitIntegration], [t0].[LimitSconto], [t0].[MaxPrice], [t0].[MinPrice], [t0].[MustExcute], [t0].[Name], [t0].[NationalCode], [t0].[NeedInHospital], [t0].[PriceOfOneTime], [t0].[Remark], [t0].[SimpleCode], [t0].[Standard], [t0].[StockQuantity], [t0].[Success], [t0].[TimesOfOneTreatment], [t0].[TimesOfTreatment], [t0].[Unit], [t0].[UnitPrice], [t0].[UseInMedicine], [t0].[Valid]
FROM [dbo].[ItemInfo] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 varchar(8000)',@p0='00060'
exec sp_executesql N'SELECT [t0].[ID], [t0].[DisplayOnConsulting], [t0].[TopCategoryID], [t0].[Name], [t0].[ParentID], [t0].[SimpleCode]
FROM [dbo].[ItemCategory] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 varchar(8000)',@p0='00002'
exec sp_executesql N'SELECT [t0].[Amount], [t0].[ApprovalEmployeeID], [t0].[ID], [t0].[CanExecute], [t0].[ChargeStatus], [t0].[ExcutionNumber], [t0].[ExcutePercent], [t0].[ExecuteStatus], [t0].[HandselItemModeID], [t0].[HasReserveDoctor], [t0].[IsDispute], [t0].[ItemID], [t0].[ItemTypeID], [t0].[KindOfSicknessID], [t0].[NeedInHospital], [t0].[PackageID], [t0].[PayedAmount], [t0].[PlanExcuteDate], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[ReserveDoctorID], [t0].[ReturnMoneyStatus], [t0].[ReturnVisited], [t0].[Sconto], [t0].[Status], [t0].[Version]
FROM [dbo].[CustomerConsumptionDetails] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=135919
exec sp_executesql N'SELECT [t0].[Amount], [t0].[ApprovalEmployeeID], [t0].[ID], [t0].[CanExecute], [t0].[ChargeStatus], [t0].[ExcutionNumber], [t0].[ExcutePercent], [t0].[ExecuteStatus], [t0].[HandselItemModeID], [t0].[HasReserveDoctor], [t0].[IsDispute], [t0].[ItemID], [t0].[ItemTypeID], [t0].[KindOfSicknessID], [t0].[NeedInHospital], [t0].[PackageID], [t0].[PayedAmount], [t0].[PlanExcuteDate], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[ReserveDoctorID], [t0].[ReturnMoneyStatus], [t0].[ReturnVisited], [t0].[Sconto], [t0].[Status], [t0].[Version]
FROM [dbo].[CustomerConsumptionDetails] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=131343
select * from CustomerConsumptionDetails where ReturnMoneyStatus=2;
select * from CustomerConsumptionInfo where Status=5;
select * from YUN_HIS20180521.dbo.H_FrontSK where sSFLB = '退费';
select * from YUN_HIS20180521.dbo.H_FrontSK where sSFLB = '纠纷退费';
select * from ReturnMoneyForCertainDoc;
18051506
select distinct(sSFLB) from YUN_HIS20180521.dbo.H_FrontSK
select * from CustomerBaseInfo;
select * from MemberCardHandle where MemberCardNum='18051506'
select * from CustomerBaseInfo where ID='ZBJZ11Z2H0'
exec sp_executesql N'SELECT [t0].[Amount], [t0].[ApprovalEmployeeID], [t0].[ID], [t0].[CanExecute], [t0].[ChargeStatus], [t0].[ExcutionNumber], [t0].[ExcutePercent], [t0].[ExecuteStatus], [t0].[HandselItemModeID], [t0].[HasReserveDoctor], [t0].[IsDispute], [t0].[ItemID], [t0].[ItemTypeID], [t0].[KindOfSicknessID], [t0].[NeedInHospital], [t0].[PackageID], [t0].[PayedAmount], [t0].[PlanExcuteDate], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[ReserveDoctorID], [t0].[ReturnMoneyStatus], [t0].[ReturnVisited], [t0].[Sconto], [t0].[Status], [t0].[Version]
FROM [dbo].[CustomerConsumptionDetails] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=53
exec sp_executesql N'SELECT [t0].[Amount], [t0].[ApprovalEmployeeID], [t0].[ID], [t0].[CanExecute], [t0].[ChargeStatus], [t0].[ExcutionNumber], [t0].[ExcutePercent], [t0].[ExecuteStatus], [t0].[HandselItemModeID], [t0].[HasReserveDoctor], [t0].[IsDispute], [t0].[ItemID], [t0].[ItemTypeID], [t0].[KindOfSicknessID], [t0].[NeedInHospital], [t0].[PackageID], [t0].[PayedAmount], [t0].[PlanExcuteDate], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[ReserveDoctorID], [t0].[ReturnMoneyStatus], [t0].[ReturnVisited], [t0].[Sconto], [t0].[Status], [t0].[Version]
FROM [dbo].[CustomerConsumptionDetails] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=2812
exec sp_executesql N'SELECT [t0].[Aliases], [t0].[ID], [t0].[CategoryID], [t0].[ChangePrice], [t0].[ConsultingItemCategoryID], [t0].[CustomCode], [t0].[ExcuteDepartmentID], [t0].[GoodsCategoryID], [t0].[IncomeCategoryID], [t0].[IntervalOfOneTreatment], [t0].[IntervalOfTreatment], [t0].[IsConsume], [t0].[IsOperation], [t0].[IsPlace], [t0].[IsTreatment], [t0].[TopCategoryID], [t0].[LimitInsteadMoney], [t0].[LimitIntegration], [t0].[LimitSconto], [t0].[MaxPrice], [t0].[MinPrice], [t0].[MustExcute], [t0].[Name], [t0].[NationalCode], [t0].[NeedInHospital], [t0].[PriceOfOneTime], [t0].[Remark], [t0].[SimpleCode], [t0].[Standard], [t0].[StockQuantity], [t0].[Success], [t0].[TimesOfOneTreatment], [t0].[TimesOfTreatment], [t0].[Unit], [t0].[UnitPrice], [t0].[UseInMedicine], [t0].[Valid]
FROM [dbo].[ItemInfo] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 varchar(8000)',@p0='00755'
exec sp_executesql N'SELECT [t0].[Amount], [t0].[ApprovalEmployeeID], [t0].[ID], [t0].[CanExecute], [t0].[ChargeStatus], [t0].[ExcutionNumber], [t0].[ExcutePercent], [t0].[ExecuteStatus], [t0].[HandselItemModeID], [t0].[HasReserveDoctor], [t0].[IsDispute], [t0].[ItemID], [t0].[ItemTypeID], [t0].[KindOfSicknessID], [t0].[NeedInHospital], [t0].[PackageID], [t0].[PayedAmount], [t0].[PlanExcuteDate], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[ReserveDoctorID], [t0].[ReturnMoneyStatus], [t0].[ReturnVisited], [t0].[Sconto], [t0].[Status], [t0].[Version]
FROM [dbo].[CustomerConsumptionDetails] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=1761
exec sp_executesql N'SELECT [t0].[Amount], [t0].[ApprovalEmployeeID], [t0].[ID], [t0].[CanExecute], [t0].[ChargeStatus], [t0].[ExcutionNumber], [t0].[ExcutePercent], [t0].[ExecuteStatus], [t0].[HandselItemModeID], [t0].[HasReserveDoctor], [t0].[IsDispute], [t0].[ItemID], [t0].[ItemTypeID], [t0].[KindOfSicknessID], [t0].[NeedInHospital], [t0].[PackageID], [t0].[PayedAmount], [t0].[PlanExcuteDate], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[ReserveDoctorID], [t0].[ReturnMoneyStatus], [t0].[ReturnVisited], [t0].[Sconto], [t0].[Status], [t0].[Version]
FROM [dbo].[CustomerConsumptionDetails] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=139581
exec sp_executesql N'SELECT [t0].[Aliases], [t0].[ID], [t0].[CategoryID], [t0].[ChangePrice], [t0].[ConsultingItemCategoryID], [t0].[CustomCode], [t0].[ExcuteDepartmentID], [t0].[GoodsCategoryID], [t0].[IncomeCategoryID], [t0].[IntervalOfOneTreatment], [t0].[IntervalOfTreatment], [t0].[IsConsume], [t0].[IsOperation], [t0].[IsPlace], [t0].[IsTreatment], [t0].[TopCategoryID], [t0].[LimitInsteadMoney], [t0].[LimitIntegration], [t0].[LimitSconto], [t0].[MaxPrice], [t0].[MinPrice], [t0].[MustExcute], [t0].[Name], [t0].[NationalCode], [t0].[NeedInHospital], [t0].[PriceOfOneTime], [t0].[Remark], [t0].[SimpleCode], [t0].[Standard], [t0].[StockQuantity], [t0].[Success], [t0].[TimesOfOneTreatment], [t0].[TimesOfTreatment], [t0].[Unit], [t0].[UnitPrice], [t0].[UseInMedicine], [t0].[Valid]
FROM [dbo].[ItemInfo] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 varchar(8000)',@p0='00755'
exec sp_executesql N'SELECT [t0].[ID], [t0].[DisplayOnConsulting], [t0].[TopCategoryID], [t0].[Name], [t0].[ParentID], [t0].[SimpleCode]
FROM [dbo].[ItemCategory] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 varchar(8000)',@p0='00021'
select * from CustomerConsumptionDetails where Amount <0;
select * from FinanceTotal
exec sp_executesql N'SELECT [t0].[AllTotal], [t0].[ArrearsAmount], [t0].[BigCustomerEmployee], [t0].[BigCustomerEmployeeName], [t0].[Came], [t0].[CardNameID], [t0].[CashAmount], [t0].[CashOfMoneyCardAmount], [t0].[CertainProjectID], [t0].[ChargeBy], [t0].[ChargeByName], [t0].[ChargeOrReturn], [t0].[CustomerID], [t0].[CustomerStatus], [t0].[CustomerStatusID], [t0].[Date], [t0].[DocCode], [t0].[DocHandleBy], [t0].[DocHandleByName], [t0].[DocHandleDeptID], [t0].[DocHandleDeptName], [t0].[DocInfoCode], [t0].[DocType], [t0].[SceneEmployee], [t0].[TMKEmployee], [t0].[TempEmployee], [t0].[ID], [t0].[IncomeTypeID], [t0].[GoodsID], [t0].[HandselOfMoneyCardAmount], [t0].[InsteadMoneyAmount], [t0].[IntegrationAmount], [t0].[ItemID], [t0].[LeadersID], [t0].[MedicineID], [t0].[MHDetailsID], [t0].[MoneyCardPercent], [t0].[MoneyCardRealAmount], [t0].[PrePaymentAmount], [t0].[Quantity], [t0].[Quantity2], [t0].[ReturnCertainID], [t0].[ReturnMHID], [t0].[SceneEmployeeName], [t0].[TempEmployeeName], [t0].[TMKDeptID], [t0].[TMKDeptName], [t0].[TMKEmployeeName], [t0].[UnitPrice], [t0].[YearCardAmount]
FROM [dbo].[FinanceTotal] AS [t0]
WHERE [t0].[CustomerID] = @p0 and
AllTotal<0
ORDER BY [t0].[Date] DESC',N'@p0 varchar(8000)',@p0='ZBJZ11Z2H0'
select * from CustomerConsumptionDetails where ID in
(select DocCode from FinanceTotal where AllTotal<0)
exec sp_executesql N'SELECT [t0].[AllTotal], [t0].[ArrearsAmount], [t0].[BigCustomerEmployee], [t0].[BigCustomerEmployeeName], [t0].[Came], [t0].[CardNameID], [t0].[CashAmount], [t0].[CashOfMoneyCardAmount], [t0].[CertainProjectID], [t0].[ChargeBy], [t0].[ChargeByName], [t0].[ChargeOrReturn], [t0].[CustomerID], [t0].[CustomerStatus], [t0].[CustomerStatusID], [t0].[Date], [t0].[DocCode], [t0].[DocHandleBy], [t0].[DocHandleByName], [t0].[DocHandleDeptID], [t0].[DocHandleDeptName], [t0].[DocInfoCode], [t0].[DocType], [t0].[SceneEmployee], [t0].[TMKEmployee], [t0].[TempEmployee], [t0].[ID], [t0].[IncomeTypeID], [t0].[GoodsID], [t0].[HandselOfMoneyCardAmount], [t0].[InsteadMoneyAmount], [t0].[IntegrationAmount], [t0].[ItemID], [t0].[LeadersID], [t0].[MedicineID], [t0].[MHDetailsID], [t0].[MoneyCardPercent], [t0].[MoneyCardRealAmount], [t0].[PrePaymentAmount], [t0].[Quantity], [t0].[Quantity2], [t0].[ReturnCertainID], [t0].[ReturnMHID], [t0].[SceneEmployeeName], [t0].[TempEmployeeName], [t0].[TMKDeptID], [t0].[TMKDeptName], [t0].[TMKEmployeeName], [t0].[UnitPrice], [t0].[YearCardAmount]
FROM [dbo].[FinanceTotal] AS [t0]
WHERE [t0].[CustomerID] = @p0
ORDER BY [t0].[Date] DESC',N'@p0 varchar(8000)',@p0='ZBJZ11Z2H0'
select * from FinanceTotal where DocType='退项目单据' or DocType='纠纷退费单据'
select * from CustomerConsumptionDetails where ExcutionNumber in (select DocInfoCode from FinanceTotal where DocType='退项目单据' or DocType='纠纷退费单据')
select * from FinanceTotal where DocType='退项目单据' and CustomerID='ZBJZ11Z2H0'
select * from CustomerConsumptionDetails where ExcutionNumber in (select DocInfoCode from FinanceTotal where DocType='退项目单据' and CustomerID='ZBJZ11Z2H0')
select * from CustomerConsumptionDetails where ID in (select CertainProjectID from FinanceTotal where DocType='退项目单据' and CustomerID='ZBJZ11Z2H0')
select * from CustomerConsumptionDetails where ExcutionNumber in (select DocInfoCode from FinanceTotal where DocType='退项目单据' )
select * from CustomerConsumptionDetails where ID in (select CertainProjectID from FinanceTotal where DocType='退项目单据' )
select * from FinanceTotal where DocType='退项目单据'
select ReturnMoneyStatus from CustomerConsumptionDetails where ID in (select CertainProjectID from FinanceTotal where DocType='退项目单据' )
update CustomerConsumptionDetails set ReturnMoneyStatus=2 where ID in (select CertainProjectID from FinanceTotal where DocType='退项目单据' )
select * from CustomerConsumptionDetails where ID in (select CertainProjectID from FinanceTotal where DocType='纠纷退费单据' )
update CustomerConsumptionDetails set ReturnMoneyStatus=2,IsDispute=1 where ID in (select CertainProjectID from FinanceTotal where DocType='纠纷退费单据' )
select * from FinanceTotal where DocInfoCode='MZJPA743LH94'
select * from CustomerBaseInfo where ID='KAGN7ORHXP'
select * from FinanceTotal where DocInfoCode='FTN3EDRCHZH6'
select * from CustomerBaseInfo where ID='N8EYNTQNWK'
exec sp_executesql N'SELECT
(CASE
WHEN [t0].[AnesthetistID] IS NOT NULL THEN CONVERT(NVarChar(MAX),[t3].[Name])
ELSE NULL
END) AS [AnesthetistName],
(CASE
WHEN [t0].[FirstAssistantID] IS NOT NULL THEN CONVERT(NVarChar(MAX),[t4].[Name])
ELSE NULL
END) AS [AssistantName],
(CASE
WHEN [t0].[TwoAssistantID] IS NOT NULL THEN CONVERT(NVarChar(MAX),[t5].[Name])
ELSE NULL
END) AS [AssistantTwoName], [t7].[Name] AS [DeptName],
(CASE
WHEN [t0].[DoctorID] IS NOT NULL THEN CONVERT(NVarChar(MAX),[t8].[Name])
ELSE NULL
END) AS [DoctorName], [t0].[Date] AS [ExcuteDate], [t0].[ExcuteQuantity], [t0].[Excutetimes] AS [ExcuteTimes], [t6].[Name] AS [ItemName], [t6].[Standard] AS [ItemStandard], [t1].[Amount], [t1].[ApprovalEmployeeID], [t1].[ID], [t1].[CanExecute], [t1].[ChargeStatus], [t1].[ExcutionNumber], [t1].[ExcutePercent], [t1].[ExecuteStatus], [t1].[HandselItemModeID], [t1].[HasReserveDoctor], [t1].[IsDispute], [t1].[ItemID], [t1].[ItemTypeID], [t1].[KindOfSicknessID], [t1].[NeedInHospital], [t1].[PackageID], [t1].[PayedAmount], [t1].[PlanExcuteDate], [t1].[Price], [t1].[Quantity], [t1].[Quantity2], [t1].[Remark], [t1].[ReserveDoctorID], [t1].[ReturnMoneyStatus], [t1].[ReturnVisited], [t1].[Sconto], [t1].[Status], [t1].[Version], [t0].[ExcuteRecord] AS [Remark2]
FROM [dbo].[ExcuteInfo] AS [t0]
INNER JOIN [dbo].[CustomerConsumptionDetails] AS [t1] ON [t1].[ID] = [t0].[CertainProjectID]
INNER JOIN [dbo].[CustomerConsumptionInfo] AS [t2] ON [t2].[ExcutionNumber] = [t1].[ExcutionNumber]
LEFT OUTER JOIN [dbo].[Employee] AS [t3] ON [t3].[ID] = [t0].[AnesthetistID]
LEFT OUTER JOIN [dbo].[Employee] AS [t4] ON [t4].[ID] = [t0].[FirstAssistantID]
LEFT OUTER JOIN [dbo].[Employee] AS [t5] ON [t5].[ID] = [t0].[TwoAssistantID]
INNER JOIN [dbo].[ItemInfo] AS [t6] ON [t6].[ID] = [t1].[ItemID]
INNER JOIN [dbo].[Department] AS [t7] ON [t7].[ID] = [t6].[ExcuteDepartmentID]
LEFT OUTER JOIN [dbo].[Employee] AS [t8] ON [t8].[ID] = [t0].[DoctorID]
WHERE ([t2].[CustomerID] = @p0) AND (NOT ([t0].[Cancel] = 1))',N'@p0 varchar(8000)',@p0='KAGN7ORHXP'
select * from ExcuteInfo
select * from CustomerConsumptionDetails
exec sp_executesql N'SELECT
(CASE
WHEN [t0].[AnesthetistID] IS NOT NULL THEN CONVERT(NVarChar(MAX),[t3].[Name])
ELSE NULL
END) AS [AnesthetistName],
(CASE
WHEN [t0].[FirstAssistantID] IS NOT NULL THEN CONVERT(NVarChar(MAX),[t4].[Name])
ELSE NULL
END) AS [AssistantName],
(CASE
WHEN [t0].[TwoAssistantID] IS NOT NULL THEN CONVERT(NVarChar(MAX),[t5].[Name])
ELSE NULL
END) AS [AssistantTwoName], [t7].[Name] AS [DeptName],
(CASE
WHEN [t0].[DoctorID] IS NOT NULL THEN CONVERT(NVarChar(MAX),[t8].[Name])
ELSE NULL
END) AS [DoctorName], [t0].[Date] AS [ExcuteDate], [t0].[ExcuteQuantity], [t0].[Excutetimes] AS [ExcuteTimes], [t6].[Name] AS [ItemName], [t6].[Standard] AS [ItemStandard], [t1].[Amount], [t1].[ApprovalEmployeeID], [t1].[ID], [t1].[CanExecute], [t1].[ChargeStatus], [t1].[ExcutionNumber], [t1].[ExcutePercent], [t1].[ExecuteStatus], [t1].[HandselItemModeID], [t1].[HasReserveDoctor], [t1].[IsDispute], [t1].[ItemID], [t1].[ItemTypeID], [t1].[KindOfSicknessID], [t1].[NeedInHospital], [t1].[PackageID], [t1].[PayedAmount], [t1].[PlanExcuteDate], [t1].[Price], [t1].[Quantity], [t1].[Quantity2], [t1].[Remark], [t1].[ReserveDoctorID], [t1].[ReturnMoneyStatus], [t1].[ReturnVisited], [t1].[Sconto], [t1].[Status], [t1].[Version], [t0].[ExcuteRecord] AS [Remark2]
FROM [dbo].[ExcuteInfo] AS [t0]
INNER JOIN [dbo].[CustomerConsumptionDetails] AS [t1] ON [t1].[ID] = [t0].[CertainProjectID]
INNER JOIN [dbo].[CustomerConsumptionInfo] AS [t2] ON [t2].[ExcutionNumber] = [t1].[ExcutionNumber]
LEFT OUTER JOIN [dbo].[Employee] AS [t3] ON [t3].[ID] = [t0].[AnesthetistID]
LEFT OUTER JOIN [dbo].[Employee] AS [t4] ON [t4].[ID] = [t0].[FirstAssistantID]
LEFT OUTER JOIN [dbo].[Employee] AS [t5] ON [t5].[ID] = [t0].[TwoAssistantID]
INNER JOIN [dbo].[ItemInfo] AS [t6] ON [t6].[ID] = [t1].[ItemID]
INNER JOIN [dbo].[Department] AS [t7] ON [t7].[ID] = [t6].[ExcuteDepartmentID]
LEFT OUTER JOIN [dbo].[Employee] AS [t8] ON [t8].[ID] = [t0].[DoctorID]
WHERE ([t2].[CustomerID] = @p0) AND (NOT ([t0].[Cancel] = 1))',N'@p0 varchar(8000)',@p0='0LTXZJSAB4'
select ReturnMoneyStatus from CustomerConsumptionDetails where ID in (select CertainProjectID from FinanceTotal where DocType='退项目单据' )
update CustomerConsumptionDetails set ReturnMoneyStatus=2 where ID in (select CertainProjectID from FinanceTotal where DocType='退项目单据' )
select * from CustomerConsumptionDetails where ID in (select CertainProjectID from FinanceTotal where DocType='纠纷退费单据' )
update CustomerConsumptionDetails set ReturnMoneyStatus=2,IsDispute=1 where ID in (select CertainProjectID from FinanceTotal where DocType='纠纷退费单据' )
select * from CustomerConsumptionInfo
select * from CustomerConsumptionDetails
select * from ExcuteInfo where CertainProjectID in (select ID from CustomerConsumptionDetails)
select * from ExcuteInfo
--delete from ExcuteDetails
select count(*) from bh20180522.dbo.ExcuteDetails
select * from ExcuteDetails
select * from ExcuteInfo
select count(*) from H_FrontSK_Project_Execute
select count(*) from H_FrontSK_Project_Execute_D
update H_FrontSK_Project_Execute set dZXDT=''
select * from CustomerConsumptionDetails
exec sp_executesql N'SELECT [t0].[Amount], [t0].[ApprovalEmployeeID], [t0].[ID], [t0].[CanExecute], [t0].[ChargeStatus], [t0].[ExcutionNumber], [t0].[ExcutePercent], [t0].[ExecuteStatus], [t0].[HandselItemModeID], [t0].[HasReserveDoctor], [t0].[IsDispute], [t0].[ItemID], [t0].[ItemTypeID], [t0].[KindOfSicknessID], [t0].[NeedInHospital], [t0].[PackageID], [t0].[PayedAmount], [t0].[PlanExcuteDate], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[ReserveDoctorID], [t0].[ReturnMoneyStatus], [t0].[ReturnVisited], [t0].[Sconto], [t0].[Status], [t0].[Version]
FROM [dbo].[CustomerConsumptionDetails] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=137783
exec sp_executesql N'SELECT [t0].[AllTotal], [t0].[ArrearsAmount], [t0].[BigCustomerEmployee], [t0].[BigCustomerEmployeeName], [t0].[Came], [t0].[CardNameID], [t0].[CashAmount], [t0].[CashOfMoneyCardAmount], [t0].[CertainProjectID], [t0].[ChargeBy], [t0].[ChargeByName], [t0].[ChargeOrReturn], [t0].[CustomerID], [t0].[CustomerStatus], [t0].[CustomerStatusID], [t0].[Date], [t0].[DocCode], [t0].[DocHandleBy], [t0].[DocHandleByName], [t0].[DocHandleDeptID], [t0].[DocHandleDeptName], [t0].[DocInfoCode], [t0].[DocType], [t0].[SceneEmployee], [t0].[TMKEmployee], [t0].[TempEmployee], [t0].[ID], [t0].[IncomeTypeID], [t0].[GoodsID], [t0].[HandselOfMoneyCardAmount], [t0].[InsteadMoneyAmount], [t0].[IntegrationAmount], [t0].[ItemID], [t0].[LeadersID], [t0].[MedicineID], [t0].[MHDetailsID], [t0].[MoneyCardPercent], [t0].[MoneyCardRealAmount], [t0].[PrePaymentAmount], [t0].[Quantity], [t0].[Quantity2], [t0].[ReturnCertainID], [t0].[ReturnMHID], [t0].[SceneEmployeeName], [t0].[TempEmployeeName], [t0].[TMKDeptID], [t0].[TMKDeptName], [t0].[TMKEmployeeName], [t0].[UnitPrice], [t0].[YearCardAmount]
FROM [dbo].[FinanceTotal] AS [t0]
WHERE [t0].[CustomerID] = @p0
ORDER BY [t0].[Date] DESC',N'@p0 varchar(8000)',@p0='2J4TJ60MT8'
exec sp_executesql N'SELECT [t0].[Amount], [t0].[ApprovalEmployeeID], [t0].[ID], [t0].[CanExecute], [t0].[ChargeStatus], [t0].[ExcutionNumber], [t0].[ExcutePercent], [t0].[ExecuteStatus], [t0].[HandselItemModeID], [t0].[HasReserveDoctor], [t0].[IsDispute], [t0].[ItemID], [t0].[ItemTypeID], [t0].[KindOfSicknessID], [t0].[NeedInHospital], [t0].[PackageID], [t0].[PayedAmount], [t0].[PlanExcuteDate], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[ReserveDoctorID], [t0].[ReturnMoneyStatus], [t0].[ReturnVisited], [t0].[Sconto], [t0].[Status], [t0].[Version]
FROM [dbo].[CustomerConsumptionDetails] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=172
exec sp_executesql N'SELECT [t0].[Amount], [t0].[ApprovalEmployeeID], [t0].[ID], [t0].[CanExecute], [t0].[ChargeStatus], [t0].[ExcutionNumber], [t0].[ExcutePercent], [t0].[ExecuteStatus], [t0].[HandselItemModeID], [t0].[HasReserveDoctor], [t0].[IsDispute], [t0].[ItemID], [t0].[ItemTypeID], [t0].[KindOfSicknessID], [t0].[NeedInHospital], [t0].[PackageID], [t0].[PayedAmount], [t0].[PlanExcuteDate], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[ReserveDoctorID], [t0].[ReturnMoneyStatus], [t0].[ReturnVisited], [t0].[Sconto], [t0].[Status], [t0].[Version]
FROM [dbo].[CustomerConsumptionDetails] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=173
select * from H_FrontSK_Project_Execute where fNum>1; where sFID='SK130307048'
select * from CustomerBaseInfoID where Now='2J4TJ60MT8'
select * from H_TMK where FID='JZ121230070'
SK130311041
13030717
SK130307048
select * from H_FrontSK where sCID='13030717'
select * from H_FrontSK_Project_Execute where sFID='SK130311041'
select * from H_FrontSK_Project_Execute where dZXDT is null
select * from H_FrontSK where FID='SK130311041'
select * from H_TMK where CardNO='13030216'
select * from bh20180529.dbo.ExcuteDetails
--delete from bh20180529.dbo.ExcuteDetails
select * from bh20180522.dbo.ExcuteDetails
DBCC CHECKIDENT('ExcuteDetails', RESEED, 1)
insert into bh20180529.dbo.ExcuteDetails(ExcuteID,PayModeID,Amount,CardNumber,IsPayed,IsHandselMoney,ArrearsPaymentDate)
select ExcuteID,PayModeID,Amount,CardNumber,IsPayed,IsHandselMoney,ArrearsPaymentDate from bh20180522.dbo.ExcuteDetails where ExcuteID<=251912
select max(ID) from bh20180529.dbo.ExcuteInfo;
select max(ID) from bh20180522.dbo.ExcuteInfo;
delete from bh20180522.dbo.ExcuteInfo where ID> 251912
select * from bh20180522.dbo.ExcuteDetails where ExcuteID>251912
select * from ExcuteDetails where ExcuteID not in (select ID from ExcuteInfo)
select count(*) from bh20180529.dbo.ExcuteDetails;
select count(*) from bh20180522.dbo.ExcuteDetails;
select count(*) from bh20180529.dbo.ExcuteDetails;
select * from bh20180522.dbo.ExcuteDetails;
ALTER DATABASE bh20180529 SET NEW_BROKER WITH ROLLBACK IMMEDIATE;
ALTER DATABASE bh20180529 SET ENABLE_BROKER;
exec sp_executesql N'SELECT [t0].[AllTotal], [t0].[ArrearsAmount], [t0].[BigCustomerEmployee], [t0].[BigCustomerEmployeeName], [t0].[Came], [t0].[CardNameID], [t0].[CashAmount], [t0].[CashOfMoneyCardAmount], [t0].[CertainProjectID], [t0].[ChargeBy], [t0].[ChargeByName], [t0].[ChargeOrReturn], [t0].[CustomerID], [t0].[CustomerStatus], [t0].[CustomerStatusID], [t0].[Date], [t0].[DocCode], [t0].[DocHandleBy], [t0].[DocHandleByName], [t0].[DocHandleDeptID], [t0].[DocHandleDeptName], [t0].[DocInfoCode], [t0].[DocType], [t0].[SceneEmployee], [t0].[TMKEmployee], [t0].[TempEmployee], [t0].[ID], [t0].[IncomeTypeID], [t0].[GoodsID], [t0].[HandselOfMoneyCardAmount], [t0].[InsteadMoneyAmount], [t0].[IntegrationAmount], [t0].[ItemID], [t0].[LeadersID], [t0].[MedicineID], [t0].[MHDetailsID], [t0].[MoneyCardPercent], [t0].[MoneyCardRealAmount], [t0].[PrePaymentAmount], [t0].[Quantity], [t0].[Quantity2], [t0].[ReturnCertainID], [t0].[ReturnMHID], [t0].[SceneEmployeeName], [t0].[TempEmployeeName], [t0].[TMKDeptID], [t0].[TMKDeptName], [t0].[TMKEmployeeName], [t0].[UnitPrice], [t0].[YearCardAmount]
FROM [dbo].[FinanceTotal] AS [t0]
WHERE [t0].[CustomerID] = @p0
ORDER BY [t0].[Date] DESC',N'@p0 varchar(8000)',@p0='027HJQSV0U'
027HJQSV0U
select * from FinanceTotal where CustomerID='027HJQSV0U';
select * from CustomerConsumptionDetails where ExcutionNumber='AM80F3N4GKDS'
select * from CustomerBaseInfoID where Now='027HJQSV0U'
select * from YUN_HIS20180521.dbo.H_TMK where FID='XC150925023'
select * from YUN_HIS20180521.dbo.H_FrontSK_Project_Execute where
select * from YUN_HIS20180521.dbo.H_FrontSK where sCID='80032630'
select * from YUN_HIS20180521.dbo.H_FrontSK where sCID='17091304'
select top 100 * from YUN_HIS20180521.dbo.H_FrontSK_Project_Execute-- where sFID='SK150831020'
select * from YUN_HIS20180521.dbo.H_FrontSK where mTotal>0 and FID not in (select sFID from YUN_HIS20180521.dbo.H_FrontSK_Project_Execute)
select top 100 * from CustomerConsumptionDetails
select top 100 * from FinanceTotal where DocType;
select top 100 * from ExcuteInfo;
select distinct(DocType) from FinanceTotal
select * from FinanceTotal where DocType='住院或门诊划价单'
select * from CustomerConsumptionDetails where ID in (select CertainProjectID from FinanceTotal where DocType='住院或门诊划价单')
update CustomerConsumptionDetails set ExcutePercent=1,ExecuteStatus=2,ChargeStatus=1,CanExecute=0 where ID in (select CertainProjectID from FinanceTotal where DocType='住院或门诊划价单')
exec sp_executesql N'SELECT [t0].[Amount], [t0].[ApprovalEmployeeID], [t0].[ID], [t0].[CanExecute], [t0].[ChargeStatus], [t0].[ExcutionNumber], [t0].[ExcutePercent], [t0].[ExecuteStatus], [t0].[HandselItemModeID], [t0].[HasReserveDoctor], [t0].[IsDispute], [t0].[ItemID], [t0].[ItemTypeID], [t0].[KindOfSicknessID], [t0].[NeedInHospital], [t0].[PackageID], [t0].[PayedAmount], [t0].[PlanExcuteDate], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[ReserveDoctorID], [t0].[ReturnMoneyStatus], [t0].[ReturnVisited], [t0].[Sconto], [t0].[Status], [t0].[Version]
FROM [dbo].[CustomerConsumptionDetails] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=139861
exec sp_executesql N'SELECT [t0].[Aliases], [t0].[ID], [t0].[CategoryID], [t0].[ChangePrice], [t0].[ConsultingItemCategoryID], [t0].[CustomCode], [t0].[ExcuteDepartmentID], [t0].[GoodsCategoryID], [t0].[IncomeCategoryID], [t0].[IntervalOfOneTreatment], [t0].[IntervalOfTreatment], [t0].[IsConsume], [t0].[IsOperation], [t0].[IsPlace], [t0].[IsTreatment], [t0].[TopCategoryID], [t0].[LimitInsteadMoney], [t0].[LimitIntegration], [t0].[LimitSconto], [t0].[MaxPrice], [t0].[MinPrice], [t0].[MustExcute], [t0].[Name], [t0].[NationalCode], [t0].[NeedInHospital], [t0].[PriceOfOneTime], [t0].[Remark], [t0].[SimpleCode], [t0].[Standard], [t0].[StockQuantity], [t0].[Success], [t0].[TimesOfOneTreatment], [t0].[TimesOfTreatment], [t0].[Unit], [t0].[UnitPrice], [t0].[UseInMedicine], [t0].[Valid]
FROM [dbo].[ItemInfo] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 varchar(8000)',@p0='00249'
select * from ItemInfo;
exec sp_executesql N'SELECT [t0].[ID], [t0].[DisplayOnConsulting], [t0].[TopCategoryID], [t0].[Name], [t0].[ParentID], [t0].[SimpleCode]
FROM [dbo].[ItemCategory] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 varchar(8000)',@p0='00024'
select * from ItemCategory;
exec sp_executesql N'SELECT [t0].[Amount], [t0].[ApprovalEmployeeID], [t0].[ID], [t0].[CanExecute], [t0].[ChargeStatus], [t0].[ExcutionNumber], [t0].[ExcutePercent], [t0].[ExecuteStatus], [t0].[HandselItemModeID], [t0].[HasReserveDoctor], [t0].[IsDispute], [t0].[ItemID], [t0].[ItemTypeID], [t0].[KindOfSicknessID], [t0].[NeedInHospital], [t0].[PackageID], [t0].[PayedAmount], [t0].[PlanExcuteDate], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[ReserveDoctorID], [t0].[ReturnMoneyStatus], [t0].[ReturnVisited], [t0].[Sconto], [t0].[Status], [t0].[Version]
FROM [dbo].[CustomerConsumptionDetails] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=47283
exec sp_executesql N'SELECT [t0].[AllTotal], [t0].[ArrearsAmount], [t0].[BigCustomerEmployee], [t0].[BigCustomerEmployeeName], [t0].[Came], [t0].[CardNameID], [t0].[CashAmount], [t0].[CashOfMoneyCardAmount], [t0].[CertainProjectID], [t0].[ChargeBy], [t0].[ChargeByName], [t0].[ChargeOrReturn], [t0].[CustomerID], [t0].[CustomerStatus], [t0].[CustomerStatusID], [t0].[Date], [t0].[DocCode], [t0].[DocHandleBy], [t0].[DocHandleByName], [t0].[DocHandleDeptID], [t0].[DocHandleDeptName], [t0].[DocInfoCode], [t0].[DocType], [t0].[SceneEmployee], [t0].[TMKEmployee], [t0].[TempEmployee], [t0].[ID], [t0].[IncomeTypeID], [t0].[GoodsID], [t0].[HandselOfMoneyCardAmount], [t0].[InsteadMoneyAmount], [t0].[IntegrationAmount], [t0].[ItemID], [t0].[LeadersID], [t0].[MedicineID], [t0].[MHDetailsID], [t0].[MoneyCardPercent], [t0].[MoneyCardRealAmount], [t0].[PrePaymentAmount], [t0].[Quantity], [t0].[Quantity2], [t0].[ReturnCertainID], [t0].[ReturnMHID], [t0].[SceneEmployeeName], [t0].[TempEmployeeName], [t0].[TMKDeptID], [t0].[TMKDeptName], [t0].[TMKEmployeeName], [t0].[UnitPrice], [t0].[YearCardAmount]
FROM [dbo].[FinanceTotal] AS [t0]
WHERE [t0].[CustomerID] = @p0
ORDER BY [t0].[Date] DESC',N'@p0 varchar(8000)',@p0='02KCYQQ2KM'
exec sp_executesql N'SELECT [t0].[Amount], [t0].[ApprovalEmployeeID], [t0].[ID], [t0].[CanExecute], [t0].[ChargeStatus], [t0].[ExcutionNumber], [t0].[ExcutePercent], [t0].[ExecuteStatus], [t0].[HandselItemModeID], [t0].[HasReserveDoctor], [t0].[IsDispute], [t0].[ItemID], [t0].[ItemTypeID], [t0].[KindOfSicknessID], [t0].[NeedInHospital], [t0].[PackageID], [t0].[PayedAmount], [t0].[PlanExcuteDate], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[ReserveDoctorID], [t0].[ReturnMoneyStatus], [t0].[ReturnVisited], [t0].[Sconto], [t0].[Status], [t0].[Version]
FROM [dbo].[CustomerConsumptionDetails] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=110526
select * from CustomerConsumptionDetails where ID='110526'
select * from H_FrontSK_Project_Execute;
select * from YUN_HIS20180521.dbo.H_FrontSK where sCID='17091304'
select * from YUN_HIS20180521.dbo.H_FrontSK_Project_Execute_D where sKeyID='ZX000001822181'
select * from ChargeForCertainDocInfo where ExcutionNumber='HSP096BIOGC2'
select * from ChargeForCertainDocDetails where ExcutionNumber='HSP096BIOGC2'
select * from PayModeInfo;
select * from FinanceTotal where CustomerID='8OUA40SX5T'
select * from IntegrationGenerateLog where CustomerID='8OUA40SX5T'
select * from ReturnMoneyForCertainDoc;
exec sp_executesql N'SELECT TOP (1) [t0].[Amount], [t0].[ArrearsUnPayed], [t0].[BuyAmount], [t0].[BuyDate], [t0].[BuyPrice], [t0].[BuyQuantity], [t0].[BuyQuantity2], [t0].[BuySconto], [t0].[CertainProjectID], [t0].[CustomerID], [t0].[Date], [t0].[HandleBy], [t0].[ExcutionNumber], [t0].[ID], [t0].[IsInside], [t0].[ItemID], [t0].[ItemName], [t0].[ParticipateEmployees], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[SaleBy], [t0].[Status]
FROM [dbo].[ReturnMoneyForCertainDoc] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=2769
SELECT [t0].[ID], [t0].[IsBaseMode], [t0].[PayModeName], [t0].[Remark], [t0].[SN], [t0].[SupportCertain], [t0].[SupportMorh], [t0].[Valid]
FROM [dbo].[PayModeInfo] AS [t0]
WHERE ([t0].[IsBaseMode] = 1) AND ([t0].[Valid] = 1)
ORDER BY [t0].[SN]
exec sp_executesql N'SELECT [t0].[Amount], [t0].[ArrearsUnPayed], [t0].[BuyAmount], [t0].[BuyDate], [t0].[BuyPrice], [t0].[BuyQuantity], [t0].[BuyQuantity2], [t0].[BuySconto], [t0].[CertainProjectID], [t0].[CustomerID], [t0].[Date], [t0].[HandleBy], [t0].[ExcutionNumber], [t0].[ID], [t0].[IsInside], [t0].[ItemID], [t0].[ItemName], [t0].[ParticipateEmployees], [t0].[Price], [t0].[Quantity], [t0].[Quantity2], [t0].[Remark], [t0].[SaleBy], [t0].[Status]
FROM [dbo].[ReturnMoneyForCertainDoc] AS [t0]
WHERE [t0].[ID] = @p0',N'@p0 bigint',@p0=2769
exec sp_executesql N'SELECT [t0].[Amount], [t0].[CardNumber], [t0].[ID], [t0].[IsDispute], [t0].[IsHandselMoney], [t0].[PayModeID], [t0].[Remark], [t0].[ReturnInfoID]
FROM [dbo].[ReturnMoneyForCertainDocDetails] AS [t0]
WHERE [t0].[ReturnInfoID] = @p0',N'@p0 bigint',@p0=2769
select * from AccountsOfCustomer where CustomerID='1IN7C8NKNO'
update AccountsOfCustomer set IntegrationBalance=0 where CustomerID='1IN7C8NKNO'
select * from ReturnMoneyForCertainDoc where ID='2779'
select * from ReturnMoneyForCertainDocDetails where ReturnInfoID='2779'
select * from AccountsOfCustomer where IntegrationBalance>10000 and CustomerID='BBY9B25KEL'
select * from CustomerBaseInfo where ID='BBY9B25KEL'
exec sp_executesql N'SELECT [t0].[CardNo], [t0].[Checked], [t0].[CustomerID], [t0].[Date], [t0].[HandleBy], [t0].[Manual], [t0].[MemberCardNum], [t0].[NewRankID], [t0].[Valid]
FROM [dbo].[MemberCardHandle] AS [t0]
WHERE ([t0].[Valid] = 1) AND ([t0].[CustomerID] = @p0)',N'@p0 varchar(8000)',@p0='4TWBJ2ZG5O'
exec sp_executesql N'SELECT [t0].[Amount], [t0].[Balance], [t0].[CustomerID], [t0].[IntegrationBalance], [t0].[Invoice], [t0].[Version]
FROM [dbo].[AccountsOfCustomer] AS [t0]
WHERE [t0].[CustomerID] = @p0',N'@p0 varchar(8000)',@p0='4TWBJ2ZG5O'
update AccountsOfCustomer set Balance=3000,IntegrationBalance=3200 where CustomerID='4TWBJ2ZG5O'
select * from IntegrationDetails where CustomerID='4TWBJ2ZG5O'
select * from IntegrationUseLog where CustomerID='4TWBJ2ZG5O'
select * from IntegrationGenerateLog where Balance>0
select * from ChargeForCertainDocInfo order by Date desc
select * from ChargeForCertainDocDetails where ExcutionNumber='HSMBAWELDB7Z'
select * from PayModeInfo;