package com.zt.plat.module.qms.business.config.dal.mapper;

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.qms.business.config.controller.vo.ConfigReportTypePageReqVO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTypeDO;
import org.apache.ibatis.annotations.Mapper;
import com.zt.plat.module.qms.business.config.controller.vo.*;

/**
 * 报表类型配置 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface ConfigReportTypeMapper extends BaseMapperX<ConfigReportTypeDO> {

    default PageResult<ConfigReportTypeDO> selectPage(ConfigReportTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ConfigReportTypeDO>()
                .likeIfPresent(ConfigReportTypeDO::getName, reqVO.getName())
                .eqIfPresent(ConfigReportTypeDO::getKey, reqVO.getKey())
                .eqIfPresent(ConfigReportTypeDO::getTemplate, reqVO.getTemplate())
                .eqIfPresent(ConfigReportTypeDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(ConfigReportTypeDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ConfigReportTypeDO::getRemark, reqVO.getRemark())
                .eqIfPresent(ConfigReportTypeDO::getVersion, reqVO.getVersion())
                .orderByDesc(ConfigReportTypeDO::getId));
    }

}