You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
3.4 KiB
Java
93 lines
3.4 KiB
Java
package com.api.browser.service.impl;
|
|
|
|
import com.api.browser.bean.SearchConditionItem;
|
|
import com.api.browser.bean.SplitTableBean;
|
|
import com.api.browser.bean.SplitTableColBean;
|
|
import com.api.browser.service.BrowserService;
|
|
import com.api.browser.util.*;
|
|
import weaver.general.Util;
|
|
import weaver.systeminfo.SystemEnv;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* 职务
|
|
*
|
|
* @author lvyi
|
|
*
|
|
*/
|
|
public class JobActivitiesBrowserService extends BrowserService {
|
|
|
|
@Override
|
|
public Map<String, Object> getBrowserData(Map<String, Object> params) throws Exception {
|
|
Map<String, Object> apidatas = new HashMap<String, Object>();
|
|
String jobactivitymark = Util.null2String(params.get("jobactivitymark"));
|
|
String jobactivityname = Util.null2String(params.get("jobactivityname"));
|
|
//二开
|
|
String jobType = Util.null2String(params.get("jobType"));
|
|
//end
|
|
|
|
String sqlwhere = "where 1 = 1 ";
|
|
String backfields = "";
|
|
String fromSql = "";
|
|
String orderby = "";
|
|
if(!jobactivitymark.equals("")){
|
|
sqlwhere += " and Jobactivitymark like '%";
|
|
sqlwhere += Util.fromScreen2(jobactivitymark,user.getLanguage());
|
|
sqlwhere += "%'";
|
|
}
|
|
if(!jobactivityname.equals("")){
|
|
sqlwhere += " and jobactivityname like '%";
|
|
sqlwhere += Util.fromScreen2(jobactivityname,user.getLanguage());
|
|
sqlwhere += "%'";
|
|
}
|
|
if(!jobType.equals("")){
|
|
sqlwhere = sqlwhere + " and jobgroupid in ( " + jobType + " )";
|
|
}
|
|
|
|
List<SplitTableColBean> cols = new ArrayList<SplitTableColBean>();
|
|
//二开start
|
|
backfields = " id, jobactivitymark, jobactivityname, jobgroupname, jobgroupid ";
|
|
fromSql = " ( SELECT " +
|
|
" a.id, " +
|
|
" a.jobactivitymark, " +
|
|
" a.jobactivityname, " +
|
|
" b.jobgroupname," +
|
|
" b.id as jobgroupid " +
|
|
"FROM " +
|
|
" HrmJobActivities a " +
|
|
" LEFT JOIN HrmJobGroups b ON b.id = a.jobgroupid " +
|
|
") t ";
|
|
orderby = " id ";
|
|
//end
|
|
|
|
cols.add(new SplitTableColBean("true", "id"));
|
|
// cols.add(new SplitTableColBean("35%", SystemEnv.getHtmlLabelName(399, user.getLanguage()), "jobactivitymark", "jobactivitymark").setIsInputCol(BoolAttr.TRUE));
|
|
cols.add(new SplitTableColBean("50%", SystemEnv.getHtmlLabelName(805, user.getLanguage()), "jobgroupname", "jobgroupname"));//二开
|
|
cols.add(new SplitTableColBean("50%", SystemEnv.getHtmlLabelName(15767, user.getLanguage()), "jobactivityname", "jobactivityname").setIsInputCol(BoolAttr.TRUE));
|
|
|
|
SplitTableBean tableBean = new SplitTableBean(backfields, fromSql, sqlwhere, orderby, "id", cols);
|
|
|
|
tableBean.setSqlsortway("ASC");
|
|
tableBean.setSqlisdistinct("true");
|
|
apidatas.putAll(SplitTableUtil.makeListDataResult(tableBean));
|
|
return apidatas;
|
|
}
|
|
|
|
@Override
|
|
public Map<String, Object> getBrowserConditionInfo(Map<String, Object> params) throws Exception {
|
|
Map<String, Object> apidatas = new HashMap<String, Object>();
|
|
List<SearchConditionItem> conditions = new ArrayList<SearchConditionItem>();
|
|
apidatas.put(BrowserConstant.BROWSER_RESULT_CONDITIONS, conditions);
|
|
ConditionFactory conditionFactory = new ConditionFactory(user);
|
|
conditions.add(conditionFactory.createCondition(ConditionType.INPUT, 399, "jobactivitymark", true));
|
|
conditions.add(conditionFactory.createCondition(ConditionType.INPUT, 15767, "jobactivityname"));
|
|
conditions.add(conditionFactory.createCondition(ConditionType.INPUT, 805, "jobgroupname"));
|
|
return apidatas;
|
|
}
|
|
|
|
}
|