package com.ruoyi.web.work.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.web.work.domain.Relate;
import com.ruoyi.web.work.domain.vo.RelateCompanyListVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author lsw
 * @date 2024-04-18
 */
public interface RelateMapper extends BaseMapper<Relate> {
    List<Relate> selectList(Relate relate);

    List<RelateCompanyListVo> selectRelateCompanyList(Relate relate);

    @Select("SELECT * FROM tb_relate WHERE user_id=#{userId} AND company_id=#{companyId}")
    Relate check(Relate relate);

    @Delete("DELETE  FROM tb_relate WHERE user_id=#{userId} AND company_id=#{companyId}")
    boolean remove(Relate relate);
}
