public CompanyViewModel GetCompanyById(string innerid)
{
const string sql = @"select innerid, companyname, address, opername, originalregistcapi, scope, companystatus, officephone, picurl, companytitle, ancestryids, categoryids, customdesc, boutiqueurl, introduction,spare1, spare2, createrid, createdtime, modifierid, modifiedtime,
(select count(innerid) from settled_praiselog where companyid=a.innerid) as PraiseNum,
(select count(innerid) from settled_comment where companyid=a.innerid) as CommentNum,
(select avg(score) from settled_comment where companyid=a.innerid) as ScoreNum,
(select count(1) from settled_info_applyupdate where settid=a.innerid and status=2) as Status,
(select group_concat(codename) from base_code where typekey='car_ancestry' and FIND_IN_SET(codevalue,a.ancestryids)) as ancestryname,
(select group_concat(codename) from base_code where typekey='car_category' and FIND_IN_SET(codevalue,a.categoryids)) as categoryname
from settled_info as a where innerid=@innerid;";
var model = Helper.Query<CompanyViewModel>(sql, new { innerid }).FirstOrDefault();
return model;
}