/** * 查询某层次下的所有专业 * * @param levelId * @return * @throws Exception */ public List<AcademyMajor> findByLevel(int levelId) throws Exception { String sql = " and academyLevelId = " + Constants.PLACEHOLDER + " and deleteFlag = " + Constants.PLACEHOLDER + " order by majorId"; return academyMajorDao.getByProperty(sql, new Object[] {levelId, Constants.DELETE_FALSE}); }
/** * 查询院校某批次下对应基础层次ID为levelId的MajorLevel下的所有基础专业 * * @param batchId 院校招生批次ID * @param levelId 基础层次ID * @return * @throws Exception */ public List<AcademyMajor> findAcademyMajorByLevelId(int batchId, int levelId) throws Exception { AcademyLevel al = academyLevelBiz.findByBatchAndLevel(batchId, levelId); if (al == null) return null; List<AcademyMajor> list = academyMajorDao.getByProperty( " and academyLevelId=" + Constants.PLACEHOLDER + " and deleteFlag = " + Constants.PLACEHOLDER + " order by majorId", new Object[] {al.getId(), Constants.DELETE_FALSE}); return list; }
/** * 查询某层次下的所有专业_定时任务 * * @param levelId * @return * @throws Exception */ public List<AcademyMajor> findByLevelForTask(List<Integer> idList) throws Exception { String sql = " and deleteFlag = " + Constants.PLACEHOLDER; List<Object> paramList = new ArrayList<Object>(); paramList.add(Constants.DELETE_FALSE); if (null != idList) { sql += " and academyLevelId in("; StringBuffer idsSB = new StringBuffer("0"); for (int i = 0; i < idList.size(); i++) { if (0 == i) { // sql+=Constants.PLACEHOLDER; idsSB = new StringBuffer(Constants.PLACEHOLDER); } else { // sql+=","+Constants.PLACEHOLDER; idsSB.append("," + Constants.PLACEHOLDER); } paramList.add(idList.get(i)); } sql += idsSB.toString(); sql += ")"; } sql += " order by majorId"; return academyMajorDao.getByProperty(sql, paramList.toArray()); }