package com.zt.plat.module.qms.common.data.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.common.data.controller.vo.DataKeyCheckPageReqVO;
import com.zt.plat.module.qms.common.data.dal.dataobject.DataKeyCheckDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 数据重复校验 Mapper
 *
 * @author 后台管理-1
 */
@Mapper
public interface DataKeyCheckMapper extends BaseMapperX<DataKeyCheckDO> {

    default PageResult<DataKeyCheckDO> selectPage(DataKeyCheckPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DataKeyCheckDO>()
                .eqIfPresent(DataKeyCheckDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .eqIfPresent(DataKeyCheckDO::getModuleCode, reqVO.getModuleCode())
                .eqIfPresent(DataKeyCheckDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(DataKeyCheckDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DataKeyCheckDO::getId));
    }

}