소스 검색

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>