コード例 #1
0
        protected void GetZxFundModelFromDQ(Guid userId)
        {
            string sql  = @"select * from FundAccountInfo_ZX with(nolock) where UserId=@UserId";
            var    para = new DynamicParameters();

            para.Add("@UserId", userId);

            ZxFundModelFromDq = TuanDai.DB.TuanDaiDB.QueryFirstOrDefault <FundAccountInfo_Zx>(TdConfig.ApplicationName, "/BD/dqread", sql,
                                                                                              ref para);
            if (ZxFundModelFromDq == null)
            {
                ZxFundModelFromDq = new FundAccountInfo_Zx();
            }
        }
コード例 #2
0
        protected void GetZxFundModelFromDQ(Guid userId)
        {
            string sql  = @"select * from FundAccountInfo_ZX with(nolock) where UserId=@UserId";
            var    para = new DynamicParameters();

            para.Add("@UserId", userId);

            ZxFundModelFromDq = TuanDai.DB.TuanDaiDB.QueryFirstOrDefault <FundAccountInfo_Zx>(TdConfig.ApplicationName, "/BD/dqread", sql,
                                                                                              ref para);
            if (ZxFundModelFromDq == null)
            {
                ZxFundModelFromDq = new FundAccountInfo_Zx();
            }

            sql         = @"select sum(isnull(o.OverDueInterest,0)+case when isnull(s.IsVip,0)=1 then isnull(o.PenaltyAmount,0)*2/3 else 0 end) PenaltyAmount from dbo.OverDueRecord o with(nolock) 
                    inner join dbo.Subscribe s with(nolock) on o.SubscribeId=s.Id
                    where o.SubscribeUserId=@UserId and o.IsBorrow=1";
            ZxOverMoney = TuanDai.DB.TuanDaiDB.QueryFirstOrDefault <decimal?>(TdConfig.ApplicationName, "/BD/zxread", sql, ref para) ?? 0;

            sql            = @" select isnull(sum(BorrowPayoutCommission),0) from dbo.Project with(nolock) where Type =38  and Status in(2,3,6,7) and UserId=@UserId";
            ZxPayOutBorrow = TuanDai.DB.TuanDaiDB.QueryFirstOrDefault <decimal?>(TdConfig.ApplicationName, "/BD/zxread", sql, ref para) ?? 0;
        }