创建时间范围

wushunjie
杜函宇 11 months ago
parent 89b2af4fee
commit 7a5cf61493

@ -56,6 +56,7 @@ public class FireController extends BaseController {
* *
* @param id * @param id
* @return * @return
*
*/ */
@GetMapping("{id}") @GetMapping("{id}")
@ApiOperation(value = "通过主键查询单条119数据", response = Fire.class) @ApiOperation(value = "通过主键查询单条119数据", response = Fire.class)

@ -22,21 +22,37 @@ public class AlarmFindRequest implements Serializable {
private static final long serialVersionUID = 5773800327954649047L; private static final long serialVersionUID = 5773800327954649047L;
/** /**
* *
*/ */
@ApiModelProperty("开始时间") @ApiModelProperty("报警时间开始时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime startTime; private LocalDateTime startTime;
/** /**
* *
*/ */
@ApiModelProperty("结束时间") @ApiModelProperty("报警时间结束时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime; private LocalDateTime endTime;
/**
*
*/
@ApiModelProperty("创建时间开始时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createStartTime;
/**
*
*/
@ApiModelProperty("创建时间结束时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createEndTime;
/** /**
* *
*/ */

@ -51,10 +51,26 @@ public class EventPageRequest implements Serializable {
/** /**
* *
*/ */
@ApiModelProperty(value = "事发开始时间") @ApiModelProperty(value = "事发结束时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime; private LocalDateTime endTime;
/**
*
*/
@ApiModelProperty(value = "创建时间开始时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createStartTime;
/**
*
*/
@ApiModelProperty(value = "创建时间结束时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createEndTime;
/** /**
* () * ()
*/ */

@ -87,6 +87,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAlarmList" resultType="com.ruoyi.page.domain.Alarm"> <select id="selectAlarmList" resultType="com.ruoyi.page.domain.Alarm">
select * from alarm select * from alarm
<where> <where>
<if test="req.createStartTime != null ">
create_time &gt;= #{req.createStartTime}
</if>
<if test="req.createEndTime != null ">
and create_time &lt;= #{req.createEndTime}
</if>
<if test="req.startTime != null "> <if test="req.startTime != null ">
emergency_event_time &gt;= #{req.startTime} emergency_event_time &gt;= #{req.startTime}
</if> </if>

@ -72,6 +72,12 @@
SELECT * SELECT *
FROM event FROM event
<where> <where>
<if test="event.createStartTime != null">
AND create_time &gt;= #{event.createStartTime}
</if>
<if test="event.createEndTime != null">
AND create_time &lt;= #{event.createEndTime}
</if>
<if test="event.eventType != '转院'"> <if test="event.eventType != '转院'">
AND event_type != '转院' AND event_type != '转院'
</if> </if>

Loading…
Cancel
Save