Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
iClear-Connect-Pre-Clearance
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
zelong.shao
2024-12-23 16:23:26 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7c3b036a66d2523910a9d5dc53566ad1ebba1350
7c3b036a
1 parent
da3b49f6
customer|查询调整
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
server/biz-customer/src/main/java/com/fedex/connect/customer/data/query/ConsignmentQuery.java
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/mapper/ConsignmentExtMapper.xml
server/biz-customer/src/main/java/com/fedex/connect/customer/data/query/ConsignmentQuery.java
View file @
7c3b036
package
com
.
fedex
.
connect
.
customer
.
data
.
query
;
import
com.fedex.connect.common.dependencies.util.DateUtil
;
import
com.fedex.connect.common.dependencies.util.Utils
;
import
com.fedex.connect.customer.data.PageBase
;
import
lombok.Data
;
import
org.springframework.util.CollectionUtils
;
import
java.time.LocalDate
;
import
java.time.ZoneId
;
import
java.util.Date
;
import
java.time.format.DateTimeFormatter
;
import
java.util.List
;
/**
...
...
@@ -28,11 +26,20 @@ public class ConsignmentQuery extends PageBase {
query
.
setCreateTimeFrom
(
null
);
query
.
setCreateTimeTo
(
null
);
}
//如果没有输入查询条件,则默认查三天的数据
if
(
CollectionUtils
.
isEmpty
(
query
.
getConsignmentCodeList
())
&&
Utils
.
isEmpty
(
query
.
getConsignmentCode
())){
if
(
Utils
.
isEmpty
(
query
.
getCreateTimeFrom
())
&&
Utils
.
isEmpty
(
query
.
getCreateTimeTo
()))
{
// 获取当前日期,减去3天
LocalDate
localDate
=
LocalDate
.
now
().
minusDays
(
3
);
query
.
setCreateTimeFrom
(
DateUtil
.
timeFormat
(
Date
.
from
(
localDate
.
atStartOfDay
(
ZoneId
.
systemDefault
()).
toInstant
())));
query
.
setCreateTimeTo
(
DateUtil
.
timeFormat
(
new
Date
()));
// 设置 createTimeFrom 为 3 天前的日期(不带时分秒)
String
createTimeFrom
=
localDate
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
query
.
setCreateTimeFrom
(
createTimeFrom
);
// 获取当前日期(不带时分秒)
LocalDate
currentDate
=
LocalDate
.
now
();
// 设置 createTimeTo 为今天的日期(不带时分秒)
String
createTimeTo
=
currentDate
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
query
.
setCreateTimeTo
(
createTimeTo
);
}
query
.
setStart
(
query
.
getStart
());
return
query
;
...
...
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/mapper/ConsignmentExtMapper.xml
View file @
7c3b036
...
...
@@ -51,10 +51,10 @@
AND c.STATUS_CODE = #{statusCode}
</if>
<if
test=
"createTimeFrom != null and createTimeFrom != ''"
>
AND c.CREATE_TIME
>
= TO_DATE(#{createTimeFrom}
, 'YYYY-MM-DD HH24:MI:SS')
AND c.CREATE_TIME
>
TO_DATE(#{createTimeFrom} || ' 00:00:00'
, 'YYYY-MM-DD HH24:MI:SS')
</if>
<if
test=
"createTimeTo != null and createTimeTo != ''"
>
AND c.CREATE_TIME
<
= TO_DATE(#{createTimeTo}
, 'YYYY-MM-DD HH24:MI:SS')
AND c.CREATE_TIME
<
TO_DATE(#{createTimeTo} || ' 23:59:59'
, 'YYYY-MM-DD HH24:MI:SS')
</if>
<if
test=
"consignmentCodeList != null and consignmentCodeList.size() != 0"
>
AND c.CONSIGNMENT_CODE IN
...
...
@@ -77,10 +77,10 @@
OR c.user_uuid = #{uuid,jdbcType=VARCHAR}
)
<if
test=
"createTimeFrom != null and createTimeFrom != ''"
>
AND c.CREATE_TIME
>
= TO_DATE(#{createTimeFrom}
, 'YYYY-MM-DD HH24:MI:SS')
AND c.CREATE_TIME
>
TO_DATE(#{createTimeFrom} || ' 00:00:00'
, 'YYYY-MM-DD HH24:MI:SS')
</if>
<if
test=
"createTimeTo != null and createTimeTo != ''"
>
AND c.CREATE_TIME
<
= TO_DATE(#{createTimeTo}
, 'YYYY-MM-DD HH24:MI:SS')
AND c.CREATE_TIME
<
TO_DATE(#{createTimeTo} || ' 23:59:59'
, 'YYYY-MM-DD HH24:MI:SS')
</if>
<if
test=
"consignmentCodeList != null and consignmentCodeList.size() != 0"
>
AND c.CONSIGNMENT_CODE IN
...
...
@@ -92,4 +92,5 @@
</mapper>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment