日期:2014-05-17 浏览次数:20708 次
//service public List<Evaluatescholarship> find(String year,String major,Timestamp startTime,Timestamp endTime)throws BusinessException{ StringBuffer queryStringBuffer = new StringBuffer("from Evaluatescholarship e,Stubasicinfo s,Majorinfo m where e.stubasicinfo = s.stbStuNo and s.majorinfo = m.mno"); System.out.println("servicebefore"); String[] params = new String[] {year, major}; if(!"".equals(year)){ queryStringBuffer.append(" and s.syear = ? "); // queryStringBuffer.append(" syear="+"'"+year+"'"); if (!"".equals(major)) { //queryStringBuffer.append(" and e.stubasicinfo.majorinfo.mname = ? "); queryStringBuffer.append(" and m.mname = ? "); // queryStringBuffer.append(" and majorinfo.mname="+"'"+major+"'"); // +" and estartTime between "+"'"+startTime+"'"+" and "+"'"+endTime+"'"+" and eendTime between "+"'"+startTime+"'"+" and "+"'"+endTime+"'"+" "); } else { // queryStringBuffer.append(" and estartTime between "+"'"+startTime+"'"+" and "+"'"+endTime+"'"+" and eendTime between "+"'"+startTime+"'"+" and "+"'"+endTime+"'"+" "); } } else { // queryStringBuffer.append(" estartTime between "+"'"+startTime+"'"+" and "+"'"+endTime+"'"+" and eendTime between "+"'"+startTime+"'"+" and "+"'"+endTime+"'"+" "); } System.out.println(queryStringBuffer); List<Evaluatescholarship> _list = this.evaluateScholarshipDao.find(queryStringBuffer.toString(), params); if(null == _list) { throw new BusinessException("无法取到值"); } return _list; }
//dao public List<Evaluatescholarship> find(String queryString, String[] params){ System.out.println("daobefore"); List list = this.dataAccessUtil.find(queryString,params); System.out.println(list.isEmpty()); return (List<Evaluatescholarship>)list; }
//action public String findList() throws Exception{ String currentTime = TimeGenerator.getCurrentTime(); try { /*System.out.println("actionbefore"+evaluatescholarship.getStubasicinfo().getSyear().toString()); System.out.println(evaluatescholarship.getStubasicinfo().getMajorinfo().getMname().toString());*/ List<Evaluatescholarship> _list = this.evaluateScholarshipService.find(evaluatescholarship.getStubasicinfo().getSyear(),evaluatescholarship.getStubasicinfo().getMajorinfo().getMname(),startTime,endTime); System.out.println("evaluateScholarAction size="+_list.size()); if (null == _list) { return "input"; } else {