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


import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.ParamDto;
import com.mortals.xhx.module.pj.model.PjEvaluateStatQuery;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.pj.dao.PjEvaluateStatDao;
import com.mortals.xhx.module.pj.model.PjEvaluateStatEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 评价汇总统计DaoImpl DAO接口
*
* @author zxfei
* @date 2024-06-24
*/
@Repository("pjEvaluateStatDao")
public class PjEvaluateStatDaoImpl extends BaseCRUDDaoMybatis<PjEvaluateStatEntity,Long> implements PjEvaluateStatDao {


    @Override
    public List<PjEvaluateStatEntity> getStatList(PjEvaluateStatQuery query, PageInfo pageInfo) {
        ParamDto queryParam = super.getQueryParam(query);
        List<PjEvaluateStatEntity> 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);
        }
    }
}
