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.DictionarySampleTypePageReqVO;
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionarySampleTypeDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 样品类型字典 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface DictionarySampleTypeMapper extends BaseMapperX<DictionarySampleTypeDO> {

    default PageResult<DictionarySampleTypeDO> selectPage(DictionarySampleTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DictionarySampleTypeDO>()
                .eqIfPresent(DictionarySampleTypeDO::getParentId, reqVO.getParentId())
                .likeIfPresent(DictionarySampleTypeDO::getName, reqVO.getName())
                .eqIfPresent(DictionarySampleTypeDO::getKey, reqVO.getKey())
                .eqIfPresent(DictionarySampleTypeDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(DictionarySampleTypeDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(DictionarySampleTypeDO::getRemark, reqVO.getRemark())
                .orderByDesc(DictionarySampleTypeDO::getId));
    }

}