Commit 108d313e authored by taabe's avatar taabe

交接班-接警情况接口修改

parent 9679e4ca
......@@ -14,5 +14,12 @@ import java.util.Map;
*/
public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
/**
* 接警情况统计-交接班用
*
* @param beginDate
* @param endDate
* @return
*/
Map<String, Integer> queryAlertStatusCount(@Param("beginDate") String beginDate, @Param("endDate") String endDate);
}
......@@ -9,7 +9,12 @@
sum( CASE WHEN alert_type_code = 230 THEN 1 ELSE 0 END ) majorAlertCount
FROM
jc_alert_called
WHERE
call_time BETWEEN #{beginDate} AND #{endDate}
WHERE 1 = 1
<if test="beginDate != null and beginDate != ''">
and call_time >= #{beginDate}
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> #{endDate}
</if>
</select>
</mapper>
......@@ -42,7 +42,7 @@
<if test="params != null and params.size > 0 ">
where 1=1
<foreach collection="params" index="key" item="value">
<if test="key != null and key == 'beginDate'">
<if test="key != null and key == 'beginDate' and value != null and value != ''">
and d.recDate >= #{value}
</if>
<if test="key != null and key == 'endDate'">
......
......@@ -303,7 +303,7 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/dateRange/list")
@ApiOperation(httpMethod = "GET", value = "查询指定日期内警情列表", notes = "查询指定日期内警情列表")
public ResponseModel<Map<String, Object>> listByDateRange(@RequestParam("beginDate") String beginDate,
public ResponseModel<Map<String, Object>> listByDateRange(@RequestParam(value = "beginDate", required = false) String beginDate,
@RequestParam("endDate") String endDate) {
return ResponseHelper.buildResponse(iAlertCalledService.getAlertInfoList(beginDate, endDate));
}
......
......@@ -185,8 +185,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
*/
public List<Map<String, Object>> listByDateRange(String beginDate, String endDate) {
// 查询指定日期内的警情列表
List<AlertCalled> alertCalledList =
this.list(new LambdaQueryWrapper<AlertCalled>().between(AlertCalled::getCallTime, beginDate, endDate));
this.list(new LambdaQueryWrapper<AlertCalled>().apply(!ValidationUtil.isEmpty(beginDate),
"call_time >= " + beginDate).le(true, AlertCalled::getCallTime, endDate));
Map<String, String> queryParams = Maps.newHashMap();
queryParams.put("beginDate", beginDate);
queryParams.put("endDate", endDate);
......@@ -196,8 +198,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
alertCalledList.stream().collect(Collectors.groupingBy(AlertCalled::getAlertTypeCode));
Map<Long, AlertCalled> calledMap =
alertCalledList.stream().collect(Collectors.toMap(AlertCalled::getSequenceNbr, Function.identity()));
alertCalledMap.forEach((alert, list) -> {
allList.addAll(iAlertFormValueService.listAll(alert, queryParams));
alertCalledMap.forEach((alertTypeCode, list) -> {
allList.addAll(iAlertFormValueService.listAll(alertTypeCode, queryParams));
});
allList.forEach(i -> {
......
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