<?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.yeejoin.equipmanage.mapper.SourceSceneMapper">

    <select id="queryEquipmentScene" resultType="com.yeejoin.equipmanage.common.entity.SourceScene">
       SELECT
            sou.id,
			sou.scene_id
	   FROM
			wl_source_scene sou
		WHERE
			find_in_set(#{equipmentSpecificId},sou.point_in_scene)>0
		    and EXISTS (SELECT distinct fi.instance_id from wl_form_instance fi where fi.instance_id = sou.source_id)
			limit 1
    </select>
</mapper>
