public PageModel GetCompanyCompanyAllSiteList(TbCompanyRequest request, string orgType, string parentCode) { string sql = ""; string where = ""; if (string.IsNullOrWhiteSpace(orgType)) { orgType = OperatorProvider.Provider.CurrentUser.OrgType; } if (string.IsNullOrWhiteSpace(parentCode)) { parentCode = OperatorProvider.Provider.CurrentUser.CompanyId; } //参数化 List <Parameter> parameter = new List <Parameter>(); if (!string.IsNullOrWhiteSpace(request.ProjectId)) { where += " and ProjectId=@ProjectId"; parameter.Add(new Parameter("@ProjectId", request.ProjectId, DbType.String, null)); } if (!string.IsNullOrWhiteSpace(request.keyword)) { where += " and CompanyFullName like @CompanyFullName"; parameter.Add(new Parameter("@CompanyFullName", '%' + request.keyword + '%', DbType.String, null)); } if (orgType == "0" || orgType == "1" || orgType == "2") { sql = @"select cm.id,cm.CompanyCode,cm.CompanyFullName,cm.OrgType,cm.Address,pc.ProjectId from TbCompany cm left join TbProjectCompany pc on cm.CompanyCode=pc.CompanyCode where 1=1 and cm.OrgType=5 "; } else { sql = @"select * from GetCompanyChild_fun(@parentCode) as cp where 1=1 and cp.OrgType=5 "; parameter.Add(new Parameter("@parentCode", parentCode, DbType.String, null)); } var model = Repository <TbCompany> .FromSqlToPageTable(sql + where, parameter, request.rows, request.page, "ID", "asc"); return(model); }
public ActionResult GetProcessFactoryUser(TbCompanyRequest request) { var data = _fbnpBus.GetProcessFactoryUser(request); return(Content(data.ToJson())); }
public ActionResult GetWorkAreaByProjectId(TbCompanyRequest request) { var data = cit.GetWorkAreaByProjectId(request); return(Content(data.ToJson())); }
public ActionResult GetCompanyCompanyAllSiteList(TbCompanyRequest request, string orgType, string parentCode) { var data = _sdzLogic.GetCompanyCompanyAllSiteList(request, orgType, parentCode); return(Content(data.ToJson())); }
/// <summary> /// 通过分部编号获取工区或者站点 /// </summary> /// <param name="request"></param> /// <returns></returns> public ActionResult GetCompanyWorkAreaOrSiteList(TbCompanyRequest request, string parentCode, int type) { var data = _rawMonthDemPlanLogic.GetCompanyWorkAreaOrSiteList(request, parentCode, type); return(Content(data.ToJson())); }
/// <summary> /// 获取组织机构列表数据 /// </summary> /// <param name="request"></param> /// <returns></returns> public ActionResult GetCompanyList(int type, TbCompanyRequest request) { var data = _rawMonthDemPlanLogic.GetCompanyList(type, request); return(Content(data.ToJson())); }