瀏覽代碼

app场景修改

lyhzzz 2 年之前
父節點
當前提交
3ced898f13
共有 1 個文件被更改,包括 5 次插入7 次删除
  1. 5 7
      src/main/resources/mapper/ucenter/ScenePlusMapper.xml

+ 5 - 7
src/main/resources/mapper/ucenter/ScenePlusMapper.xml

@@ -7,7 +7,7 @@
         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
         FROM t_scene_pro p
-        <include refid="sceneJoinCamera"></include>
+        left join `t_camera_detail` tcd on p.camera_id = tcd.camera_id
         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 !=''">
@@ -19,7 +19,7 @@
         p.camera_id,p.user_id,e.data_source,p.scene_type,build_type
         FROM t_scene_plus p
         LEFT JOIN t_scene_plus_ext e on p.id = e.plus_id
-        <include refid="sceneJoinCamera"></include>
+        left join `t_camera_detail` tcd on p.camera_id = tcd.camera_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 !=''">
@@ -34,11 +34,6 @@
 
     </select>
 
-    <sql id="sceneJoinCamera">
-         <if test= 'param.cameraType != null' >
-          join `t_camera_detail` tcd on p.camera_id = tcd.camera_id and tcd.goods_id = #{param.cameraType}
-        </if>
-    </sql>
 
     <sql id="commonWhere">
         <if test= 'param.userId != null or param.cooperationNums != null or param.cameraId != null'>
@@ -59,6 +54,9 @@
         <if test="param.sceneType !=null and param.sceneType !=''">
             and  p.scene_type  = #{param.sceneType}
         </if>
+        <if test= 'param.cameraType != null' >
+            and tcd.goods_id = #{param.cameraType}
+        </if>
     </sql>