Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
edfa7ebd
Commit
edfa7ebd
authored
Nov 19, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台导出车辆信息
parent
c8a33c86
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
1 deletion
+34
-1
BranchCompanyVehicleCountDTO.java
...atform/vehicle/pojo/dto/BranchCompanyVehicleCountDTO.java
+4
-0
BranchCompanyVehicleCountBiz.java
...fc/platform/vehicle/biz/BranchCompanyVehicleCountBiz.java
+17
-0
BranchCompanyVehicleCountMapper.xml
...main/resources/mapper/BranchCompanyVehicleCountMapper.xml
+13
-1
No files found.
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/dto/BranchCompanyVehicleCountDTO.java
View file @
edfa7ebd
...
@@ -12,4 +12,8 @@ public class BranchCompanyVehicleCountDTO extends PageParam {
...
@@ -12,4 +12,8 @@ public class BranchCompanyVehicleCountDTO extends PageParam {
private
String
endTime
;
private
String
endTime
;
private
String
companyName
;
private
String
companyName
;
//统计类型,日月年, 1、日,2、月,3、年
private
Integer
type
;
//需要除去的天数
private
Integer
dayNum
;
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/BranchCompanyVehicleCountBiz.java
View file @
edfa7ebd
...
@@ -11,11 +11,14 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -11,11 +11,14 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Calendar
;
@Service
@Service
@Slf4j
@Slf4j
public
class
BranchCompanyVehicleCountBiz
extends
BaseBiz
<
BranchCompanyVehicleCountMapper
,
BranchCompanyVehicleCount
>
{
public
class
BranchCompanyVehicleCountBiz
extends
BaseBiz
<
BranchCompanyVehicleCountMapper
,
BranchCompanyVehicleCount
>
{
@Autowired
@Autowired
VehicleInformationDownloadBiz
vehicleInformationDownloadBiz
;
VehicleInformationDownloadBiz
vehicleInformationDownloadBiz
;
public
ObjectRestResponse
add
(
BranchCompanyVehicleCount
branchCompanyVehicleCount
)
{
public
ObjectRestResponse
add
(
BranchCompanyVehicleCount
branchCompanyVehicleCount
)
{
if
(
branchCompanyVehicleCount
==
null
)
{
if
(
branchCompanyVehicleCount
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
return
ObjectRestResponse
.
paramIsEmpty
();
...
@@ -33,10 +36,24 @@ public class BranchCompanyVehicleCountBiz extends BaseBiz<BranchCompanyVehicleCo
...
@@ -33,10 +36,24 @@ public class BranchCompanyVehicleCountBiz extends BaseBiz<BranchCompanyVehicleCo
Integer
pageSize
=
branchCompanyVehicleCountDTO
.
getLimit
()
==
null
?
10
:
branchCompanyVehicleCountDTO
.
getLimit
();
Integer
pageSize
=
branchCompanyVehicleCountDTO
.
getLimit
()
==
null
?
10
:
branchCompanyVehicleCountDTO
.
getLimit
();
branchCompanyVehicleCountDTO
.
setPage
(
pageNo
);
branchCompanyVehicleCountDTO
.
setPage
(
pageNo
);
branchCompanyVehicleCountDTO
.
setLimit
(
pageSize
);
branchCompanyVehicleCountDTO
.
setLimit
(
pageSize
);
if
(
branchCompanyVehicleCountDTO
.
getType
()
==
1
)
{
branchCompanyVehicleCountDTO
.
setDayNum
(
1
);
}
else
if
(
branchCompanyVehicleCountDTO
.
getType
()
==
2
)
{
branchCompanyVehicleCountDTO
.
setDayNum
(
7
);
}
else
if
(
branchCompanyVehicleCountDTO
.
getType
()
==
3
)
{
branchCompanyVehicleCountDTO
.
setDayNum
(
getCurrentMonthLastDay
());
}
Query
query
=
new
Query
(
branchCompanyVehicleCountDTO
);
Query
query
=
new
Query
(
branchCompanyVehicleCountDTO
);
PageDataVO
<
BranchCompanyVehicleCount
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
getAllByParam
(
query
.
getSuper
()));
PageDataVO
<
BranchCompanyVehicleCount
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
getAllByParam
(
query
.
getSuper
()));
return
ObjectRestResponse
.
succ
(
pageDataVO
);
return
ObjectRestResponse
.
succ
(
pageDataVO
);
}
}
public
int
getCurrentMonthLastDay
()
{
Calendar
a
=
Calendar
.
getInstance
();
a
.
set
(
Calendar
.
DATE
,
1
);
//把日期设置为当月第一天
a
.
roll
(
Calendar
.
DATE
,
-
1
);
//日期回滚一天,也就是最后一天
int
maxDate
=
a
.
get
(
Calendar
.
DATE
);
return
maxDate
;
}
}
}
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/BranchCompanyVehicleCountMapper.xml
View file @
edfa7ebd
...
@@ -13,7 +13,18 @@
...
@@ -13,7 +13,18 @@
</resultMap>
</resultMap>
<select
id=
"getAllByParam"
parameterType=
"Map"
resultType=
"com.xxfc.platform.vehicle.entity.BranchCompanyVehicleCount"
>
<select
id=
"getAllByParam"
parameterType=
"Map"
resultType=
"com.xxfc.platform.vehicle.entity.BranchCompanyVehicleCount"
>
select * from branch_company_vehicle_count
select *, CEILING(
(
CASE
WHEN #{type} = 1 THEN
vehicle_num / #{dayNum},
WHEN #{type} = 2 THEN
vehicle_num / #{dayNum},
WHEN #{type} = 3 THEN
vehicle_num / #{dayNum}
END
)
) AS count from branch_company_vehicle_count
<where>
<where>
<if
test=
"companyName != null and companyName != ''"
>
<if
test=
"companyName != null and companyName != ''"
>
and company_name like concat('%', #{companyName}, '%')
and company_name like concat('%', #{companyName}, '%')
...
@@ -21,6 +32,7 @@
...
@@ -21,6 +32,7 @@
<if
test=
"startTime != null and startTime != ''"
>
<if
test=
"startTime != null and startTime != ''"
>
and count_date
>
#{startTime} and count_date
<
#{endTime}
and count_date
>
#{startTime} and count_date
<
#{endTime}
</if>
</if>
</where>
</where>
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment