日期和时间范围区间怎么查询
<el-date-picker
v-model="value1"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
if(this. value1===null){
this.queryParams.beginTime=''
this.queryParams.endTime=''
}else {
this.queryParams.beginTime=this. value1 [0]
this.queryParams.endTime=this. value1 [1]
}
传递后台Mybatis中.xml
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
and alarm_time BETWEEN to_timestamp(#{beginTime},'yyyy-MM-dd hh24:mi:ss') AND to_timestamp(#{endTime},'yyyy-MM-dd hh24:mi:ss')
</if>