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 selectAll(); /**普通管理员按公司查找*/ List selectByCompany(@Param("page") Integer page, @Param("size") Integer size,@Param("userId") Long userId); /**用户查找*/ //List selectByUserId(Long userId); /**单个灯杆数据*/ List 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); }