Ejemplo n.º 1
0
        /// <summary>
        /// 基数审核列表
        /// </summary>
        /// <returns></returns>
        public ActionResult GetBaseAuditList(BaseAuditParameter parameter)
        {
            PagedResult <BaseAuditList> list = _baseAuditService.GetBaseAuditList(parameter);

            ViewBag.memberList = _memberService.GetMembersList();

            List <SelectListItem> selectList = new List <SelectListItem> {
                new SelectListItem()
                {
                    Value = "", Text = "全部"
                }
            };

            selectList.AddRange(EnumExt.GetSelectList(typeof(BaseAuditEnum)));
            ViewData["StatusType"] = selectList;

            return(View(list));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取基数审核列表
        /// </summary>
        /// <param name="Type"></param>
        /// <returns></returns>
        public PagedResult <BaseAuditList> GetBaseAuditList(BaseAuditParameter parameter)
        {
            StringBuilder strb = new StringBuilder("where 1 = 1");

            strb.Append($" and Type = {parameter.Type}");

            if (!string.IsNullOrEmpty(parameter.MemberID))
            {
                strb.Append($" and m.MemberID = {parameter.MemberID} ");
            }

            strb.Append($" and (ssp.SocialSecurityPeopleName like '%{parameter.SocialSecurityPeopleName}%')");

            if (!string.IsNullOrEmpty(parameter.Status))
            {
                strb.Append($" and  t.Status = {parameter.Status}");
            }


            string innersqlstr = $@" select ssp.SocialSecurityPeopleName SocialSecurityPeopleName,m.UserType UserType,m.MemberName MemberName,  t.* 
 from BaseAudit t
left join SocialSecurity ss on t.SocialSecurityPeopleID = ss.SocialSecurityPeopleID
left join AccumulationFund af on t.SocialSecurityPeopleID = af.SocialSecurityPeopleID
left join SocialSecurityPeople ssp on t.SocialSecurityPeopleID = ssp.SocialSecurityPeopleID
left join Members m on ssp.MemberID = m.MemberID
 {strb.ToString()}";
            string sqlstr      = $"select * from (select ROW_NUMBER() OVER(ORDER BY t.ApplyDate desc )AS Row,t.* from ({innersqlstr}) t ) tt WHERE tt.Row BETWEEN @StartIndex AND @EndIndex";

            List <BaseAuditList> modelList = DbHelper.Query <BaseAuditList>(sqlstr, new
            {
                StartIndex = parameter.SkipCount,
                EndIndex   = parameter.TakeCount
            });

            int totalCount = DbHelper.QuerySingle <int>($"select count(0) from  ({innersqlstr}) t ");

            return(new PagedResult <BaseAuditList>
            {
                PageIndex = parameter.PageIndex,
                PageSize = parameter.PageSize,
                TotalItemCount = totalCount,
                Items = modelList
            });
        }