package com.pcloud.book.group.mapper;

import com.pcloud.book.group.dto.WxWorkTeacherDTO;
import com.pcloud.book.group.entity.WeworkTeacher;
import com.pcloud.book.group.vo.WeworkTeacherVO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

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

@Component
@Mapper
public interface WeworkTeacherMapper {
    int deleteByPrimaryKey(Long id);

    int insert(WeworkTeacher record);

    int insertSelective(WeworkTeacher record);

    WeworkTeacher selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(WeworkTeacher record);

    int updateByPrimaryKey(WeworkTeacher record);

    Integer count4WxworkTeacherList(@Param("name") String name, @Param("isOpen") Integer isOpen, @Param("teacherType") Integer teacherType);

    List<WeworkTeacherVO> getWxworkTeacherList(@Param("name") String name, @Param("isOpen") Integer isOpen,
                                               @Param("teacherType") Integer teacherType, @Param("offset") Integer offset,
                                               @Param("limit") Integer limit);

    List<WeworkTeacherVO> queryAll();

    List<WeworkTeacher> listByIds(@Param("ids") List<Long> ids);

    List<WeworkTeacherVO> getMaterialByIds(@Param("longs") List<Long> longs);

    String getOneTeacherQrcode();

    @MapKey("id")
    Map<Long, WxWorkTeacherDTO> getWxWorkTeacherByIds(@Param("ids") List<Long> teacherIds);
}
