|
@@ -2,42 +2,10 @@
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.fdkankan.ucenter.mapper.IScenePlusMapper">
|
|
<mapper namespace="com.fdkankan.ucenter.mapper.IScenePlusMapper">
|
|
|
|
|
|
- <select id="pageList" resultType="com.fdkankan.ucenter.vo.response.AppSceneVo">
|
|
|
|
- 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
|
|
|
|
- FROM t_scene_pro p
|
|
|
|
- WHERE is_upgrade = 0 and p.rec_status = 'A' AND ( p.status = 1 OR p.status = -2) AND p.scene_type != 99
|
|
|
|
- <include refid="commonWhere"></include>
|
|
|
|
- <if test="param.sceneName !=null and param.sceneName !=''">
|
|
|
|
- and p.scene_name like CONCAT('%',#{param.sceneName},'%')
|
|
|
|
- </if>
|
|
|
|
- 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
|
|
|
|
- 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 = 1 OR p.scene_status = -2) AND p.scene_type != 99
|
|
|
|
- <include refid="commonWhere"></include>
|
|
|
|
- <if test="param.sceneName !=null and param.sceneName !=''">
|
|
|
|
- and p.title like CONCAT('%',#{param.sceneName},'%')
|
|
|
|
- </if>
|
|
|
|
- <if test="param.orderBy !=null and param.orderBy !=''">
|
|
|
|
- ORDER BY ${param.orderBy}
|
|
|
|
- </if>
|
|
|
|
- <if test="param.orderBy ==null or param.orderBy ==''">
|
|
|
|
- ORDER BY create_time desc
|
|
|
|
- </if>
|
|
|
|
-
|
|
|
|
- </select>
|
|
|
|
-
|
|
|
|
-
|
|
|
|
<sql id="commonWhere">
|
|
<sql id="commonWhere">
|
|
left join t_user u on p.user_id = u.id
|
|
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 c on p.camera_id = c.id
|
|
left join t_camera_detail d on c.id = d.camera_id
|
|
left join t_camera_detail d on c.id = d.camera_id
|
|
- where p.rec_status = 'A'
|
|
|
|
<if test="param.sceneType !=null and param.sceneType !=''">
|
|
<if test="param.sceneType !=null and param.sceneType !=''">
|
|
and p.scene_type = #{param.sceneType}
|
|
and p.scene_type = #{param.sceneType}
|
|
</if>
|
|
</if>
|
|
@@ -64,6 +32,37 @@
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
+ <select id="pageList" resultType="com.fdkankan.ucenter.vo.response.AppSceneVo">
|
|
|
|
+ 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
|
|
|
|
+ FROM t_scene_pro p
|
|
|
|
+ <include refid="commonWhere"></include>
|
|
|
|
+ and is_upgrade = 0 and p.rec_status = 'A' AND ( p.status = 1 OR p.status = -2) AND p.scene_type != 99
|
|
|
|
+ <if test="param.sceneName !=null and param.sceneName !=''">
|
|
|
|
+ and p.scene_name like CONCAT('%',#{param.sceneName},'%')
|
|
|
|
+ </if>
|
|
|
|
+ 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
|
|
|
|
+ FROM t_scene_plus p
|
|
|
|
+ LEFT JOIN t_scene_plus_ext e on p.id = e.plus_id
|
|
|
|
+ <include refid="commonWhere"></include>
|
|
|
|
+ and p.rec_status = 'A' AND ( p.scene_status = 1 OR p.scene_status = -2) AND p.scene_type != 99 and e.location !=7
|
|
|
|
+ <if test="param.sceneName !=null and param.sceneName !=''">
|
|
|
|
+ and p.title like CONCAT('%',#{param.sceneName},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="param.orderBy !=null and param.orderBy !=''">
|
|
|
|
+ ORDER BY ${param.orderBy}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="param.orderBy ==null or param.orderBy ==''">
|
|
|
|
+ ORDER BY create_time desc
|
|
|
|
+ </if>
|
|
|
|
+
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+
|
|
<select id="getCountByUserId" resultType="java.lang.Long">
|
|
<select id="getCountByUserId" resultType="java.lang.Long">
|
|
select count(*) from t_scene_plus s left join t_camera_detail d on s.camera_id = d.camera_id
|
|
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'
|
|
where s.rec_status = 'A'
|