package com.zt.plat.module.base.dal.dao.plandate;

import java.util.*;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;

import com.zt.plat.module.base.controller.admin.plandate.vo.PlanDatePageReqVO;
import com.zt.plat.module.base.dal.dataobject.plandate.PlanDateDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 计划数据 Mapper
 *
 * @author 后台管理-1
 */
@Mapper
public interface PlanDateMapper extends BaseMapperX<PlanDateDO> {

    default PageResult<PlanDateDO> selectPage(PlanDatePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PlanDateDO>()
                .likeIfPresent(PlanDateDO::getPlanName, reqVO.getPlanName())
                .eqIfPresent(PlanDateDO::getPlanCoding, reqVO.getPlanCoding())
                .eqIfPresent(PlanDateDO::getParentId, reqVO.getParentId())
                .eqIfPresent(PlanDateDO::getYear, reqVO.getYear())
                .eqIfPresent(PlanDateDO::getInitialValue, reqVO.getInitialValue())
                .eqIfPresent(PlanDateDO::getAverageValue, reqVO.getAverageValue())
                .eqIfPresent(PlanDateDO::getSumValue, reqVO.getSumValue())
                .eqIfPresent(PlanDateDO::getJanuary, reqVO.getJanuary())
                .eqIfPresent(PlanDateDO::getFebruary, reqVO.getFebruary())
                .eqIfPresent(PlanDateDO::getMarch, reqVO.getMarch())
                .eqIfPresent(PlanDateDO::getApril, reqVO.getApril())
                .eqIfPresent(PlanDateDO::getMay, reqVO.getMay())
                .eqIfPresent(PlanDateDO::getJune, reqVO.getJune())
                .eqIfPresent(PlanDateDO::getJuly, reqVO.getJuly())
                .eqIfPresent(PlanDateDO::getAugust, reqVO.getAugust())
                .eqIfPresent(PlanDateDO::getSeptember, reqVO.getSeptember())
                .eqIfPresent(PlanDateDO::getOctober, reqVO.getOctober())
                .eqIfPresent(PlanDateDO::getNovember, reqVO.getNovember())
                .eqIfPresent(PlanDateDO::getDecember, reqVO.getDecember())
                .betweenIfPresent(PlanDateDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PlanDateDO::getId));
    }

}