Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
usedCarAuction
/
aus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f6badbca
authored
Apr 27, 2026
by
杨卫
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:单边时间区间修改提交
1 parent
da66ca3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
17 deletions
aus-vr/src/main/java/com/glsx/usedcar/controller/VrAuditController.java
aus-vr/src/main/java/com/glsx/usedcar/controller/VrAuditController.java
View file @
f6badbc
...
@@ -143,28 +143,23 @@ public class VrAuditController {
...
@@ -143,28 +143,23 @@ public class VrAuditController {
// 7. 场次时间区间 - EXISTS 子查询关联 AuctionVehicle(只查创建时间最晚的场次)
// 7. 场次时间区间 - EXISTS 子查询关联 AuctionVehicle(只查创建时间最晚的场次)
if
(
queryVO
.
getAuctionStartTimeBegin
()
!=
null
||
queryVO
.
getAuctionStartTimeEnd
()
!=
null
)
{
if
(
queryVO
.
getAuctionStartTimeBegin
()
!=
null
||
queryVO
.
getAuctionStartTimeEnd
()
!=
null
)
{
final
LocalDate
beginTime
=
queryVO
.
getAuctionStartTimeBegin
()
;
final
LocalDate
Time
beginDateTime
=
queryVO
.
getAuctionStartTimeBegin
()
!=
null
?
queryVO
.
getAuctionStartTimeBegin
().
atStartOfDay
()
:
null
;
final
LocalDate
endTime
=
queryVO
.
getAuctionStartTimeEnd
()
;
final
LocalDate
Time
endDateTime
=
queryVO
.
getAuctionStartTimeEnd
()
!=
null
?
queryVO
.
getAuctionStartTimeEnd
().
atTime
(
23
,
59
,
59
)
:
null
;
pagination
.
addCondition
((
root
,
query
,
builder
)
->
{
pagination
.
addCondition
((
root
,
query
,
builder
)
->
{
// 子查询
1:找该车辆创建时间最晚的场次ID(使用MAX)
// 子查询
:找该车辆拍卖开始时间最晚的时间
var
latestSubquery
=
query
.
subquery
(
Integer
.
class
);
var
maxStartSubquery
=
query
.
subquery
(
LocalDateTime
.
class
);
var
latestRoot
=
lates
tSubquery
.
from
(
AuctionVehicle
.
class
);
var
maxStartRoot
=
maxStar
tSubquery
.
from
(
AuctionVehicle
.
class
);
latestSubquery
.
select
(
builder
.
max
(
latestRoot
.
get
(
AuctionVehicle_
.
AUCVEH_ID
)));
maxStartSubquery
.
select
(
builder
.
greatest
(
maxStartRoot
.
get
(
AuctionVehicle_
.
AUCTION_START_TIME
).
as
(
LocalDateTime
.
class
)));
lates
tSubquery
.
where
(
maxStar
tSubquery
.
where
(
builder
.
equal
(
lates
tRoot
.
get
(
AuctionVehicle_
.
VEHICLE
).
get
(
Vehicle_
.
VEHICLE_ID
),
builder
.
equal
(
maxStar
tRoot
.
get
(
AuctionVehicle_
.
VEHICLE
).
get
(
Vehicle_
.
VEHICLE_ID
),
root
.
get
(
VrAudit_
.
VEHICLE_ID
))
root
.
get
(
VrAudit_
.
VEHICLE_ID
))
);
);
// 子查询2:验证最晚那场是否符合时间条件
// 直接比较最晚的拍卖开始时间是否在搜索范围内
var
subquery
=
query
.
subquery
(
Integer
.
class
);
return
builder
.
and
(
var
subRoot
=
subquery
.
from
(
AuctionVehicle
.
class
);
beginDateTime
!=
null
?
builder
.
greaterThanOrEqualTo
(
maxStartSubquery
,
beginDateTime
)
:
builder
.
conjunction
(),
subquery
.
select
(
subRoot
.
get
(
AuctionVehicle_
.
AUCVEH_ID
));
endDateTime
!=
null
?
builder
.
lessThanOrEqualTo
(
maxStartSubquery
,
endDateTime
)
:
builder
.
conjunction
()
subquery
.
where
(
builder
.
equal
(
subRoot
.
get
(
AuctionVehicle_
.
AUCVEH_ID
),
latestSubquery
),
beginTime
!=
null
?
builder
.
greaterThanOrEqualTo
(
subRoot
.
get
(
AuctionVehicle_
.
AUCTION_START_TIME
),
beginTime
)
:
builder
.
conjunction
(),
endTime
!=
null
?
builder
.
lessThanOrEqualTo
(
subRoot
.
get
(
AuctionVehicle_
.
AUCTION_END_TIME
),
endTime
)
:
builder
.
conjunction
()
);
);
return
builder
.
exists
(
subquery
);
});
});
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment