package cn.iocoder.yudao.module.llm.dal.mysql.application;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.llm.dal.dataobject.application.ApplicationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.llm.controller.admin.application.vo.*;

/**
 * 大模型应用 Mapper
 *
 * @author 华大大模型
 */
@Mapper
public interface ApplicationMapper extends BaseMapperX<ApplicationDO> {

    default PageResult<ApplicationDO> selectPage(ApplicationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ApplicationDO>()
                .likeIfPresent(ApplicationDO::getAppName, reqVO.getAppName())
                .eqIfPresent(ApplicationDO::getAppCategory, reqVO.getAppCategory())
                .eqIfPresent(ApplicationDO::getCreator, reqVO.getCreator())
                .neIfPresent(ApplicationDO::getCreator, reqVO.getExclude())
                .eq(ApplicationDO::getDeleted,false)
                .orderByDesc(ApplicationDO::getId));
    }

}
