package com.chy.borrow.mapper;

import com.chy.borrow.entity.BorrowApply;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 沈晔浩
 * @since 2022-03-25
 */
@Repository
public interface BorrowApplyMapper extends BaseMapper<BorrowApply> {

    Page<Map> getList(Map map);
    Page<Map> getListForMission(Map map);
    Page<Map> queryByDate(@Param("time") String time,@Param("userId") String userId);
    Integer getCountByCode(@Param("borrowApplyId") String borrowApplyId);
    Page<Map> getListForRange(Map map);
    Map getInfoById(@Param("borrowApplyId") String borrowApplyId);

    Map getTimeByCode(@Param("code")String code);
    //借阅量（常规）
    List<Map> getCountList();
    //部门借阅占比
    List<Map> getUnitCountList();
    //年月日占比
    List<Map> getApplyTimeCountList(Integer start,Integer num);
    //日期间隔内
    List<Map> getApplyTimeByPeriod(Timestamp start, Timestamp end);
}
