Search in sources :

Example 1 with BookVideoVO

use of com.bc.pmpheep.back.vo.BookVideoVO in project pmph by BCSquad.

the class BookVideoServiceImpl method getVideoList.

@Override
public PageResult<BookVideoVO> getVideoList(Integer pageSize, Integer pageNumber, String bookName, Integer state, String upLoadTimeStart, String upLoadTimeEnd) {
    Map<String, Object> map = new HashMap<String, Object>(3);
    map.put("start", ((pageNumber - 1) * pageSize));
    map.put("pageSize", pageSize);
    bookName = StringUtil.toAllCheck(bookName);
    if (null != bookName) {
        map.put("bookName", bookName);
    }
    if (null != state && 0 != state.intValue()) {
        // all
        map.put("state", state);
    }
    // yyyy-MM-dd
    Timestamp startTime = null;
    if (StringUtil.notEmpty(upLoadTimeStart)) {
        startTime = DateUtil.str2Timestam(upLoadTimeStart);
        map.put("startTime", startTime);
    }
    if (StringUtil.notEmpty(upLoadTimeEnd)) {
        Timestamp endTime = DateUtil.str2Timestam(upLoadTimeEnd);
        if (ObjectUtil.notNull(startTime)) {
            if (startTime.compareTo(endTime) == 0) {
                endTime.setTime(startTime.getTime() + 24 * 60 * 60 * 1000);
            }
            map.put("endTime", endTime);
        }
    }
    PageResult<BookVideoVO> BookVideoVO2lst = new PageResult<BookVideoVO>();
    BookVideoVO2lst.setPageNumber(pageNumber);
    BookVideoVO2lst.setPageSize(pageSize);
    Integer total = bookVideoDao.getVideoListTotal(map);
    if (null != total && total > 0) {
        BookVideoVO2lst.setRows(bookVideoDao.getVideoList(map));
    }
    BookVideoVO2lst.setTotal(total);
    return BookVideoVO2lst;
}
Also used : HashMap(java.util.HashMap) BookVideoVO(com.bc.pmpheep.back.vo.BookVideoVO) PastBookVideoVO(com.bc.pmpheep.back.vo.PastBookVideoVO) Timestamp(java.sql.Timestamp) PageResult(com.bc.pmpheep.back.plugin.PageResult)

Aggregations

PageResult (com.bc.pmpheep.back.plugin.PageResult)1 BookVideoVO (com.bc.pmpheep.back.vo.BookVideoVO)1 PastBookVideoVO (com.bc.pmpheep.back.vo.PastBookVideoVO)1 Timestamp (java.sql.Timestamp)1 HashMap (java.util.HashMap)1