예제 #1
0
 /// <summary>
 /// 统计为注册人的信息
 /// </summary>
 /// <param name="request"></param>
 /// <returns></returns>
 public BsTableDataSource <Model.SumAppUser.SumAppUser> GetSumAppUserList(RouteNoAppUser request)
 {
     using (var db = DbFactory.Open())
     {
         string userSql = "select a.adcd,a.adcdId,b.adnm,b.parentId,a.phone,a.UserName from AppAllUserView a left join ADCDInfo b on a.adcdId=b.Id  where a.adcdId is not null and a.adcd is not null and RIGHT(a.adcd, 11)!= '00000000000' ";
         string appSql  = "select b.adcd,a.adcdId,b.adnm,b.parentId,a.Mobile as phone,a.UserName from AppGetReg a left join ADCDInfo b on  a.adcdId=b.Id where a.adcdId is not null  and RIGHT(b.adcd, 11)!= '00000000000'  ";
         if (AdcdHelper.GetByAdcdRole(request.adcd) == "省级")
         {
             userSql += "  and a.adcd like '33%'";
             appSql  += "  and b.adcd like '33%'";
         }
         if (AdcdHelper.GetByAdcdRole(request.adcd) == "市级")
         {
             userSql += "  and a.adcd like '" + request.adcd.Substring(0, 4) + "%'";
             appSql  += "  and b.adcd like '" + request.adcd.Substring(0, 4) + "%'";
         }
         if (AdcdHelper.GetByAdcdRole(request.adcd) == "县级")
         {
             userSql += "  and a.adcd like '" + request.adcd.Substring(0, 6) + "%'";
             appSql  += "  and b.adcd like '" + request.adcd.Substring(0, 6) + "%'";
         }
         if (AdcdHelper.GetByAdcdRole(request.adcd) == "镇级")
         {
             userSql += "  and a.adcd like '" + request.adcd.Substring(0, 9) + "%'";
             appSql  += "  and b.adcd like '" + request.adcd.Substring(0, 9) + "%'";
         }
         if (AdcdHelper.GetByAdcdRole(request.adcd) == "村级")
         {
             userSql += "  and a.adcd like '" + request.adcd + "%'";
             appSql  += "  and b.adcd like '" + request.adcd + "%'";
         }
         userSql += "  group by a.adcd,a.adcdId,b.adnm,b.parentId,a.phone,a.UserName order by a.adcdId";
         appSql  += "  group by b.adcd,a.adcdId,b.adnm,b.parentId,a.Mobile,a.UserName order by a.adcdId";
         List <Model.SumAppUser.SumAppUser> allList =
             db.SqlList <Model.SumAppUser.SumAppUser>(userSql);
         List <Model.SumAppUser.SumAppUser> appList =
             db.SqlList <Model.SumAppUser.SumAppUser>(appSql);
         var list     = GetUserList(allList, appList);
         var pageList = list.Skip(request.PageSize * (request.PageIndex - 1))
                        .Take(request.PageSize).ToList();
         return(new BsTableDataSource <Model.SumAppUser.SumAppUser> {
             total = list.Count(), rows = pageList
         });
     }
 }
예제 #2
0
 public BsTableDataSource <Model.SumAppUser.SumAppUser> Get(RouteNoAppUser request)
 {
     return(logic.GetSumAppUserList(request));
 }