@SuppressWarnings("unchecked")
@TransactionAttribute(TransactionAttributeType.SUPPORTS)/**
*
* @param codeType SchoolBudget: 校内年度预算, MOE_EducationSubsidy: 教育部奖补助, ResearchProjectBudget: 研究计划预算案, SchoolOtherSubsidy: 其他经费
* @param ruleOutFilter eq: equals, ne: not equals
* @return
*/public List<SystemCode> findSystemCodesByCodeTypeOrderByValue(final String codeType, final String ruleOutFilter) {
String jpql = " select s from SystemCode s";
if(ruleOutFilter.equals("eq"))
jpql += " where s.codeType = :codeType";
else
jpql += " where s.codeType <> :codeType";
jpql += " order by s.value1 asc";
Query query = this.createQuery(jpql);
query.setParameter("codeType", codeType);
List<SystemCode> list = query.getResultList();
if (list == null || list.size() == 0)
return null;
return list;
}
该贴被蜀山战纪编辑于2016-2-1 10:14:47