package com.njcn.gather.aireport.reportmodel.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.gather.aireport.reportmodel.pojo.po.ReportModelPO;
import com.njcn.gather.aireport.reportmodel.pojo.vo.ReportModelUserNameVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Collection;
import java.util.List;

@Mapper
public interface ReportModelMapper extends BaseMapper<ReportModelPO> {

    @Select({
            "<script>",
            "select id, name from sys_user where id in",
            "<foreach collection='ids' item='id' open='(' separator=',' close=')'>",
            "#{id}",
            "</foreach>",
            "</script>"
    })
    List<ReportModelUserNameVO> selectUserNamesByIds(@Param("ids") Collection<String> ids);
}
