package com.zt.plat.module.base.dal.dao.processinginfomation;

import java.util.*;

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.base.dal.dataobject.processinginfomation.ProcessingInfomationDO;
import org.apache.ibatis.annotations.Mapper;
import com.zt.plat.module.base.controller.admin.processinginfomation.vo.*;

/**
 * 工艺信息 Mapper
 *
 * @author 后台管理-1
 */
@Mapper
public interface ProcessingInfomationMapper extends BaseMapperX<ProcessingInfomationDO> {

    default PageResult<ProcessingInfomationDO> selectPage(ProcessingInfomationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProcessingInfomationDO>()
                .eqIfPresent(ProcessingInfomationDO::getParentId, reqVO.getParentId())
                .eqIfPresent(ProcessingInfomationDO::getCode, reqVO.getCode())
                .likeIfPresent(ProcessingInfomationDO::getName, reqVO.getName())
                .eqIfPresent(ProcessingInfomationDO::getTypeValue, reqVO.getTypeValue())
                .eqIfPresent(ProcessingInfomationDO::getStatusValue, reqVO.getStatusValue())
                .eqIfPresent(ProcessingInfomationDO::getDescription, reqVO.getDescription())
                .betweenIfPresent(ProcessingInfomationDO::getEffectiveDate, reqVO.getEffectiveDate())
                .betweenIfPresent(ProcessingInfomationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ProcessingInfomationDO::getId));
    }

}