public List getWorkDailyLogList(String type, Date date,String userId,String queryInfo)
{
StringBuffer sql = new StringBuffer("select guid, title as 标题,convert(char(10),createddate,20) as 日期");
sql.append(getAppRelationCore().getPersonManagementFacade().getColumnStatement("Hr_dailylog")).append(" from Hr_dailyLog where convert(char(10),createddate,20) between ? and ? and creator = ? and title like '%'+?+'%'");
String params[] = new String[4];
GregorianCalendar calendar = new GregorianCalendar();
calendar.setTime(date);
if(type.equals("week"))
{
calendar.set(GregorianCalendar.DAY_OF_WEEK,1);
params[0] = PortalUtil.convertDateToString(PortalUtil.SQL_DATE_PATTERN, calendar.getTime());
calendar.set(GregorianCalendar.DAY_OF_WEEK,7);
params[1] = PortalUtil.convertDateToString(PortalUtil.SQL_DATE_PATTERN, calendar.getTime());
}
if(type.equals("month"))
{
calendar.set(GregorianCalendar.DAY_OF_MONTH,1);
params[0] = PortalUtil.convertDateToString(PortalUtil.SQL_DATE_PATTERN, calendar.getTime());
calendar.set(GregorianCalendar.DAY_OF_MONTH,calendar.getActualMaximum(GregorianCalendar.DAY_OF_MONTH));
params[1] = PortalUtil.convertDateToString(PortalUtil.SQL_DATE_PATTERN, calendar.getTime());
}
if(type.equals("year"))
{
calendar.set(GregorianCalendar.DAY_OF_YEAR,1);
params[0] = PortalUtil.convertDateToString(PortalUtil.SQL_DATE_PATTERN, calendar.getTime());
calendar.set(GregorianCalendar.DAY_OF_YEAR,calendar.getActualMaximum(GregorianCalendar.DAY_OF_YEAR));
params[1] = PortalUtil.convertDateToString(PortalUtil.SQL_DATE_PATTERN, calendar.getTime());
}
if(type.equals("day"))
{
params[0] = PortalUtil.convertDateToString(PortalUtil.SQL_DATE_PATTERN, calendar.getTime());
params[1] = PortalUtil.convertDateToString(PortalUtil.SQL_DATE_PATTERN, calendar.getTime());
}
params[2] = userId;
params[3] = queryInfo;
return this.getCommonDAO().findBySQL(sql.toString(),params).getRows(); //To change body of implemented methods use File | Settings | File Templates.
}