招聘需求报表 增加搜索条件

This commit is contained in:
dxfeng 2025-03-14 14:35:14 +08:00
parent e7a2d39d2c
commit 501c7a4dd2
1 changed files with 39 additions and 6 deletions

View File

@ -5,6 +5,8 @@ import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable;
import com.engine.xmg.entity.demand.vo.RecruitDemandTable;
import com.engine.xmg.service.RecruitDemandService;
import org.apache.commons.lang.StringUtils;
import weaver.general.Util;
import java.util.HashMap;
import java.util.Map;
@ -18,16 +20,47 @@ public class RecruitDemandServiceImpl extends Service implements RecruitDemandSe
@Override
public Map<String, Object> getRecruitDemandReport(Map<String, Object> param) {
Map<String, Object> resultMap = new HashMap<>();
// 刷新引用状态
OrganizationWeaTable<RecruitDemandTable> table = new OrganizationWeaTable<>(user, RecruitDemandTable.class);
String sqlWhere = " where 1=1 ";
String sqlWhere = buildSqlWhere(param);
table.setSqlwhere(sqlWhere);
WeaResultMsg result = new WeaResultMsg(false);
result.putAll(table.makeDataResult());
result.success();
resultMap.putAll(result.getResultMap());
return resultMap;
return new HashMap<>(result.getResultMap());
}
/**
* 构建sql where条件
*
* @param param
* @return
*/
private String buildSqlWhere(Map<String, Object> param) {
String sql = " where 1=1 ";
String resourceId = Util.null2String(param.get("resourceId"));
String departmentId = Util.null2String(param.get("departmentId"));
String dateRange = Util.null2String(param.get("dateRange"));
String jobTitle = Util.null2String(param.get("jobTitle"));
if (StringUtils.isNotBlank(resourceId)) {
sql += " and t.sqr = '" + resourceId + "'";
}
if (StringUtils.isNotBlank(departmentId)) {
sql += " and t.szbm = '" + departmentId + "'";
}
if (StringUtils.isNotBlank(jobTitle)) {
sql += " and t.gw = '" + jobTitle + "'";
}
if (StringUtils.isNotBlank(dateRange)) {
String[] split = dateRange.split(",");
if (split.length == 2) {
sql += "t.sqsj >= '" + split[0] + "' and t.sqsj <='" + split[1] + "'";
}
}
return sql;
}
}