Van333
2022-12-29 d8f66b834134f6b755fd3fb93bb91b56f9d31f6f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package api.dao;
 
import api.bean.SysUserCompanyEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
 
import java.util.List;
 
/**
 * @program: machine-fast
 * @description:
 * @author: YSS
 * @create: 2019-04-18 11:21
 **/
@Mapper
@Repository
public interface SysUserCompanyDao extends BaseMapper<SysUserCompanyEntity> {
 
    @Select("select company_id from sys_user_company where user_id = #{userId}")
    Long queryCompanyId(@Param("userId") Long userId);
 
    @Select("select * from sys_user_company where company_id = (select company_id from sys_user_company where user_id = #{userId})")
    List<SysUserCompanyEntity> listByCompanyId(@Param("userId") Long userId);
 
}