/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ifish.mapper;

import com.ifish.bean.DeviceUserBean;
import com.ifish.entity.DeviceCamera;
import com.ifish.entity.DeviceUser;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 *
 * @author Administrator
 */
public interface Tbl_Device_User_Mapper {

    /**
     * 根据用户ID获取设备列表
     *
     * @param userid
     * @return
     */
    @Select("select user_id,device_id,is_master,show_name,create_time,update_time,custom_icon_name,custom_show_name from tbl_device_user where user_id = #{userid}")
    List<DeviceUserBean> getDeviceUsersByUserId(@Param("userid") Integer userid);

    /**
     * 根据设备ID获取设备绑定摄像头集合
     *
     * @param deviceId
     * @return
     */
    @Select("select camera_id,device_id from tbl_device_camera where device_id=#{deviceId}")
    List<DeviceCamera> getDeviceCameraListByDeviceId(@Param("deviceId") Integer deviceId);
}
