package com.winsun.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.winsun.bean.School;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Mapper
@Component
public interface SchoolMapper extends BaseMapper<School> {

    @Select("  select * from hhr_school  where id  in( select school_id from hhr_user_school where  user_id= #{userId} )")
    List<Map<String,Object>> getuserToSchool(@Param("userId")String userId);

    @Select("select school_id schoolId from `hhr_user_school` where  user_id = #{partner}")
    String selectSchoolIdByUserId(String partner);

}
