<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fdkankan.ucenter.mapper.ISceneResourceMapper">

    <select id="sceneResourceByCameraId" resultType="com.fdkankan.ucenter.entity.SceneResource">
        SELECT a.* FROM `t_scene_resource` a LEFT JOIN `t_scene_resource_camera` b ON a.id = b.scene_resource_id
        WHERE b.rec_status = 'A' and b.camera_id = #{cameraId}
    </select>
    <select id="getByCooperationId" resultType="com.fdkankan.ucenter.entity.SceneResource">
        SELECT a.* FROM `t_scene_resource` a LEFT JOIN `t_scene_resource_cooperation` b ON a.id = b.scene_resource_id
        WHERE b.rec_status = 'A' and b.scene_cooperation_id = #{cooId}
    </select>
</mapper>
