Commit bfe029df authored by tangwei's avatar tangwei

增加历史警情

parent 90252bd2
......@@ -33,4 +33,7 @@ public class RequestData {
@ApiModelProperty(value = "灾情地址模糊匹配")
private String address;
@ApiModelProperty(value = "灾情状态")
private int status =0;
}
......@@ -27,7 +27,9 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
*/
Map<String, Integer> queryAlertStatusCount(@Param("beginDate") String beginDate, @Param("endDate") String endDate);
List<AlertCalledZhDto> alertCalledListByAlertStatus(@Param("par")RequestData par);
List<AlertCalledZhDto> alertCalledListByAlertStatus(@Param("pageNum")Integer pageNum, @Param("pageSize")Integer pageSize,@Param("par")RequestData par);
int alertCalledListByAlertStatusCount(@Param("par")RequestData par);
Integer AlertCalledcountTime(@Param("type")int type);
......
......@@ -30,7 +30,9 @@ public interface IAlertCalledService {
*
* **/
List<AlertCalledZhDto> alertCalledListByAlertStatus(RequestData par);
List<AlertCalledZhDto> alertCalledListByAlertStatus(Integer pageNum, Integer pageSize,RequestData par);
int alertCalledListByAlertStatusCount(RequestData par);
/**
*
......
......@@ -39,21 +39,50 @@
WHEN '245' THEN '三级'
ELSE '' END responseLevelCode
FROM jc_alert_called a
where a.alert_status =0
AND a.is_delete=0
where a.is_delete=0
AND a.coordinate_x IS NOT NULL
AND a.coordinate_y IS NOT NULL
<if test='par.address!=null'>
<if test='par.status==0'>
and a.alert_status =0
</if>
<if test='par.status==1'>
and a.alert_status =1
</if>
<if test='par.address!=null and par.address!="" '>
and a.address like CONCAT('%',#{par.address},'%')
</if>
<if test='par.whether24!=false'>
and a.call_time &gt;= (NOW() - interval 24 hour)
</if>
ORDER BY
a.call_time DESC
ORDER BY a.call_time DESC
<if test='pageNum!=null and pageSize !=null'>
limit #{pageNum},#{pageSize}
</if>
</select>
<select id="alertCalledListByAlertStatusCount" resultType="Integer">
SELECT
COUNT(*)
FROM jc_alert_called a
where a.is_delete=0
AND a.coordinate_x IS NOT NULL
AND a.coordinate_y IS NOT NULL
<if test='par.status==0'>
and a.alert_status =0
</if>
<if test='par.status==1'>
and a.alert_status =1
</if>
<if test='par.address!=null and par.address!="" '>
and a.address like CONCAT('%',#{par.address},'%')
</if>
<if test='par.whether24!=false'>
and a.call_time &gt;= (NOW() - interval 24 hour)
</if>
</select>
<select id="AlertCalledcountTime" resultType="Integer">
......
......@@ -132,10 +132,35 @@ public class CommandController extends BaseController {
@GetMapping(value = "JQ/list")
@ApiOperation(httpMethod = "GET", value = "警情列表查询", notes = "警情列表查询")
public ResponseModel<Object> listPage(RequestData par) {
List<AlertCalledZhDto> list= iAlertCalledService.alertCalledListByAlertStatus(par);
par.setStatus(0);
List<AlertCalledZhDto> list= iAlertCalledService.alertCalledListByAlertStatus(null,null,par);
return ResponseHelper.buildResponse(list);
}
/**
* 分页警情列表
*
* @return
*/
@TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "history/list")
@ApiOperation(httpMethod = "GET", value = "警情列表查询", notes = "警情列表查询")
public ResponseModel<Page<AlertCalledZhDto>> listhistoryPage(Integer pageNum, Integer pageSize,RequestData par) {
par.setStatus(1);
if (null == pageNum || null == pageSize) {
pageNum = 1;
pageSize = Integer.MAX_VALUE;
} else {
pageNum = (pageNum - 1) * pageSize;
}
List<AlertCalledZhDto> list= iAlertCalledService.alertCalledListByAlertStatus( pageNum, pageSize,par);
Page<AlertCalledZhDto> pageBean = new Page<>(pageNum, pageSize);
Integer num= iAlertCalledService.alertCalledListByAlertStatusCount(par);
pageBean.setRecords(list);
pageBean.setTotal(num);
return ResponseHelper.buildResponse(pageBean);
}
/**
* 保卫目标分页查询
......@@ -394,7 +419,7 @@ public class CommandController extends BaseController {
public ResponseModel<Object> seismometeorology()throws Exception {
RequestData requestData = new RequestData();
requestData.setWhether24(true);
List<AlertCalledZhDto> list= iAlertCalledService.alertCalledListByAlertStatus(requestData);
List<AlertCalledZhDto> list= iAlertCalledService.alertCalledListByAlertStatus(null,null,requestData);
List<SeismometeorologyDto> li= seismometeorologyDtoDao.findCarStateByWatchSn();
//数据组装
for (AlertCalledZhDto alertCalledZhDto : list) {
......
......@@ -86,12 +86,18 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
*
* **/
@Override
public List<AlertCalledZhDto> alertCalledListByAlertStatus( RequestData par) {
public List<AlertCalledZhDto> alertCalledListByAlertStatus( Integer pageNum, Integer pageSize,RequestData par) {
List<AlertCalledZhDto> list = alertCalledMapper.alertCalledListByAlertStatus(par);
List<AlertCalledZhDto> list = alertCalledMapper.alertCalledListByAlertStatus( pageNum, pageSize,par);
return list;
}
@Override
public int alertCalledListByAlertStatusCount(RequestData par) {
return alertCalledMapper.alertCalledListByAlertStatusCount(par);
}
/**
*
* 根据灾情id 查询灾情详情
......
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