Commit 01bf8593 authored by 高建强's avatar 高建强

item:【装备】添加获取重点设备视频接口

parent db0fbb7b
package com.yeejoin.equipmanage.common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ProjectName: amos-biz-boot
* @Package: com.yeejoin.equipmanage.common.vo
* @ClassName: VideoImportantEquipmentVo
* @Author: Jianqiang Gao
* @Description: VideoImportantEquipmentVo
* @Date: 2022/6/16 10:36
* @Version: 1.0
*/
@Data
@ApiModel(value = "VideoImportantEquipmentVo对象", description = "")
public class VideoImportantEquipmentVo {
@ApiModelProperty(value = "视频id")
private Long videoId;
@ApiModelProperty(value = "f_equipment表id(重点设备id)")
private Long importantEquipmentId;
@ApiModelProperty(value = "摄像机编号")
private String code;
@ApiModelProperty(value = "类型编码")
private String typeCode;
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "访问url")
private String url;
@ApiModelProperty(value = "摄像机名称")
private String name;
@ApiModelProperty(value = "图片")
private String img;
@ApiModelProperty(value = "详细地址")
private String address;
}
\ No newline at end of file
package com.yeejoin.equipmanage.controller;
import com.yeejoin.equipmanage.common.vo.VideoImportantEquipmentVo;
import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @ProjectName: amos-biz-boot
* @Package: com.yeejoin.equipmanage.controller
* @ClassName: VideoImportantEquipmentController
* @Author: Jianqiang Gao
* @Description: VideoImportantEquipmentController
* @Date: 2022/6/16 10:24
* @Version: 1.0
*/
@RestController
@Api(tags = "视屏监控关联重点设备Api")
@Slf4j
@RequestMapping(value = "/videoImportantEquipment", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class VideoImportantEquipmentController {
@Autowired
private IVideoImportantEquipmentService videoImportantEquipmentService;
@RequestMapping(value = "/getVideoImportantEquipmentList", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取视屏监控关联重点设备集合", notes = "获取视屏监控关联重点设备集合")
public List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(@RequestParam(required = false) Long importantEquipmentId) {
Map<String, Object> map = null;
if (importantEquipmentId != null) {
map = new HashMap<>();
map.put("importantEquipmentId", importantEquipmentId);
}
return videoImportantEquipmentService.getVideoImportantEquipmentList(map);
}
}
\ No newline at end of file
...@@ -2,8 +2,12 @@ package com.yeejoin.equipmanage.mapper; ...@@ -2,8 +2,12 @@ package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment; import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment;
import com.yeejoin.equipmanage.common.vo.VideoImportantEquipmentVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/** /**
* @author ZeHua Li * @author ZeHua Li
* @date 2020/11/25 15:48 * @date 2020/11/25 15:48
...@@ -11,4 +15,5 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -11,4 +15,5 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface VideoImportantEquipmentMapper extends BaseMapper<VideoImportantEquipment> { public interface VideoImportantEquipmentMapper extends BaseMapper<VideoImportantEquipment> {
List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(Map<String, Object> map);
} }
...@@ -2,6 +2,10 @@ package com.yeejoin.equipmanage.service; ...@@ -2,6 +2,10 @@ package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment; import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment;
import com.yeejoin.equipmanage.common.vo.VideoImportantEquipmentVo;
import java.util.List;
import java.util.Map;
/** /**
* @author ZeHua Li * @author ZeHua Li
...@@ -9,4 +13,5 @@ import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment; ...@@ -9,4 +13,5 @@ import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment;
* @since v2.0 * @since v2.0
*/ */
public interface IVideoImportantEquipmentService extends IService<VideoImportantEquipment> { public interface IVideoImportantEquipmentService extends IService<VideoImportantEquipment> {
List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(Map<String, Object> map);
} }
...@@ -2,10 +2,15 @@ package com.yeejoin.equipmanage.service.impl; ...@@ -2,10 +2,15 @@ package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment; import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment;
import com.yeejoin.equipmanage.common.vo.VideoImportantEquipmentVo;
import com.yeejoin.equipmanage.mapper.VideoImportantEquipmentMapper; import com.yeejoin.equipmanage.mapper.VideoImportantEquipmentMapper;
import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService; import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/** /**
* @author ZeHua Li * @author ZeHua Li
* @date 2020/11/25 15:49 * @date 2020/11/25 15:49
...@@ -13,4 +18,12 @@ import org.springframework.stereotype.Service; ...@@ -13,4 +18,12 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class VideoImportantEquipmentServiceImpl extends ServiceImpl<VideoImportantEquipmentMapper,VideoImportantEquipment> implements IVideoImportantEquipmentService { public class VideoImportantEquipmentServiceImpl extends ServiceImpl<VideoImportantEquipmentMapper,VideoImportantEquipment> implements IVideoImportantEquipmentService {
@Autowired
private VideoImportantEquipmentMapper videoImportantEquipmentMapper;
@Override
public List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(Map<String, Object> map) {
return videoImportantEquipmentMapper.getVideoImportantEquipmentList(map);
}
} }
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.equipmanage.mapper.VideoImportantEquipmentMapper">
<select id="getVideoImportantEquipmentList"
resultType="com.yeejoin.equipmanage.common.vo.VideoImportantEquipmentVo" parameterType="java.util.Map">
SELECT
v.id AS videoId,
v.`name`,
v.`code`,
v.type_code,
v.type,
v.url,
v.img,
v.address,
vie.important_equipment_id
FROM
wl_video v
LEFT JOIN wl_video_important_equipment vie ON v.id = vie.video_id
<where>
<if test="importantEquipmentId != null">
vie.important_equipment_id = #{importantEquipmentId}
</if>
</where>
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment