package io.renren.modules.sys.dao.algs;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import io.renren.modules.sys.entity.algs.Algorithm_Vo;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: Ivan Q
 * @Date: 2021/6/10 20:24
 */

@Mapper
public interface AlgorithmVoMapper extends BaseMapper<Algorithm_Vo> {
    @Select("SELECT a.*, b.username FROM algorithm a LEFT JOIN sys_user b ON a.uid = b.user_id ${ew.customSqlSegment}")
    List<Algorithm_Vo> getAlgorithmInfo(@Param(Constants.WRAPPER) Wrapper wrapper);

    @Select("SELECT a.*, b.username FROM algorithm a sys_user b WHERE a.uid = b.user_id and a.uid = #{id,jdbcType=BIGINT}")
    List<Algorithm_Vo> getAlgorithmInfoById(@Param("id") Long id);
}
