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
7aa91eea
Commit
7aa91eea
authored
Jun 11, 2019
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改合并
parent
76d1ccb0
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
204 additions
and
75 deletions
+204
-75
AddOrUpdateVehicleVo.java
.../com/xxfc/platform/vehicle/pojo/AddOrUpdateVehicleVo.java
+4
-0
BookVehicleVO.java
...in/java/com/xxfc/platform/vehicle/pojo/BookVehicleVO.java
+2
-1
QueryVehicleVo.java
...n/java/com/xxfc/platform/vehicle/pojo/QueryVehicleVo.java
+4
-0
VehicleDepartureLogVo.java
...com/xxfc/platform/vehicle/pojo/VehicleDepartureLogVo.java
+4
-0
VehicleDepartureStatisticDataVo.java
...latform/vehicle/pojo/VehicleDepartureStatisticDataVo.java
+1
-1
VehiclePageQueryVo.java
...va/com/xxfc/platform/vehicle/pojo/VehiclePageQueryVo.java
+13
-0
VehicleWarningMsgQueryVo.java
.../xxfc/platform/vehicle/pojo/VehicleWarningMsgQueryVo.java
+4
-0
VehicleBookRecordMapper.xml
...ver/src/main/resources/mapper/VehicleBookRecordMapper.xml
+17
-0
VehicleDepartureLogMapper.xml
...r/src/main/resources/mapper/VehicleDepartureLogMapper.xml
+60
-55
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+68
-17
VehicleUpkeepLogMapper.xml
...rver/src/main/resources/mapper/VehicleUpkeepLogMapper.xml
+12
-1
VehicleWarningMsgMapper.xml
...ver/src/main/resources/mapper/VehicleWarningMsgMapper.xml
+15
-0
No files found.
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/AddOrUpdateVehicleVo.java
View file @
7aa91eea
...
...
@@ -122,4 +122,8 @@ public class AddOrUpdateVehicleVo {
* 生产商
*/
private
Date
receiveTime
;
/**
* 最后公里数
*/
private
Integer
mileageLastUpdate
;
}
\ No newline at end of file
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/BookVehicleVO.java
View file @
7aa91eea
...
...
@@ -85,5 +85,6 @@ public class BookVehicleVO {
@ApiModelProperty
(
"是否违章"
)
private
Integer
haveViolation
;
//还车分公司
private
Integer
retCompany
;
}
\ No newline at end of file
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/QueryVehicleVo.java
View file @
7aa91eea
...
...
@@ -89,6 +89,10 @@ public class QueryVehicleVo {
* 保养时间
*/
private
Date
maintenanceDate
;
/**
* 保养公里
*/
private
Integer
mileage
;
/**
* 保养里程数
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehicleDepartureLogVo.java
View file @
7aa91eea
...
...
@@ -20,6 +20,10 @@ public class VehicleDepartureLogVo {
String
arrivalTime
;
Integer
mileageStart
;
Integer
mileageEnd
;
Integer
mileage
;
Integer
state
;
String
numberPlate
;
String
departureDay
;
String
departureName
;
String
arrivalName
;
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehicleDepartureStatisticDataVo.java
View file @
7aa91eea
...
...
@@ -14,7 +14,7 @@ public class VehicleDepartureStatisticDataVo {
/**
* 出车天数
*/
Integer
departureDay
;
String
departureDay
;
/**
* 出车公里数
*/
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehiclePageQueryVo.java
View file @
7aa91eea
...
...
@@ -31,6 +31,19 @@ public class VehiclePageQueryVo {
* 所属分支机构(id)
*/
private
Integer
subordinateBranch
;
/**
* 所属分支机构(id)
*/
private
Integer
addrProvince
;
/**
* 所属分支机构(id)
*/
private
Integer
addrCity
;
/**
* 片区
*/
private
Integer
zoneId
;
/**
* 用途类型:租赁房车(1)、展车等,对应关系见车辆常量表
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehicleWarningMsgQueryVo.java
View file @
7aa91eea
...
...
@@ -53,11 +53,15 @@ public class VehicleWarningMsgQueryVo {
*/
private
Integer
vehicleCode
;
private
Integer
subordinateBranch
;
/**
* 对应车牌号
*/
private
String
numberPlate
;
private
Integer
mileageLastUpdate
;
private
Date
createTime
;
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleBookRecordMapper.xml
View file @
7aa91eea
...
...
@@ -243,6 +243,23 @@
vehicle_book_info vbf on vbf.vehicle = vbr.vehicle and vbf.year_month = #{selectedMonth}
where
1=1
<if
test=
"companyList != null and companyList.size() > 0"
>
and ( vbr.lift_company in (
<trim
suffixOverrides=
","
>
<foreach
collection=
"companyList"
item=
"companyId"
>
#{companyId},
</foreach>
</trim>
)
or vbr.ret_company in (
<trim
suffixOverrides=
","
>
<foreach
collection=
"companyList"
item=
"companyId"
>
#{companyId},
</foreach>
</trim>
)
)
</if>
<if
test=
"liftCompany !=null"
>
and vbr.lift_company = #{liftCompany}
</if>
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleDepartureLogMapper.xml
View file @
7aa91eea
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.xxfc.platform.vehicle.mapper.VehicleDepartureLogMapper"
>
<select
id=
"selectLastByVehicleId"
resultType=
"com.xxfc.platform.vehicle.entity.VehicleDepartureLog"
>
select * from vehicle_departure_log
where vehicle_id = #{vehicleId}
order by create_time desc
limit 1
</select>
<select
id=
"selectByVehicleId"
>
select vehicle_departure_log.*,vehicle.number_plate
from vehicle_departure_log
left join vehicle on vehicle_departure_log.vehicle_id = vehicle.id
where vehicle_id = #{vehicleId}
order by create_time desc
</select>
<select
id=
"selectVoAll"
resultType=
"com.xxfc.platform.vehicle.pojo.VehicleDepartureLogVo"
>
select vehicle_departure_log.*,vehicle.number_plate
from vehicle_departure_log
left join vehicle on vehicle_departure_log.vehicle_id = vehicle.id
<trim
prefix=
"where"
>
<if
test=
"numberPlate != null and numberPlate != ''"
>
vehicle.number_plate = #{numberPlate}
</if>
<mapper
namespace=
"com.xxfc.platform.vehicle.mapper.VehicleUpkeepLogMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.xxfc.platform.vehicle.entity.VehicleUpkeepLog"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"vehicle_id"
property=
"vehicleId"
jdbcType=
"VARCHAR"
/>
<result
column=
"operator"
property=
"operator"
jdbcType=
"VARCHAR"
/>
<result
column=
"date"
property=
"date"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"mileage"
property=
"mileage"
jdbcType=
"INTEGER"
/>
<result
column=
"amount"
property=
"amount"
jdbcType=
"DECIMAL"
/>
<result
column=
"approvers"
property=
"approvers"
jdbcType=
"VARCHAR"
/>
<result
column=
"branch_company_id"
property=
"branchCompanyId"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<insert
id=
"addItems"
>
insert into vehicle_upkeep_log_item(log_id, item_id)
values
<trim
suffixOverrides=
","
>
<foreach
collection=
"upkeepItems"
item=
"item"
>
(#{id}, #{item}),
</foreach>
</trim>
order by create_time desc
</select>
<select
id=
"selectVoAllNotAllData"
resultType=
"com.xxfc.platform.vehicle.pojo.VehicleDepartureLogVo"
>
select vehicle_departure_log.*,vehicle.number_plate
from vehicle_departure_log
left join vehicle on vehicle_departure_log.vehicle_id = vehicle.id
<trim
prefix=
"where"
suffixOverrides=
"and"
>
</insert>
<delete
id=
"deleteItemsByLogId"
>
delete from vehicle_upkeep_log_item
where log_id = #{id}
</delete>
<select
id=
"selectVoAll"
resultType=
"com.xxfc.platform.vehicle.vo.VehicleUpkeepLogVo"
>
select a.*, b.number_plate, c.name as branch_company_name
from vehicle_upkeep_log a
left join vehicle b on a.vehicle_id = b.id
left join branch_company c on a.branch_company_id = c.id
<trim
prefix=
"where"
>
1=1
<if
test=
"numberPlate != null and numberPlate != ''"
>
vehicle.number_plate = #{numberPlate} and
and b.number_plate = #{numberPlate}
</if>
<if
test=
"companyList != null"
>
( vehicle.park_branch_company_id in (
<foreach
collection=
"companyList"
item=
"companyId"
>
<if
test=
"companyList != null and companyList.size() > 0"
>
and ( a.branch_company_id in (
<trim
suffixOverrides=
","
>
#{companyId},
</trim>
</foreach>
)
or vehicle.expect_destination_branch_company_id in (
<foreach
collection=
"companyList"
item=
"companyId"
>
<trim
suffixOverrides=
","
>
#{companyId},
</trim>
</foreach>
</trim>
)
)
</if>
</trim>
order by create_time desc
order by a.create_time desc
</select>
<select
id=
"selectVoById"
resultType=
"com.xxfc.platform.vehicle.vo.VehicleUpkeepLogVo"
>
select a.*, b.number_plate, c.name as branch_company_name
from vehicle_upkeep_log a
left join vehicle b on a.vehicle_id = b.id
left join branch_company c on a.branch_company_id = c.id
where a.id = #{id}
</select>
<select
id=
"selectMileageByVehicleId"
resultType=
"int"
>
select sum(mileage_end - mileage_start)
from vehicle_departure_log
where vehicle_id = #{vehicleId};
<select
id=
"getItemsByLogId"
resultType=
"com.xxfc.platform.vehicle.vo.VehicleUpkeepLogItemVo"
>
select a.*, b.name as item_name
from vehicle_upkeep_log_item a
left join vehicle_upkeep_item b on a.item_id = b.id
where a.log_id = #{id}
</select>
<select
id=
"selectDayByVehicleId"
resultType=
"int"
>
select sum(to_days(arrival_time) - to_days(departure_time))
from vehicle_departure_log
where vehicle_id = #{vehicleId};
<select
id=
"selectLastByVehicleId"
resultType=
"com.xxfc.platform.vehicle.entity.VehicleUpkeepLog"
>
select *
from vehicle_upkeep_log
where vehicle_id = #{vehicleId}
order by create_time desc
limit 1
</select>
</mapper>
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
7aa91eea
...
...
@@ -22,13 +22,13 @@
<select
id=
"getByPage"
parameterType=
"java.util.Map"
resultType=
"com.xxfc.platform.vehicle.pojo.QueryVehicleVo"
>
select v.`id`,
select
DISTINCT
v.`id`,
v.`code`,
v.`status`,
v.number_plate,
v.brand,
v.
subordinate_branch,
bc.name as
subBranchName,
IFNULL(v.park_branch_company_id,v.expect_destination_branch_company_id) AS
subordinate_branch,
IFNULL(bc.name,bc1.name) AS
subBranchName,
v.use_type,
v.remark,
v.create_time,
...
...
@@ -46,7 +46,8 @@
v.engine_num,
v.manufacturer,
v.receive_time,
v.update_time
v.update_time,
v.mileage_last_update as mileage
<if
test=
" yearMonthAndParam != null "
>
,vbi.booked_date
</if>
...
...
@@ -55,7 +56,8 @@
left join
vehicle_book_info vbi on v.`id` = vbi.vehicle
</if>
left join branch_company bc on v.`subordinate_branch` = bc.id
LEFT JOIN branch_company bc ON v.park_branch_company_id = bc.id 58 left join branch_company bc on v.`subordinate_branch` = bc.id
LEFT JOIN branch_company bc1 ON v.expect_destination_branch_company_id = bc1.id
where
1=1
<if
test=
"mRangeDateEnd !=null"
>
...
...
@@ -80,7 +82,7 @@
and v.insurance_company = #{insuranceCompany}
</if>
<if
test=
"vin !=null and vin != ''"
>
and v.vin = #{vin}
a
and v.vin = #{vin}
</if>
<if
test=
"subordinateBranch !=null"
>
and v.subordinate_branch = #{subordinateBranch}
...
...
@@ -92,7 +94,7 @@
and v.status = #{status}
</if>
<if
test=
"numberPlate !=null and numberPlate != ''"
>
and v.number_plate
= #{numberPlate}
and v.number_plate
like concat('%',#{numberPlate},'%')
</if>
<if
test=
"brand !=null"
>
and v.brand = #{brand}
...
...
@@ -109,18 +111,36 @@
)
</foreach>
</if>
<if
test=
"subordinateBranch !=null or addrProvince !=null or addrCity !=null or zoneId !=null "
>
and (
<trim
suffixOverrides=
"OR"
>
<if
test=
"subordinateBranch !=null "
>
( v.park_branch_company_id = #{subordinateBranch} or v.expect_destination_branch_company_id=#{subordinateBranch} ) OR
</if>
<if
test=
"addrProvince !=null"
>
(bc.addr_province=#{addrProvince} or bc1.addr_province=#{addrProvince}) OR
</if>
<if
test=
"addrCity !=null"
>
(bc.addr_city=#{addrProvince} or bc1.addr_city=#{addrProvince}) OR
</if>
<if
test=
"zoneId !=null"
>
(bc.zone_id=#{zoneId} or bc1.zone_id=#{zoneId}) OR
</if>
</trim>
)
</if>
order by v.code
</select>
<select
id=
"getByPageNotAllData"
parameterType=
"java.util.Map"
resultType=
"com.xxfc.platform.vehicle.pojo.QueryVehicleVo"
>
select v.`id`,
select
DISTINCT
v.`id`,
v.`code`,
v.`status`,
v.number_plate,
v.brand,
v.
subordinate_branch,
bc.name as
subBranchName,
IFNULL(v.park_branch_company_id,v.expect_destination_branch_company_id) AS
subordinate_branch,
IFNULL(bc.name,bc1.name) AS
subBranchName,
v.use_type,
v.remark,
v.create_time,
...
...
@@ -138,7 +158,8 @@
v.engine_num,
v.manufacturer,
v.receive_time,
v.update_time
v.update_time,
v.mileage_last_update as mileage
<if
test=
" yearMonthAndParam !=null "
>
,vbi.booked_date
</if>
...
...
@@ -147,23 +168,24 @@
left join
vehicle_book_info vbi on v.`id` = vbi.vehicle
</if>
left join branch_company bc on v.`subordinate_branch` = bc.id
LEFT JOIN branch_company bc ON v.park_branch_company_id = bc.id
LEFT JOIN branch_company bc1 ON v.expect_destination_branch_company_id = bc1.id
where
1=1
<if
test=
"companyList != null"
>
and ( v.park_branch_company_id in (
<foreach
collection=
"companyList"
item=
"companyId"
>
<trim
suffixOverrides=
","
>
<foreach
collection=
"companyList"
item=
"companyId"
>
#{companyId},
</trim>
</foreach>
</trim>
)
or v.expect_destination_branch_company_id in (
<foreach
collection=
"companyList"
item=
"companyId"
>
<trim
suffixOverrides=
","
>
<foreach
collection=
"companyList"
item=
"companyId"
>
#{companyId},
</trim>
</foreach>
</trim>
)
)
</if>
...
...
@@ -201,7 +223,7 @@
and v.status = #{status}
</if>
<if
test=
"numberPlate !=null and numberPlate != ''"
>
and v.number_plate
= #{numberPlate}
and v.number_plate
like concat('%',#{numberPlate},'%')
</if>
<if
test=
"brand !=null"
>
and v.brand = #{brand}
...
...
@@ -218,6 +240,24 @@
)
</foreach>
</if>
<if
test=
"subordinateBranch !=null or addrProvince !=null or addrCity !=null or zoneId !=null "
>
and (
<trim
suffixOverrides=
"OR"
>
<if
test=
"subordinateBranch !=null "
>
( v.park_branch_company_id = #{subordinateBranch} or v.expect_destination_branch_company_id=#{subordinateBranch} ) OR
</if>
<if
test=
"addrProvince !=null"
>
(bc.addr_province=#{addrProvince} or bc1.addr_province=#{addrProvince}) OR
</if>
<if
test=
"addrCity !=null"
>
(bc.addr_city=#{addrProvince} or bc1.addr_city=#{addrProvince}) OR
</if>
<if
test=
"zoneId !=null"
>
(bc.zone_id=#{zoneId} or bc1.zone_id=#{zoneId}) OR
</if>
</trim>
)
</if>
order by v.code
</select>
...
...
@@ -243,6 +283,17 @@
where id = #{vehicleId} and status = #{lastStatus}
</update>
<update
id=
"updateMileageStatusByIdAndStatus"
>
update vehicle
set status = #{status},maintenance_mileage=#{mileage}
where id = #{vehicleId} and status = #{lastStatus}
</update>
<update
id=
"upMileageByIdAndStatus"
>
update vehicle
set status = #{status},mileage_last_update=#{mileage}
where id = #{vehicleId} and status = #{lastStatus}
</update>
<select
id=
"searchUsableModel"
parameterType=
"java.util.Map"
resultMap=
"searchUsableModelMap"
>
select distinct vm.id as model_id, bc.id as company_id
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleUpkeepLogMapper.xml
View file @
7aa91eea
...
...
@@ -34,8 +34,19 @@
left join vehicle b on a.vehicle_id = b.id
left join branch_company c on a.branch_company_id = c.id
<trim
prefix=
"where"
>
1=1
<if
test=
"numberPlate != null and numberPlate != ''"
>
b.number_plate = #{numberPlate}
and b.number_plate = #{numberPlate}
</if>
<if
test=
"companyList != null and companyList.size() > 0"
>
and ( a.branch_company_id in (
<trim
suffixOverrides=
","
>
<foreach
collection=
"companyList"
item=
"companyId"
>
#{companyId},
</foreach>
</trim>
)
)
</if>
</trim>
order by a.create_time desc
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleWarningMsgMapper.xml
View file @
7aa91eea
...
...
@@ -24,5 +24,20 @@
select id, type, status, msg, rule_id, msg_key, vehicle_id, create_time, update_time, remark from vehicle_warning_msg where vehicle_id = #{_parameter}
</select>
<select
id=
"getByPages"
resultType=
"com.xxfc.platform.vehicle.pojo.VehicleWarningMsgQueryVo"
parameterType=
"com.xxfc.platform.vehicle.pojo.QueryVehicleWarningMsgVo"
>
SELECT id as vehicleId,code as vehicleCode,number_plate as numberPlate,mileage_last_update as mileageLastUpdate,status,
IFNULL(park_branch_company_id,expect_destination_branch_company_id) AS subordinateBranch,
CONCAT('当前公里数为:',mileage_last_update,' 保养公里数:',maintenance_mileage,' 请尽快保养!') as msg
,1 as type,update_time as createTime FROM vehicle
WHERE mileage_last_update>=maintenance_mileage
<if
test=
"vehicleCode != null"
>
and vcode = #{vehicleCode}
</if>
<if
test=
"numberPlate != null and numberPlate != '' "
>
and number_plate = #{numberPlate}
</if>
</select>
</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