Van333
2022-09-02 2234cee8e872fd7633b95eef5b0c760cbbb8eabf
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
29
30
31
32
33
package api.dao;
 
import api.bean.LampEntity;
import api.bean.SinglelampDataEntity;
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;
 
/**
 * @author van
 * @version 1.0
 * msg:
 * @date 2021/12/16 15:56
 */
 
@Mapper
@Repository
public interface SinglelampDataDao {
    /**超级管理员查找全部*/
    List<SinglelampDataEntity> selectAll();
    /**普通管理员按公司查找*/
    List<SinglelampDataEntity> selectByCompany(@Param("page") Integer page, @Param("size") Integer size,@Param("userId") Long userId);
    /**用户查找*/
    //List<SinglelampDataEntity> selectByUserId(Long userId);
    /**单个灯杆数据*/
    List<SinglelampDataEntity> selectByStreetlightId(String mac);
 
    @Select("select count(*) from pole_streetlight ps where ps.streetlight_id in(select pus.streetlight_id from pole_user_streetlight pus where pus.company_id in(select suc.company_id from sys_user_company suc where suc.user_id=#{userId}))")
    Integer countByCompany(@Param("userId") Long userId);
}