package com.cico.nest.lcdp.boot.core.qxsd.infrastructure.gatewayimpl.database;

import java.util.*;

import com.cico.nest.lcdp.boot.core.qxsd.adapter.web.vo.eventType.EventTypePageReqVO;
import com.cico.nest.lcdp.boot.core.qxsd.infrastructure.gatewayimpl.database.dataobject.EventTypeDO;
import com.cico.nest.lcdp.framework.common.pojo.PageResult;
import com.cico.nest.lcdp.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cico.nest.lcdp.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;

/**
 * 事件类型映射 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface EventTypeMapper extends BaseMapperX<EventTypeDO> {

    default PageResult<EventTypeDO> selectPage(EventTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<EventTypeDO>()
                .eqIfPresent(EventTypeDO::getCode, reqVO.getCode())
                .likeIfPresent(EventTypeDO::getName, reqVO.getName())
                .eqIfPresent(EventTypeDO::getXlwCode, reqVO.getXlwCode())
                .likeIfPresent(EventTypeDO::getXlwName, reqVO.getXlwName())
                .eqIfPresent(EventTypeDO::getSdgkCode, reqVO.getSdgkCode())
                .likeIfPresent(EventTypeDO::getSdgkName, reqVO.getSdgkName())
                .betweenIfPresent(EventTypeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(EventTypeDO::getId));
    }

}
