Commit 1651d36d authored by chenzhao's avatar chenzhao

修改视频推送接口

parent 32537375
......@@ -241,10 +241,10 @@ public interface EquipFeignClient {
@RequestParam("latitude") Double latitude,
@RequestParam("distance") Double distance);
@RequestMapping(value = "/video/pageVideoByAlertType", method = RequestMethod.GET)
@RequestMapping(value = "/video/pageVideoByAlertType", method = RequestMethod.POST)
ResponseModel<Page<Map<String, Object>>> pageVideoByAlertType(@RequestParam("pageNum") Integer pageNum,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("par") RequestData par);
@RequestBody RequestData par);
@RequestMapping(value = "/video/pageList", method = RequestMethod.GET)
......
......@@ -50,4 +50,20 @@ public class RequestData {
@ApiModelProperty(value = "排序")
private String orderTime;
@ApiModelProperty(value = "筛选条件-建筑Id")
private String buildingId;
@ApiModelProperty(value = "筛选条件-视频类型")
private String type;
@ApiModelProperty(value = "筛选条件-视频编码")
private String code;
@ApiModelProperty(value = "筛选条件-视频名称")
private String remark;
@ApiModelProperty(value = "筛选条件-所属单位")
private String bizOrgCode;
}
\ No newline at end of file
......@@ -379,9 +379,9 @@ public class CommandController extends BaseController {
}
ResponseModel<Page<Map<String, Object>>> data = null;
if (ValidationUtil.isEmpty(par.getLatitudeTwo()) ){
data = equipFeignClient.getVideopag(pageNum == 0 ? "1" : pageNum.toString(), pageSize.toString(),par.getBuildingId(),par.getCode(),null,par.getBizOrgCode(),par.getType());
data = equipFeignClient.getVideopag(pageNum == 1 ? "0" : String.valueOf(pageNum * pageSize), pageSize.toString(),par.getBuildingId(),par.getCode(),null,par.getBizOrgCode(),par.getType());
}else {
data = equipFeignClient.pageVideoByAlertType(pageNum == 0 ? 1 : pageNum, pageSize, par);
data = equipFeignClient.pageVideoByAlertType( pageNum, pageSize, par);
}
......
......@@ -203,11 +203,10 @@ public class VideoController extends AbstractBaseController {
*
* @return
*/
@RequestMapping(value = "/pageVideoByAlertType", method = RequestMethod.GET)
@RequestMapping(value = "/pageVideoByAlertType", method = RequestMethod.POST)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "视频分页资源查询", notes = "视频分页资源查询")
public ResponseModel<Page<VideoListVo>> pageVideoByAlertType(Integer pageNum, Integer pageSize, RequestData par) {
@ApiOperation(httpMethod = "POST", value = "视频分页资源查询", notes = "视频分页资源查询")
public ResponseModel<Page<VideoListVo>> pageVideoByAlertType(Integer pageNum, Integer pageSize, @RequestBody RequestData par) {
if (null == pageNum || null == pageSize) {
pageNum = 1;
pageSize = Integer.MAX_VALUE;
......
......@@ -362,6 +362,7 @@
a.*
FROM
(
<if test='par.longitude!=null and par.latitude!=null '>
SELECT
wle.id ,
wle.`code` ,
......@@ -371,25 +372,27 @@
wle.`name` ,
wle.address ,
wle.longitude,
<if test='longitude!=null and latitude!=null '>
Round(st_distance(point(wle.longitude,wle.latitude),point(#{longitude},#{latitude}))*111195,1) AS distance,
</if>
wle.latitude
FROM wl_video wle
where wle.longitude is not null and wle.latitude is not null
<if test='longitude!=null and latitude!=null and distance!=null'>
<if test='par.longitude!=null and par.latitude!=null and distance!=null'>
and distance &lt;= #{distance}
</if>
<if test='type!=null and type!="" '>
<if test='par.type!=null and par.type!="" '>
wle.type = #{type}
</if>
<if test='remake !=null and remake!="" '>
wle.remake like concat ('%',#{remake},'%')
<if test='par.remark!=null and par.remark!="" '>
wle.remake like concat ('%',#{par.remake},'%')
</if>
<if test='code!=null and code!="" '>
wle.code like concat ('%',#{code},'%')
<if test='par.code!=null and par.code!="" '>
wle.code like concat ('%',#{par.code},'%')
</if>
</if>
<if test="par.longitudeTwo != null and par.longitude != null">
UNION
</if>
<if test='par.longitudeTwo !=null and par.latitudeTwo !=null '>
SELECT
wle.id,
wle.`code`,
......@@ -399,33 +402,34 @@
wle.`name`,
wle.address,
wle.longitude,
<if test='longitudeTwo!=null and latitudeTwo!=null '>Round(
Round(
st_distance (
point ( wle.longitude, wle.latitude ),
point (#{longitudeTwo},#{latitudeTwo} ) ) * 111195, 1 ) AS distance,
</if>
point (#{par.longitudeTwo},#{par.latitudeTwo} ) ) * 111195, 1 ) AS distance,
wle.latitude
FROM
wl_video wle
WHERE
wle.longitude IS NOT NULL
AND wle.latitude IS NOT NULL
<if test='longitudeTwo!=null and latitude!=null and distance!=null'>
<if test='par.longitudeTwo!=null and par.latitude!=null and distance!=null'>
AND distance &lt;= #{distance}
</if>
<if test='type!=null and type!="" '>
wle.type = #{type}
<if test='par.type!=null and par.type!="" '>
wle.type = #{par.type}
</if>
<if test='remake !=null and remake!="" '>
wle.remake like concat ('%',#{remake},'%')
<if test='par.remark!=null and par.remark!="" '>
wle.remake like concat ('%',#{par.remark},'%')
</if>
<if test='code!=null and code!="" '>
wle.code like concat ('%',#{code},'%')
<if test='par.code!=null and par.code!="" '>
wle.code like concat ('%',#{par.code},'%')
</if>
<if test='longitudeTwo !=null and latitudeTwo !=null '>
<if test='par.longitudeTwo !=null and par.latitudeTwo!=null '>
ORDER BY
distance
</if>
</if>
) AS a
limit #{pageNum},#{pageSize}
</select>
......@@ -433,9 +437,10 @@
<select id="VideoListByAlertCount" resultType="int">
SELECT
count(a.*)
count(a.id)
FROM
(
<if test='par.longitude!=null and par.latitude!=null '>
SELECT
wle.id ,
wle.`code` ,
......@@ -445,25 +450,27 @@
wle.`name` ,
wle.address ,
wle.longitude,
<if test='longitude!=null and latitude!=null '>
Round(st_distance(point(wle.longitude,wle.latitude),point(#{longitude},#{latitude}))*111195,1) AS distance,
wle.latitude
FROM wl_video wle
where wle.longitude is not null and wle.latitude is not null
<if test='par.longitude!=null and par.latitude!=null and distance!=null'>
and distance &lt;= #{distance}
</if>
<if test='type!=null and type!="" '>
<if test='par.type!=null and par.type!="" '>
wle.type = #{type}
</if>
<if test='remake !=null and remake!="" '>
wle.remake like concat ('%',#{remake},'%')
<if test='par.remark!=null and par.remark!="" '>
wle.remake like concat ('%',#{par.remake},'%')
</if>
<if test='code!=null and code!="" '>
wle.code like concat ('%',#{code},'%')
<if test='par.code!=null and par.code!="" '>
wle.code like concat ('%',#{par.code},'%')
</if>
wle.latitude
FROM wl_video wle
where wle.longitude is not null and wle.latitude is not null
<if test='longitude!=null and latitude!=null and distance!=null'>
and distance &lt;= #{distance}
</if>
<if test="par.longitudeTwo != null and par.longitude != null">
UNION
</if>
<if test='par.longitudeTwo !=null and par.latitudeTwo !=null '>
SELECT
wle.id,
wle.`code`,
......@@ -473,33 +480,34 @@
wle.`name`,
wle.address,
wle.longitude,
<if test='longitudeTwo!=null and latitudeTwo!=null '>Round(
Round(
st_distance (
point ( wle.longitude, wle.latitude ),
point (#{longitudeTwo},#{latitudeTwo} ) ) * 111195, 1 ) AS distance,
</if>
point (#{par.longitudeTwo},#{par.latitudeTwo} ) ) * 111195, 1 ) AS distance,
wle.latitude
FROM
wl_video wle
WHERE
wle.longitude IS NOT NULL
AND wle.latitude IS NOT NULL
<if test='longitudeTwo!=null and latitude!=null and distance!=null'>
<if test='par.longitudeTwo!=null and par.latitude!=null and distance!=null'>
AND distance &lt;= #{distance}
</if>
<if test='type!=null and type!="" '>
wle.type = #{type}
<if test='par.type!=null and par.type!="" '>
wle.type = #{par.type}
</if>
<if test='remake !=null and remake!="" '>
wle.remake like concat ('%',#{remake},'%')
<if test='par.remark!=null and par.remark!="" '>
wle.remake like concat ('%',#{par.remark},'%')
</if>
<if test='code!=null and code!="" '>
wle.code like concat ('%',#{code},'%')
<if test='par.code!=null and par.code!="" '>
wle.code like concat ('%',#{par.code},'%')
</if>
<if test='longitudeTwo !=null and latitudeTwo !=null '>
<if test='par.longitudeTwo !=null and par.latitudeTwo!=null '>
ORDER BY
distance
</if>
</if>
) AS a
</select>
......
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