left join t_user u on p.user_id = u.id
left join t_camera c on p.camera_id = c.id
left join t_camera_detail d on c.id = d.camera_id
where p.rec_status = 'A' AND p.scene_type != 99
and p.num not in (select num from t_scene_not_display where rec_status= 'A')
and p.scene_type = #{param.sceneType}
and d.type = #{param.cameraType}
and p.num not in
#{num}
and ( p.camera_id = #{param.cameraId} or p.user_id = #{param.userId} or p.num in
#{coNum}
)
and ( p.camera_id = #{param.cameraId} or p.user_id = #{param.userId} )
and p.camera_id = #{param.cameraId}
and ( p.camera_id = #{param.cameraId} or p.num in
#{coNum}
)
and p.user_id = #{param.userId}
and ( p.user_id = #{param.userId} or p.num in
#{coNum}
)
SELECT p.id ,null as name ,0 as isFolder,null as type,null as parentId ,p.create_time,num,scene_name,scene_dec,
p.status,pay_status,thumb,web_site,0 as is_upgrade,view_count,
p.camera_id,p.user_id ,p.data_source,p.scene_type,build_type,c.sn_code,c.child_name,4 as location
FROM t_scene_pro p
and is_upgrade = 0 AND ( p.status = 1 OR p.status = -2)
and p.scene_name like CONCAT('%',#{param.sceneName},'%')
UNION
SELECT p.id as id ,null as name ,0 as isFolder,null as type,null as parentId,p.create_time ,num,title as scene_name,description as scene_dec,
scene_status as status,pay_status,thumb,web_site,1 as is_upgrade,view_count,
p.camera_id,p.user_id,e.data_source,p.scene_type,build_type,c.sn_code,c.child_name,e.location
FROM t_scene_plus p
LEFT JOIN t_scene_plus_ext e on p.id = e.plus_id
and (e.location != 7 or e.location is null )
AND ( p.scene_status = 1 OR p.scene_status = -2)
and p.title like CONCAT('%',#{param.sceneName},'%')
ORDER BY ${param.orderBy}
ORDER BY create_time desc
select count(*) from t_scene_plus s left join t_camera_detail d on s.camera_id = d.camera_id
where s.rec_status = 'A'
and s.user_id = #{userId} and d.type = #{cameraType}
select sum(space) from t_scene_plus p left join t_scene_plus_ext e on p.id = e.plus_id where p.rec_status = 'A' and p.scene_status = -2 and p.camera_id = #{cameraId}
SELECT scene_source as type,count(1) as sceneNum,s.is_obj from t_scene_pro s
WHERE s.rec_status = 'A' and s.is_upgrade = 0
GROUP BY scene_source,is_obj
SELECT scene_source as type,count(1) as sceneNum,e.is_obj from t_scene_plus s LEFT JOIN t_scene_plus_ext e on s.id = e.plus_id
WHERE s.rec_status = 'A' and s.user_id = #{userId}
GROUP BY scene_source,is_obj
select s.* from t_scene_plus s LEFT JOIN t_scene_plus_ext e on s.id = e.plus_id
WHERE s.rec_status = 'A' and s.user_id = #{userId}
and s.scene_source in
#{sceneSource}
and e.is_obj = 1
select * from t_scene_plus s LEFT JOIN t_scene_plus_ext e on s.id = e.plus_id
WHERE s.rec_status = 'A' and s.user_id = #{param.userId}
and s.scene_source = #{param.sceneSource}
and e.location = #{param.location}
and s.title like CONCAT('%',#{param.title},'%')
and s.num = #{param.num}
order by s.create_time desc