|
@@ -34,24 +34,24 @@ public class AutoEndPartTimeTask extends AbstractTask implements Plugin {
|
|
public void execute(RequestContext requestContext, Map<String, Object> map) throws KDException {
|
|
public void execute(RequestContext requestContext, Map<String, Object> map) throws KDException {
|
|
log.info(" -------- 自动取消兼岗开始 -------- ");
|
|
log.info(" -------- 自动取消兼岗开始 -------- ");
|
|
StringBuilder sb = new StringBuilder();
|
|
StringBuilder sb = new StringBuilder();
|
|
- sb.append(" /*dialect*/ select a.fpositionid,max(a.fisprimary) maxp,min(a.fisprimary) minp \n");
|
|
|
|
|
|
+
|
|
|
|
+ sb.append(" /*dialect*/ select * from (\n");
|
|
|
|
+ sb.append(" select a.fpositionid,max(a.fisprimary) maxp,min(a.fisprimary) minp \n");
|
|
sb.append(" from t_hrpi_empposorgrel a \n");
|
|
sb.append(" from t_hrpi_empposorgrel a \n");
|
|
sb.append(" left join t_hrpi_pernontsprop b on a.fpersonid = b.fpersonid and b.fiscurrentversion = '1' \n");
|
|
sb.append(" left join t_hrpi_pernontsprop b on a.fpersonid = b.fpersonid and b.fiscurrentversion = '1' \n");
|
|
sb.append(" left join t_hbss_laborrelstatus c on c.fid = b.fk_nckd_ygzt \n");
|
|
sb.append(" left join t_hbss_laborrelstatus c on c.fid = b.fk_nckd_ygzt \n");
|
|
sb.append(" where a.fiscurrentversion = '1' \n");
|
|
sb.append(" where a.fiscurrentversion = '1' \n");
|
|
sb.append(" and a.fbusinessstatus = '1' \n");
|
|
sb.append(" and a.fbusinessstatus = '1' \n");
|
|
sb.append(" and (c.fnumber <> '9010_S' or c.fnumber is null) \n");
|
|
sb.append(" and (c.fnumber <> '9010_S' or c.fnumber is null) \n");
|
|
- sb.append(" group by a.fpositionid");
|
|
|
|
|
|
+ sb.append(" group by a.fpositionid \n");
|
|
|
|
+ sb.append(" ) a where a.maxp = '1' and a.minp = '0' ");
|
|
log.info(" -------- sql : " +sb.toString()+ " -------- ");
|
|
log.info(" -------- sql : " +sb.toString()+ " -------- ");
|
|
DataSet dataSet = DB.queryDataSet(this.getClass().getName(), DBRoute.of("hr"), sb.toString());
|
|
DataSet dataSet = DB.queryDataSet(this.getClass().getName(), DBRoute.of("hr"), sb.toString());
|
|
|
|
|
|
List<Long> positionIds = new ArrayList<Long>();
|
|
List<Long> positionIds = new ArrayList<Long>();
|
|
while(dataSet.hasNext()) {
|
|
while(dataSet.hasNext()) {
|
|
Row rowData = dataSet.next();
|
|
Row rowData = dataSet.next();
|
|
- //取同时有兼职和主职的岗位
|
|
|
|
- if(rowData.getInteger("maxp") == 1 && rowData.getInteger("minp") == 0) {
|
|
|
|
- positionIds.add(rowData.getLong("fpositionid"));
|
|
|
|
- }
|
|
|
|
|
|
+ positionIds.add(rowData.getLong("fpositionid"));
|
|
}
|
|
}
|
|
|
|
|
|
//取出岗位下所有兼职
|
|
//取出岗位下所有兼职
|