`

The sample of calendar

    博客分类:
  • Java
SQL 
阅读更多
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.
    }
分享到:
评论

相关推荐

    POJ 1008 Maya Calendar

    The first line of the input file contains the number of the input dates in the file. The next n lines contain n dates in the Haab calendar format, each in separate line. The year is smaller then 5000....

    Android代码-WeekCalendar

    The sample project includes the usage of the library. Support for Android 4.0 and up. Feel free to fork or issue pull requests on github. Issues can be reported on the github issue tracker. Demo ...

    Java SE 8 for the Really Impatient

    Coverage of the long-awaited introduction of a well-designed date/time/calendar library (JSR 310) A concise introduction to JavaFX, which is positioned to replace Swing GUIs, and to the Nashorn ...

    Fullstack Vue: The Complete Guide to Vue.js

    Lots of Sample Apps and Code You will learn what you need to know to work professionally with Fullstack Vue: The Complete Guide to Vue.js You’ll build: A Server-Persisted Shopping Cart: Use the ...

    iOS 8 Swift Programming Cookbook Solutions Examples for iOS Apps.pdf

    - **Sample Code**: The cookbook provides examples of how to implement custom keyboards and extensions, including setting up the UI and handling events. #### 3. **Accessing Users’ Health-Related ...

    Android代码-android日历应用程序

    DialogFragments modeled after the AOSP Clock ...For a working implementation of this project see the sample/ folder. Calendar Date Picker button.setOnClickListener(new View.OnClickListener() { @Override

    VB编程资源大全(英文源码 控件)

    <END><br>46,FldrView.zip The Folderview ActiveX Control mimics the behaviour of the Windows Explorer Treeview showing the tree structure of the files and folders and other items in the shell's ...

    VB编程资源大全(英文源码 控制)

    "<END><br>17 , statusbar.zip "This is a sample of the StatusBar control that is part of the Microsoft Windows Common Controls(COMCTL32.OCX). "<END><br>18 , tabstrip.zip "This is a sample of the...

    BCGControlBarPro.v12.00

    Added CBCGPCalendarBar::GetState method - returns the calendar style flags specified in SetState method. CBCGPRibbonEdit displays a drop-down window upon pressing F4 key. Added CBCGPShellManager::...

    TMS Pack for FireMonkey2.3.0.1

    Includes several Sample applications for the TTMSFMXGrid component History : --------- v1.0 : first release v1.0.0.1 Fixed : Issue with setting the focus on the form (Can be activated / ...

    Bootstrap4 官方模板 ( Hyper - Responsive Bootstrap 4 Admin Dashboard )

    The super clean and flexible layout would enable you to easily build web applications. It can be used to create a saas based interface, custom admin panels, dashboard, CRM, CMS, e-commerce panel, etc...

    Palm WebOS 开发.rar

    Mojo Framework and Sample Code 22 webOSdev 22 Summary 23 2. Application Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 ...

Global site tag (gtag.js) - Google Analytics