public TimePeriodSearch search(String body){

		TimePeriodSearch timePeriodInput = new Gson().fromJson(body, TimePeriodSearch.class);
		if(timePeriodInput == null){
			timePeriodInput = new TimePeriodSearch();
		}
		List<TimePeriod> timePeriodList = new ArrayList<TimePeriod>();

		StringBuilder sql = new StringBuilder();
		sql.append("select * from timeperiod ");
		boolean hasCondition = false;
		if(timePeriodInput.getStartTimePeriodId() != null){
			sql.append(hasCondition ? "and " : "where ");
			sql.append("timePeriodId >= " + timePeriodInput.getStartTimePeriodId() + " ");
			hasCondition = true;
		}
		if(timePeriodInput.getEndTimePeriodId() != null){
			sql.append(hasCondition ? "and " : "where ");
			sql.append("timePeriodId <= " + timePeriodInput.getEndTimePeriodId() + " ");
			hasCondition = true;
		}

		sql.append("order by shortdescription desc");
		ResultSet rs = DAOManager.getInstance().executeQuery(sql.toString());
		try {
			while (rs.next()) {
				TimePeriod timePeriod = new TimePeriod();
				timePeriod.setTimePeriodId(rs.getInt("timeperiodid"));
				timePeriod.setDescription(rs.getString("shortdescription"));
				timePeriod.setName(rs.getString("name"));

				timePeriodList.add(timePeriod);

			}
		} catch (SQLException e) {
			e.printStackTrace();
		}

		timePeriodInput.setTimePeriodList(timePeriodList);

		return timePeriodInput;
	}