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

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.gather.aireport.clientunit.pojo.po.ClientUnitPO;
import com.njcn.gather.aireport.clientunit.pojo.vo.ClientUnitUserNameVO;
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 ClientUnitMapper extends BaseMapper<ClientUnitPO> {

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