package org.jeecg.modules.itdmDevice.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.itdmDevice.entity.ItdmDevice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * @Description: 设备表
 * @Author: jeecg-boot
 * @Date:   2023-05-20
 * @Version: V1.0
 */
public interface ItdmDeviceMapper extends BaseMapper<ItdmDevice> {

    /**
     * 设备下拉列表
     */
    @Select("select * from itdm_device" )
    List<ItdmDevice> queryList();

    /**
     * 通过设备id（多个，以逗号间隔）查询设备名（多个，以逗号间隔）
     */
    @Select("SELECT GROUP_CONCAT(device_name SEPARATOR ',') AS shebeiname " +
            "FROM itdm_device " +
            "WHERE FIND_IN_SET(id, #{shebeiId})")
    String queryNameByIdList(@Param("shebeiId") String shebeiId);

}
