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

import java.util.*;

import org.apache.ibatis.annotations.Mapper;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSimpleFlowCodePageReqVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSimpleFlowCodeReqVO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSimpleFlowCodeDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;

/**
 * LiteFlow脚本配置 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface ConfigSimpleFlowCodeMapper extends BaseMapperX<ConfigSimpleFlowCodeDO> {

    default PageResult<ConfigSimpleFlowCodeDO> selectPage(ConfigSimpleFlowCodePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ConfigSimpleFlowCodeDO>()
                .eqIfPresent(ConfigSimpleFlowCodeDO::getCodeNo, reqVO.getCodeNo())
                .likeIfPresent(ConfigSimpleFlowCodeDO::getCodeName, reqVO.getCodeName())
                .eqIfPresent(ConfigSimpleFlowCodeDO::getCodeData, reqVO.getCodeData())
                .eqIfPresent(ConfigSimpleFlowCodeDO::getCodeType, reqVO.getCodeType())
                .eqIfPresent(ConfigSimpleFlowCodeDO::getCodeLanguage, reqVO.getCodeLanguage())
                .eqIfPresent(ConfigSimpleFlowCodeDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(ConfigSimpleFlowCodeDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ConfigSimpleFlowCodeDO::getRemark, reqVO.getRemark())
                .orderByDesc(ConfigSimpleFlowCodeDO::getId));
    }
    
    default List<ConfigSimpleFlowCodeDO> selectList(ConfigSimpleFlowCodeReqVO reqVO) {
    	return selectList(new LambdaQueryWrapperX<ConfigSimpleFlowCodeDO>()
                .eqIfPresent(ConfigSimpleFlowCodeDO::getCodeNo, reqVO.getCodeNo())
                .likeIfPresent(ConfigSimpleFlowCodeDO::getCodeName, reqVO.getCodeName())
                .eqIfPresent(ConfigSimpleFlowCodeDO::getCodeData, reqVO.getCodeData())
                .eqIfPresent(ConfigSimpleFlowCodeDO::getCodeType, reqVO.getCodeType())
                .eqIfPresent(ConfigSimpleFlowCodeDO::getCodeLanguage, reqVO.getCodeLanguage())
                .eqIfPresent(ConfigSimpleFlowCodeDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(ConfigSimpleFlowCodeDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ConfigSimpleFlowCodeDO::getRemark, reqVO.getRemark())
                .orderByDesc(ConfigSimpleFlowCodeDO::getId));
    }

}