package cn.iocoder.yudao.module.mes.dal.mysql.moldrecordsubject;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.mes.controller.admin.moldrecordsubject.vo.MoldRecordSubjectPageReqVO;
import cn.iocoder.yudao.module.mes.dal.dataobject.moldrecordsubject.MoldRecordSubjectDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 维保项目 Mapper
 *
 * @author 内蒙必硕
 */
@Mapper
public interface MoldRecordSubjectMapper extends BaseMapperX<MoldRecordSubjectDO> {

    default PageResult<MoldRecordSubjectDO> selectPage(MoldRecordSubjectPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MoldRecordSubjectDO>()
                .eqIfPresent(MoldRecordSubjectDO::getSubject, reqVO.getSubject())
                .eqIfPresent(MoldRecordSubjectDO::getExpect, reqVO.getExpect())
                .orderByDesc(MoldRecordSubjectDO::getId));
    }
    default List<MoldRecordSubjectDO> selectBy(MoldRecordSubjectPageReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<MoldRecordSubjectDO>()
                .eqIfPresent(MoldRecordSubjectDO::getSubject, reqVO.getSubject())
                .eqIfPresent(MoldRecordSubjectDO::getExpect, reqVO.getExpect())
                .orderByDesc(MoldRecordSubjectDO::getId));
    }
}