package com.mortals.xhx.module.stat.dao.ibatis;


import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.ParamDto;
import com.mortals.xhx.module.pj.model.PjEvaluateStatEntity;
import com.mortals.xhx.module.pj.model.PjEvaluateStatQuery;
import com.mortals.xhx.module.stat.model.StatQuery;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.stat.dao.StatDao;
import com.mortals.xhx.module.stat.model.StatEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 汇总统计DaoImpl DAO接口
*
* @author zxfei
* @date 2024-07-02
*/
@Repository("statDao")
public class StatDaoImpl extends BaseCRUDDaoMybatis<StatEntity,Long> implements StatDao {


    @Override
    public List<StatEntity> getStatList(StatQuery query, PageInfo pageInfo) {
        ParamDto queryParam = super.getQueryParam(query);
        List<StatEntity> list = getSqlSession().selectList(SQLID_GET_STATLIST, queryParam);
        pageInfo.setTotalResult(list.size());
        if (pageInfo.getPrePageResult() == -1) {
            return list;
        } else {
            RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
            return getSqlSession().selectList(SQLID_GET_STATLIST, queryParam, rowBounds);
        }
    }
}
