package com.ruoyi.system.mapper;

import java.util.List;
import com.ruoyi.system.domain.TbSchoolFacilitiesContrastIcon;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 院校设施名称和图片对照Mapper接口
 * 
 * @author ruoyi
 * @date 2022-10-12
 */
@Mapper
public interface TbSchoolFacilitiesContrastIconMapper 
{
    /**
     * 查询院校设施名称和图片对照
     * 
     * @param id 院校设施名称和图片对照主键
     * @return 院校设施名称和图片对照
     */
    public TbSchoolFacilitiesContrastIcon selectTbSchoolFacilitiesContrastIconById(Long id);

    /**
     * 查询院校设施名称和图片对照列表
     * 
     * @param tbSchoolFacilitiesContrastIcon 院校设施名称和图片对照
     * @return 院校设施名称和图片对照集合
     */
    public List<TbSchoolFacilitiesContrastIcon> selectTbSchoolFacilitiesContrastIconList(TbSchoolFacilitiesContrastIcon tbSchoolFacilitiesContrastIcon);

    /**
     * 新增院校设施名称和图片对照
     * 
     * @param tbSchoolFacilitiesContrastIcon 院校设施名称和图片对照
     * @return 结果
     */
    public int insertTbSchoolFacilitiesContrastIcon(TbSchoolFacilitiesContrastIcon tbSchoolFacilitiesContrastIcon);

    /**
     * 修改院校设施名称和图片对照
     * 
     * @param tbSchoolFacilitiesContrastIcon 院校设施名称和图片对照
     * @return 结果
     */
    public int updateTbSchoolFacilitiesContrastIcon(TbSchoolFacilitiesContrastIcon tbSchoolFacilitiesContrastIcon);

    /**
     * 删除院校设施名称和图片对照
     * 
     * @param id 院校设施名称和图片对照主键
     * @return 结果
     */
    public int deleteTbSchoolFacilitiesContrastIconById(Long id);

    /**
     * 批量删除院校设施名称和图片对照
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteTbSchoolFacilitiesContrastIconByIds(String[] ids);

    @Select({"<script>" +
            "select count(0) from tb_school_facilities_contrast_icon \n" +
            "where facilities_type=#{facilitiesType} \n" +
            "and \n" +
            "facilities_name=#{facilitiesName}\n" +
            "</script>"})
    public int queryByFacilitiesTypeAndName(TbSchoolFacilitiesContrastIcon tbSchoolFacilitiesContrastIcon);

    @Select("select distinct facilities_type from tb_school_facilities_contrast_icon")
    public List<String> getFacilitiesTypeList();

    @Select("select id,facilities_name as facilitiesName \n" +
            "from tb_school_facilities_contrast_icon \n" +
            "where facilities_type=#{type}")
    public List<TbSchoolFacilitiesContrastIcon> queryFacilitiesByType(String type);
}
