lyhzzz 2 年之前
父節點
當前提交
95c6f0054f

+ 5 - 3
src/main/java/com/fdkankan/ucenter/service/impl/SceneApiService.java

@@ -17,6 +17,7 @@ import com.fdkankan.ucenter.httpClient.service.LaserService;
 import com.fdkankan.ucenter.service.*;
 import com.fdkankan.ucenter.util.DateUserUtil;
 import com.fdkankan.ucenter.vo.SceneBySnCodeVo;
+import com.fdkankan.ucenter.vo.request.RequestScene;
 import com.fdkankan.ucenter.vo.request.SceneParam;
 import com.fdkankan.ucenter.vo.response.SceneVo;
 import org.apache.commons.lang3.StringUtils;
@@ -139,15 +140,16 @@ public class SceneApiService {
         if(StringUtils.isNotEmpty(pageSizeStr)){
             pageSize = Integer.valueOf(pageSizeStr);
         }
-        SceneParam param  = new SceneParam();
-        param.setHasFolder(0);
+        RequestScene param = new RequestScene();
         param.setPageNum(pageNum);
         param.setPageSize(pageSize);
         param.setSnCode(snCode);
         param.setStartTime(startDate);
         param.setEndTime(endDate);
+        param.setNum(num);
+        param.setSceneName(sceneName);
         param.setUserId(user.getId());
-        Page<SceneVo> sceneVoPage = sceneProService.pageListAndFolder(new Page<>(param.getPageNum(),param.getPageSize()),param);
+        Page<SceneVo> sceneVoPage = sceneService.getSceneList(param);
         List<Map<String, Object>> list = new ArrayList<>();
         for (SceneVo sceneVo : sceneVoPage.getRecords()) {
             HashMap<String,Object> map = new HashMap<>();

+ 10 - 0
src/main/java/com/fdkankan/ucenter/vo/request/RequestScene.java

@@ -21,5 +21,15 @@ public class RequestScene extends RequestBase implements Serializable {
 
     private Long userId;
 
+    private String num;
+
+    private String snCode;
+
+    private String sceneName;
+
+    private String startTime;
+
+    private String endTime;
+
 
 }

+ 16 - 0
src/main/resources/mapper/ucenter/SceneMapper.xml

@@ -9,6 +9,9 @@
         FROM t_scene_pro p
         <include refid="sceneJoinCamera"></include>
         WHERE is_upgrade = 0 and  p.rec_status = 'A' and p.status in(1,-2)
+        <if test="param.sceneName !=null and param.sceneName != '' ">
+            and p.scene_name like CONCAT('%',#{param.sceneName},'%')
+        </if>
         <include refid="commonWhere"></include>
         <if test="param.searchKey !=null and param.searchKey !=''">
             and ( p.scene_name like CONCAT('%',#{param.searchKey},'%')
@@ -28,6 +31,9 @@
         LEFT JOIN t_scene_plus_ext e on p.id = e.plus_id
         <include refid="sceneJoinCamera"></include>
         WHERE p.rec_status = 'A' and p.scene_status in(1,-2)
+        <if test="param.sceneName !=null and param.sceneName != '' ">
+            and p.title like CONCAT('%',#{param.sceneName},'%')
+        </if>
         <include refid="commonWhere"></include>
 
         <if test="param.searchKey !=null and param.searchKey !=''">
@@ -47,10 +53,20 @@
 
     <sql id="commonWhere">
         and p.user_id =#{param.userId} and pay_status = 1
+        <if test="param.snCode !=null and param.snCode != '' ">
+            and c.sn_code like CONCAT('%',#{param.snCode},'%')
+        </if>
+        <if test="param.startTime !=null and param.startTime !=''">
+            and p.create_time &gt;= #{param.startTime}
+        </if>
+        <if test="param.endTime !=null and param.endTime !=''">
+            and p.create_time &lt;= #{param.endTime}
+        </if>
     </sql>
 
     <sql id="sceneJoinCamera">
         LEFT JOIN t_camera c on p.camera_id = c.id
     </sql>
 
+
 </mapper>