Esempio n. 1
0
 /// <summary>
 /// 获取注册情况统计
 /// </summary>
 /// <param name="request"></param>
 /// <returns></returns>
 public List <SelectSumAppUserList> GetSelectSumAppUserList(RouteSumAppUser request)
 {
     using (var db = DbFactory.Open())
     {
         string userSql = "select COUNT(*) as userCount,a.adcd,a.adcdId,b.adnm,b.parentId 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 COUNT(*) as appcount,b.adcd,a.adcdId,b.adnm,b.parentId 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) == "省级")
         {
             return(GetProvinceList(request.adcd, request.adcdName, db));
             //userSql += "  and a.adcd like '33%'";
             //appSql += "  and b.adcd like '33%'";
         }
         if (AdcdHelper.GetByAdcdRole(request.adcd) == "市级")
         {
             return(GetCityList(request.adcd, request.adcdName, db));
         }
         if (AdcdHelper.GetByAdcdRole(request.adcd) == "县级")
         {
             return(GetCountryList(request.adcd, request.adcdName, db));
             //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) == "镇级")
         {
             return(GetTownList(request.adcd, request.adcdName, db));
             //userSql += "  and a.adcd like '" + request.adcd.Substring(0, 9) + "%'";
             //appSql += "  and b.adcd like '" + request.adcd.Substring(0, 9) + "%'";
         }
         if (request.adcdName != null && request.adcdName != "")
         {
             userSql += "  and b.adnm like '%" + request.adcdName + "%'";
             appSql  += "  and b.adnm like  '%" + request.adcdName + "%'";
         }
         userSql += "  group by a.adcd,a.adcdId,b.adnm,b.parentId order by a.adcdId";
         appSql  += "  group by b.adcd,a.adcdId,b.adnm,b.parentId order by a.adcdId";
         List <SelectSumAppUserList> allList = db.SqlList <SelectSumAppUserList>(userSql);
         List <SelectSumAppUserList> appList = db.SqlList <SelectSumAppUserList>(appSql);
         return(GetSumAppUserList(allList, appList, request.adcd));
     }
 }
Esempio n. 2
0
 public List <SelectSumAppUserList> Get(RouteSumAppUser request)
 {
     return(logic.GetSelectSumAppUserList(request));
 }