package com.zt.plat.module.qms.business.dic.dal.mapper;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.qms.business.dic.controller.vo.DictionarySampleFlowNodePageReqVO;
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionarySampleFlowNodeDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 样品流程节点字典 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface DictionarySampleFlowNodeMapper extends BaseMapperX<DictionarySampleFlowNodeDO> {

    default PageResult<DictionarySampleFlowNodeDO> selectPage(DictionarySampleFlowNodePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DictionarySampleFlowNodeDO>()
                .eqIfPresent(DictionarySampleFlowNodeDO::getKey, reqVO.getKey())
                .likeIfPresent(DictionarySampleFlowNodeDO::getName, reqVO.getName())
                .eqIfPresent(DictionarySampleFlowNodeDO::getType, reqVO.getType())
                .eqIfPresent(DictionarySampleFlowNodeDO::getCode, reqVO.getCode())
                .eqIfPresent(DictionarySampleFlowNodeDO::getDefaultEvent, reqVO.getDefaultEvent())
                .eqIfPresent(DictionarySampleFlowNodeDO::getSortNo, reqVO.getSortNo())
                .eqIfPresent(DictionarySampleFlowNodeDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(DictionarySampleFlowNodeDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(DictionarySampleFlowNodeDO::getRemark, reqVO.getRemark())
                .orderByDesc(DictionarySampleFlowNodeDO::getId));
    }

}