@ -304,19 +322,28 @@ public class ChartServiceImpl extends Service implements ChartService {
// 遍历岗位、查询对应岗位下的人员
if(isRealTime){
if(isRealDimension){
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear from hrmresource a where a.status < 4 and a.departmentid = ? and a.jobtitle = ?";
sql="select a.id,a.lastname as name,a.belongto ,a.companyworkyear,a.dsporder,a.accounttype from hrmresource a where a.status in ("+statusValue+") and a.departmentid = ? and a.jobtitle = ?";
}else{
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid where a.status < 4 and b.departmentid = ? and a.jobtitle = ?";
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear,a.accounttype from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid where a.status in ("+statusValue+") and b.departmentid = ? and a.jobtitle = ?";
}
}else{
sql="select a.resourceid as id,a.lastname as name ,a.belongto ,a.companyworkyear from jcl_chart_resource a where a.status < 4 and a.departmentid = ? and a.jobtitleid = ? and versionid = " +versionId;
sql="select a.resourceid as id,a.lastname as name ,a.belongto ,a.companyworkyear,a.accounttype from jcl_chart_resource a where a.status in ("+statusValue+") and a.departmentid = ? and a.jobtitleid = ? and versionid = " +versionId;
}
if(!isBelongTo){
sql+=" and (a.accounttype = 0 or a.accounttype is null)";
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear from hrmresource a where a.status < 4 and a.departmentid = ? ";
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear,a.accounttype,a.managerid from hrmresource a where a.status in ("+statusValue+") and a.departmentid = ? ";
}else{
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid where a.status < 4 and b.departmentid = ? ";
sql="select a.id,a.lastname as name ,a.belongto ,a.companyworkyear,a.accounttype,b.managerid from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid where a.status in ("+statusValue+") and b.departmentid = ? ";
}
}else{
sql="select a.resourceid as id,a.lastname as name ,a.belongto ,a.companyworkyear from jcl_chart_resource a where a.status < 4 and a.departmentid = ? and versionid = " +versionId;
sql="select a.resourceid as id,a.lastname as name ,a.belongto ,a.companyworkyear,a.accounttype,a.manager as managerid from jcl_chart_resource a where a.status in ("+statusValue+") and a.departmentid = ? and versionid = " +versionId;
}
if(!isBelongTo){
sql+=" and (a.accounttype = 0 or a.accounttype is null)";
rs.executeQuery("select resourceid,workcode,lastname,sex,department,subcompany,jobtitle,mobile from jcl_chart_resource where departmentid = ? and versionid = ?",departmentId,versionId);
rs.executeQuery("select resourceid,workcode,lastname,sex,department,subcompany,jobtitle,mobile from jcl_chart_resource where status in ("+statusValue+") and departmentid = ? and versionid = ?",departmentId,versionId);
" from hrmresourcevirtual v inner join hrmresource h on v.resourceid = h.id and v.virtualtype = ? and v.departmentid = ?",dimension,departmentId);
" from hrmresourcevirtual v inner join hrmresource h on v.resourceid = h.id and h.status in ("+statusValue+") and v.virtualtype = ? and v.departmentid = ?",dimension,departmentId);