package com.zt.plat.module.qms.resource.record.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.resource.record.controller.admin.recordRelation.vo.RecordRelationPageReqVO;
import com.zt.plat.module.qms.resource.record.dal.dataobject.recordRelation.RecordRelationDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 文件记录关系 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface RecordRelationMapper extends BaseMapperX<RecordRelationDO> {

    default PageResult<RecordRelationDO> selectPage(RecordRelationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RecordRelationDO>()
                .eqIfPresent(RecordRelationDO::getRcdId, reqVO.getRcdId())
                .eqIfPresent(RecordRelationDO::getTgtId, reqVO.getTgtId())
                .eqIfPresent(RecordRelationDO::getTgtTp, reqVO.getTgtTp())
                .eqIfPresent(RecordRelationDO::getSysDeptCd, reqVO.getSysDeptCd())
                .eqIfPresent(RecordRelationDO::getRmk, reqVO.getRmk())
                .betweenIfPresent(RecordRelationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RecordRelationDO::getId));
    }

}