当前位置:网站首页>How to deal with the start and end times in mybatics
How to deal with the start and end times in mybatics
2022-07-24 16:01:00 【ZHZHK001】
About mybatics How to deal with the start and end times in
About mybatics How to deal with the start and end times in
2020 year 3 month 30 Japanese original
The data we get from the front end is :
ORDER_DATE_START : 2010-10-10 Starting time
ORDER_DATE_END :2019-11-11 End time
The filter range we need to obtain is
ORDER_DATE Greater than or equal to ORDER_DATE_START And less than or equal to ORDER_DATE_END Result
Handle :
Start time processing :
Starting time to_date(#{ORDER_DATE_START},‘yyyy-mm-dd’) after , The content becomes 2010-10-10 00:00:00
End time processing :
End time TO_DATE(#{ORDER_DATE_END} || ’ 23:59:59’, ‘yyyy-MM-dd HH24:mi:ss’) after , The content becomes 2019-11-11 23:59:59
That is, end time use “||” Splicing “ 23:59:59”, Be careful 23:59:59 There used to be a half width space
The meaning of the processed statement is :
Greater than or equal to the start date 00:00:00, Less than or equal to the end date 23:59:59
Knowledge points used :
|| String splicing
to_date(), Note that the format before and after is different ‘yyyy-mm-dd’ ‘yyyy-MM-dd HH24:mi:ss’
<!-- lookup -->
<select id="listOrderDetail" parameterType = "map" resultType="map" >
SELECT O.ORDER_DATE FROM K_ORDER O WHERE 1=1
<if test="ORDER_DATE_START != null and ORDER_DATE_START != ''">
AND O.ORDER_DATE >= to_date(#{ORDER_DATE_START},'yyyy-mm-dd')
</if>
<if test="ORDER_DATE_END != null and ORDER_DATE_END != ''">
AND O.ORDER_DATE <= TO_DATE(#{ORDER_DATE_END} || ' 23:59:59', 'yyyy-MM-dd HH24:mi:ss')
</if>
</select>
边栏推荐
- Vscode common shortcut keys
- Is it safe for Anxin securities to open an account on mobile phone?
- 【洛谷】P1908 逆序对
- G026-db-gs-ins-03 openeuler deployment opengauss (1 active and 2 standby or multiple standby)
- PHP中array_merge的坑
- 未来数据库需要关心的硬核创新
- Dynamics 365: how to get the threshold value of executemullerequest in batch requests
- 栈与队列——1047. 删除字符串中的所有相邻重复项
- Memcache cache application (lnmp+memcache)
- 105 constructing binary trees from preorder and inorder traversal sequences
猜你喜欢

105 constructing binary trees from preorder and inorder traversal sequences

城市安全系列科普丨进入溺水高发期,救生常识话你知

做完数据治理,质量依旧很差

Parse string

Who is the "roll" king of the prefabricated vegetable track?

Machine learning notes - building a recommendation system (5) feedforward neural network for collaborative filtering

yolov4 训练自己的数据集

C# TCP客户端窗体应用程序异步接收方式

【SWT】滚动容器实现商品列表样式

JUC source code learning note 3 - AQS waiting queue and cyclicbarrier, BlockingQueue
随机推荐
Small list of iptables common commands
3、 Set foundation ArrayList set and simple student management system
Netease email (126/163): authorization code acquisition strategy
MySQL source code analysis -- data structure of index
Simplified understanding: publish and subscribe
124 maximum path sum in binary tree
memcache缓存应用(LNMP+memcache)
Is it safe for Anxin securities to open an account on mobile phone?
Will the capital market be optimistic about TCL's folding screen story?
栈与队列——1047. 删除字符串中的所有相邻重复项
LaneATT
Code shoe set - mt2093 · palindrome digit
C# TCP客户端窗体应用程序异步接收方式
R language ggplot2 visualization: ggplot2 visualization basic scatter plot, through in theme_ Specify the parameter base in BW_ Size to change the size of axis labels and control the size of gridlines
LaneATT
Dynamics crm: how to set the order of forms
Yolo5face: why reinvent the face detector
Varnish4.0缓存代理配置
矩阵的秩和图像的秩的一些了解
Public and private key transmission, and understanding of CA certificate