package com.kingdee.shr.customer.gtiit.util; import java.sql.SQLException; import java.util.HashMap; import java.util.Map; import java.util.Set; import com.kingdee.bos.BOSException; import com.kingdee.bos.Context; import com.kingdee.eas.util.app.DbUtil; import com.kingdee.jdbc.rowset.IRowSet; public class BaseUtil { public static Map getPersonIdByName(Context ctx, Set personIdSet){ Map personMap = new HashMap(); StringBuffer strBuffer = new StringBuffer(); if(personIdSet != null && personIdSet.size()>0) { for(String personId:personIdSet) { strBuffer.append("'"+personId+"',"); } String personSql = "select fid,fname_l1 from t_bd_person where fid in ("+strBuffer.deleteCharAt(strBuffer.length()-1)+")"; try { IRowSet rowSet = DbUtil.executeQuery(ctx, personSql); while(rowSet.next()) { personMap.put(rowSet.getString("fid"), rowSet.getString("fname_l1")); } return personMap; } catch (BOSException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } } return personMap; } public static Map> getOverTimeType(Context ctx){ Map> map = new HashMap>(); String sql = "select fid,fname_l1,fnumber from T_HR_ATS_OverTimeType"; try { IRowSet rowSet = DbUtil.executeQuery(ctx, sql); while(rowSet.next()) { Map overTypeMap = new HashMap(); overTypeMap.put("otTypeValue", rowSet.getString("fid")); overTypeMap.put("otTypeText", rowSet.getString("fname_l1")); map.put(rowSet.getString("fnumber"), overTypeMap); } } catch (BOSException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } return map; } }