Przeglądaj źródła

录像计划下拉查询修改

xujie 10 miesięcy temu
rodzic
commit
aef55431bb

+ 7 - 0
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/controller/VideoTemplateAndPlanController.java

@@ -36,4 +36,11 @@ public class VideoTemplateAndPlanController {
         return AjaxResult.success(list);
     }
 
+    @ApiOperation("录像模板")
+    @GetMapping({"/template/templateNameList"})
+    AjaxResult templateNameList() {
+        List<String> list = dvsTemplateChannelService.getTemplateNameList();
+        return AjaxResult.success(list);
+    }
+
 }

+ 2 - 0
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/mapper/IotDvsTemplateChannelMapper.java

@@ -18,4 +18,6 @@ public interface IotDvsTemplateChannelMapper extends BaseMapper<IotDvsTemplateCh
     Page<VideoChannelPlanVo> getChannelPlanList(Page<VideoChannelPlanPageDto> pageRequest, @Param("req") VideoChannelPlanPageDto req);
 
     List<VideoChannelPlanTimeVo> getChannelPlanTimeList(@Param("req")VideoChannelPlanTimeDto req);
+
+    List<String> getTemplateNameList();
 }

+ 2 - 0
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/service/IotDvsTemplateChannelService.java

@@ -23,4 +23,6 @@ public interface IotDvsTemplateChannelService extends IService<IotDvsTemplateCha
     TableDataInfo<VideoChannelPlanVo> getChannelPlanList(VideoChannelPlanPageDto dto);
 
     List<VideoChannelPlanTimeVo> getChannelPlanTimeList(VideoChannelPlanTimeDto dto);
+
+    List<String> getTemplateNameList();
 }

+ 12 - 0
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/service/impl/IotDvsTemplateChannelServiceImpl.java

@@ -16,6 +16,7 @@ import com.xunmei.system.api.domain.SysOrg;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -53,5 +54,16 @@ public class IotDvsTemplateChannelServiceImpl extends ServiceImpl<IotDvsTemplate
         return iotDvsTemplateChannelMapper.getChannelPlanTimeList(dto);
     }
 
+    @Override
+    public List<String> getTemplateNameList() {
+        List<String> list = new ArrayList<>();
+        list.add("未绑定");
+        List<String> templateNameList = iotDvsTemplateChannelMapper.getTemplateNameList();
+        if (templateNameList != null && templateNameList.size() > 0) {
+            list.addAll(templateNameList);
+        }
+        return list;
+    }
+
 
 }

+ 16 - 0
soc-modules/soc-modules-iot/src/main/resources/mapper/IotDvsTemplateChannelMapper.xml

@@ -40,6 +40,19 @@
             <if test="req.dvsName != null and req.dvsName != ''">
                 and i.device_name like concat('%',#{req.dvsName},'%')
             </if>
+            <if test="req.planType != null">
+                and p.plan_type = #{req.planType}
+            </if>
+            <if test="req.templateName != null and req.templateName != ''">
+                <choose>
+                    <when test="req.templateName == '未绑定'">
+                        and a.`name` is null
+                    </when>
+                    <otherwise>
+                        and a.`name` = #{req.templateName}
+                    </otherwise>
+                </choose>
+            </if>
         order by p.plan_type desc
     </select>
 
@@ -60,4 +73,7 @@
         ORDER BY
             p.`week` ASC
     </select>
+    <select id="getTemplateNameList" resultType="java.lang.String">
+        SELECT `name` FROM iot_dvs_template GROUP BY `name` ORDER BY `name`
+    </select>
 </mapper>