添加aiid分页查询条件;

119分页接口添加日志
wushunjie
吴顺杰 2 months ago
parent cb5fdf5676
commit 3a38a3eb9b

@ -105,5 +105,11 @@ public class AlarmFindRequest implements Serializable {
* 1ai120Id 2ai120Id
*/
@ApiModelProperty(value = "前端选择框 1查询ai120Id不为空的 2查询ai120Id为空的")
private Integer selectIsNull;
private Integer select120;
/**
* 1ai119Id 2ai119Id
*/
@ApiModelProperty(value = "前端选择框 1查询ai120Id不为空的 2查询ai120Id为空的")
private Integer select119;
}

@ -117,6 +117,12 @@ public class EventPageRequest implements Serializable {
* 1ai110Id 2ai110Id
*/
@ApiModelProperty(value = "前端选择框 1查询ai110Id不为空的 2查询ai110Id为空的")
private Integer selectIsNull;
private Integer select110;
/**
* 1ai119Id 2ai119Id
*/
@ApiModelProperty(value = "前端选择框 1查询ai119Id不为空的 2查询ai119Id为空的")
private Integer select119;
}

@ -54,4 +54,16 @@ public class FireFindRequest implements Serializable {
*/
@ApiModelProperty(value = "案发地址")
private String afdz;
/**
* 1ai120Id 2ai120Id
*/
@ApiModelProperty(value = "前端选择框 1查询ai120Id不为空的 2查询ai120Id为空的")
private Integer select120;
/**
* 1ai110Id 2ai110Id
*/
@ApiModelProperty(value = "前端选择框 1查询ai110Id不为空的 2查询ai110Id为空的")
private Integer select110;
}

@ -35,7 +35,26 @@ public class FireServiceImpl extends ServiceImpl<FireMapper, Fire> implements Fi
.like(StrUtil.isNotEmpty(fire.getAjms()), "ajms", fire.getAjms())
.like(StrUtil.isNotEmpty(fire.getAfdz()), "afdz", fire.getAfdz())
.orderByDesc("create_time");
addCondition(fire.getSelect110(), "ai_110_id", wrapper);
addCondition(fire.getSelect120(), "ai_120_id", wrapper);
return this.page(page, wrapper);
}
/**
* wrapper
*
* @param key
* @param selectKey
* @param wrapper wrapper
*/
private void addCondition(Integer key, String selectKey, QueryWrapper<Fire> wrapper) {
if (key != null) {
if (key == 1) {
wrapper.and(wq -> wq.isNotNull(selectKey).and(q -> q.ne(selectKey, "")));
} else if (key == 2) {
wrapper.and(wq -> wq.isNull(selectKey).or(q -> q.eq(selectKey, "")));
}
}
}
}

@ -165,12 +165,20 @@
<if test="req.aiNumMax != null ">
and ai_num &lt;= #{req.aiNumMax}
</if>
<if test="req.selectIsNull == 1 ">
<if test="req.select120 == 1 ">
and ai_120_id is not null and ai_120_id != ''
</if>
<if test="req.selectIsNull == 2 ">
<if test="req.select120 == 2 ">
and ai_120_id is null or ai_120_id = ''
</if>
<if test="req.select119 == 1 ">
and ai_119_id is not null and ai_119_id != ''
</if>
<if test="req.select119 == 2 ">
and ai_119_id is null or ai_119_id = ''
</if>
</where>
order by update_time desc
</select>

@ -105,12 +105,19 @@
<if test="event.alarmUnitTelephone != null and event.alarmUnitTelephone !=''">
AND alarm_unit_telephone LIKE CONCAT('%', #{event.alarmUnitTelephone}, '%')
</if>
<if test="event.selectIsNull == 1 ">
<if test="event.select110 == 1 ">
and ai_110_id is not null and ai_110_id != ''
</if>
<if test="event.selectIsNull == 2 ">
<if test="event.select110 == 2 ">
and ai_110_id is null or ai_110_id = ''
</if>
<if test="event.select119 == 1 ">
and ai_119_id is not null and ai_119_id != ''
</if>
<if test="event.select119 == 2 ">
and ai_119_id is null or ai_119_id = ''
</if>
</where>
order by event_date_time desc
</select>

@ -3,7 +3,7 @@ spring:
datasource:
url: jdbc:mysql://localhost:3306/algorithms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: jichuang@123
password: 123456
driverClassName: com.mysql.cj.jdbc.Driver

@ -1,6 +1,7 @@
package com.yingji.service.impl;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -28,13 +29,21 @@ public class FireServiceImpl extends ServiceImpl<FireMapper, Fire> implements Fi
*/
@Override
public Page<Fire> page(Page<Fire> page, FireFindRequest fire) {
log.error("==================119入参开始=====================");
log.error("==================119每页显示条数: " + page.getSize() + "页数: " + page.getCurrent() + "=====================");
log.error(JSONUtil.toJsonStr(fire));
log.error("==================119入参结束=====================");
QueryWrapper<Fire> wrapper = new QueryWrapper<>();
wrapper.like(StrUtil.isNotEmpty(fire.getAjbh()), "ajbh", fire.getAjbh())
.ge(fire.getStartTime() != null, "create_time", fire.getStartTime())
.le(fire.getEndTime() != null, "create_time", fire.getEndTime())
.like(StrUtil.isNotEmpty(fire.getAjms()), "ajms", fire.getAjms())
.like(StrUtil.isNotEmpty(fire.getAfdz()), "afdz", fire.getAfdz());
return this.page(page, wrapper);
Page<Fire> firePage = this.page(page, wrapper);
log.error("==================119响应开始=====================");
log.error(JSONUtil.toJsonStr(firePage));
log.error("==================119响应结束=====================");
return firePage;
}
}

Loading…
Cancel
Save