/*
 * 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.entity.CameraUser;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

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

    /**
     * 根据用户信息获取绑定的摄像头列表
     *
     * @param userid
     * @return
     */
    @Select("select user_id,camera_id,is_master,show_name,is_look,is_live,create_time,update_time from tbl_camera_user where user_id=#{userid}")
    List<CameraUser> getCameraUserListByUserId(@Param("userid") Integer userid);

    @Update("update tbl_camera_user set user_id = #{userId} where camera_id = #{cameraId}")
    void updateCameraUserId(@Param("userId") Integer userId, @Param("cameraId") Integer cameraId);

    @Update("update tbl_device_user set user_id = #{userId} where device_id = #{deviceId} and user_id = #{userId1}")
    void updateDeviceUserId(@Param("userId") Integer userId, @Param("userId1") Integer userId1, @Param("deviceId") Integer deviceId);

}
