package cn.iocoder.yudao.module.smartfactory.dal.mysql.worktype;

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.smartfactory.controller.admin.worktype.vo.WorkTypePageReqVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.worktype.WorkTypeDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 工种 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface WorkTypeMapper extends BaseMapperX<WorkTypeDO> {

    default PageResult<WorkTypeDO> selectPage(WorkTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WorkTypeDO>()
                .eqIfPresent(WorkTypeDO::getPostId, reqVO.getPostId())
                .likeIfPresent(WorkTypeDO::getName, reqVO.getName())
                .betweenIfPresent(WorkTypeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WorkTypeDO::getId));
    }

}