ALTER
PROCEDURE
[
dbo
]
.
[
sp_GetListPortfolio
]
@AccountId uniqueidentifier
as
select PortfolioId,
AccountId,
PortfolioName,
CreateDate,
CAST (TotalCost as decimal ( 38 , 2 )) as TotalCost,
CAST (TotalMarket as decimal ( 38 , 2 )) as TotalMarket,
CAST (EarnMoney as decimal ( 38 , 2 )) as EarnMoney,
CAST ((TotalMarket - TotalCost) as decimal ( 38 , 2 )) as EarnNow,
CAST (( case when TotalCost < 0.1 then 0 else 100 * (TotalMarket - TotalCost) / TotalCost end ) as decimal ( 38 , 2 )) as EarnNowPercent,
( case when type = 0 then N ' 观察组合 ' else N ' 实际组合 ' end ) as [ Type ]
from Portfolio with (nolock)
where AccountId = @AccountId
@AccountId uniqueidentifier
as
select PortfolioId,
AccountId,
PortfolioName,
CreateDate,
CAST (TotalCost as decimal ( 38 , 2 )) as TotalCost,
CAST (TotalMarket as decimal ( 38 , 2 )) as TotalMarket,
CAST (EarnMoney as decimal ( 38 , 2 )) as EarnMoney,
CAST ((TotalMarket - TotalCost) as decimal ( 38 , 2 )) as EarnNow,
CAST (( case when TotalCost < 0.1 then 0 else 100 * (TotalMarket - TotalCost) / TotalCost end ) as decimal ( 38 , 2 )) as EarnNowPercent,
( case when type = 0 then N ' 观察组合 ' else N ' 实际组合 ' end ) as [ Type ]
from Portfolio with (nolock)
where AccountId = @AccountId