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
c75bb70a
Commit
c75bb70a
authored
Oct 24, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
f7cc11cc
1395fbf7
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
491 additions
and
23 deletions
+491
-23
OrderVehicleCrosstownBiz.java
...com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
+3
-3
UserBiz.java
...r/src/main/java/com/xxfc/platform/summit/biz/UserBiz.java
+11
-10
pom.xml
xx-vehicle/xx-vehicle-api/pom.xml
+0
-1
Vehicle.java
...c/main/java/com/xxfc/platform/vehicle/entity/Vehicle.java
+18
-0
ResultVehicleVo.java
.../java/com/xxfc/platform/vehicle/pojo/ResultVehicleVo.java
+7
-1
VehicleExcelVo.java
...n/java/com/xxfc/platform/vehicle/pojo/VehicleExcelVo.java
+41
-0
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+2
-0
VehicleInformationDownloadBiz.java
...c/platform/vehicle/biz/VehicleInformationDownloadBiz.java
+78
-0
VehicleMapper.java
.../java/com/xxfc/platform/vehicle/mapper/VehicleMapper.java
+6
-2
VehicleInformationDownloadController.java
...icle/rest/admin/VehicleInformationDownloadController.java
+70
-0
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+255
-6
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
View file @
c75bb70a
...
@@ -171,9 +171,9 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
...
@@ -171,9 +171,9 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
OrderRentVehicleDetail
orderRentVehicleDetail
=
orderRentVehicleBiz
.
selectById
(
baseOrder
.
getDetailId
());
OrderRentVehicleDetail
orderRentVehicleDetail
=
orderRentVehicleBiz
.
selectById
(
baseOrder
.
getDetailId
());
if
(
orderVehicleCrosstownDto
.
getType
()
==
CrosstownTypeEnum
.
DEPARTURE
.
getCode
())
{
if
(
orderVehicleCrosstownDto
.
getType
()
==
CrosstownTypeEnum
.
DEPARTURE
.
getCode
())
{
boolean
flag
=
getTodayTime
(
orderRentVehicleDetail
.
getStartTime
());
boolean
flag
=
getTodayTime
(
orderRentVehicleDetail
.
getStartTime
());
//
if (!flag) {
if
(!
flag
)
{
//
return ObjectRestResponse.createFailedResult(3502, "今日不是交车日期");
return
ObjectRestResponse
.
createFailedResult
(
3502
,
"今日不是交车日期"
);
//
}
}
if
(
null
==
userDTO
.
getCompanyId
()
||
!
userDTO
.
getCompanyId
().
equals
(
orderRentVehicleDetail
.
getStartCompanyId
()))
{
if
(
null
==
userDTO
.
getCompanyId
()
||
!
userDTO
.
getCompanyId
().
equals
(
orderRentVehicleDetail
.
getStartCompanyId
()))
{
return
ObjectRestResponse
.
createFailedResult
(
3501
,
"无交车权限"
);
return
ObjectRestResponse
.
createFailedResult
(
3501
,
"无交车权限"
);
}
}
...
...
xx-summit/xx-summit-server/src/main/java/com/xxfc/platform/summit/biz/UserBiz.java
View file @
c75bb70a
...
@@ -81,6 +81,7 @@ public class UserBiz extends BaseBiz<UserMapper, User> {
...
@@ -81,6 +81,7 @@ public class UserBiz extends BaseBiz<UserMapper, User> {
userId
=
uses
.
get
(
0
).
getId
();
userId
=
uses
.
get
(
0
).
getId
();
user
.
setId
(
userId
);
user
.
setId
(
userId
);
}
else
{
}
else
{
user
.
setId
(
null
);
Long
time
=
System
.
currentTimeMillis
()/
1000L
;
Long
time
=
System
.
currentTimeMillis
()/
1000L
;
user
.
setWeId
(
weId
);
user
.
setWeId
(
weId
);
user
.
setRId
(
rId
);
user
.
setRId
(
rId
);
...
@@ -97,12 +98,12 @@ public class UserBiz extends BaseBiz<UserMapper, User> {
...
@@ -97,12 +98,12 @@ public class UserBiz extends BaseBiz<UserMapper, User> {
log
.
info
(
"----code为空---"
);
log
.
info
(
"----code为空---"
);
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"code为空"
));
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"code为空"
));
}
}
String
openid
=
"oXDd91MppH9i5F7xzPwigiMj--5w"
;
String
openid
=
null
;
/*
String access_token = null;
String
access_token
=
null
;
try
{
try
{
JSONObject
jsonData
=
weixinService
.
getAccessToken
(
code
);
JSONObject
jsonData
=
weixinService
.
getAccessToken
(
code
);
openid = jsonData.getString("openid");
openid
=
jsonData
.
getString
(
"openid"
);
access_token = jsonData.getString("access_token");
access_token
=
jsonData
.
getString
(
"access_token"
);
String
refresh_token
=
jsonData
.
getString
(
"refresh_token"
);
String
refresh_token
=
jsonData
.
getString
(
"refresh_token"
);
log
.
info
(
"-----微信回调userInfo---openid=="
+
openid
+
"----access_token==="
+
access_token
);
log
.
info
(
"-----微信回调userInfo---openid=="
+
openid
+
"----access_token==="
+
access_token
);
//验证access_token是否失效
//验证access_token是否失效
...
@@ -116,15 +117,15 @@ public class UserBiz extends BaseBiz<UserMapper, User> {
...
@@ -116,15 +117,15 @@ public class UserBiz extends BaseBiz<UserMapper, User> {
e
.
printStackTrace
();
e
.
printStackTrace
();
log
.
info
(
"网络异常==="
+
e
.
getMessage
());
log
.
info
(
"网络异常==="
+
e
.
getMessage
());
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"网络异常"
));
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"网络异常"
));
}
*/
}
try
{
try
{
// 获取微信用户基本信息
// 获取微信用户基本信息
/*
JSONObject userinfo_json = weixinService.getUserInfo(access_token,openid);
JSONObject
userinfo_json
=
weixinService
.
getUserInfo
(
access_token
,
openid
);
if
(
userinfo_json
==
null
||
StringUtils
.
isNotBlank
(
userinfo_json
.
getString
(
"errcode"
)))
{
if
(
userinfo_json
==
null
||
StringUtils
.
isNotBlank
(
userinfo_json
.
getString
(
"errcode"
)))
{
log
.
info
(
"调用微信用户基本信息接口失败"
);
log
.
info
(
"调用微信用户基本信息接口失败"
);
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"调用微信用户基本信息接口失败"
));
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"调用微信用户基本信息接口失败"
));
}
}
log.info("微信用户基本信息---user===" +userinfo_json.toJSONString());
*/
log
.
info
(
"微信用户基本信息---user==="
+
userinfo_json
.
toJSONString
());
if
(
activityId
==
null
||
activityId
==
0
){
if
(
activityId
==
null
||
activityId
==
0
){
ActivityBm
activityBm
=
activityBmBiz
.
userInfo
(
key
);
ActivityBm
activityBm
=
activityBmBiz
.
userInfo
(
key
);
if
(
activityBm
==
null
){
if
(
activityBm
==
null
){
...
@@ -138,9 +139,9 @@ public class UserBiz extends BaseBiz<UserMapper, User> {
...
@@ -138,9 +139,9 @@ public class UserBiz extends BaseBiz<UserMapper, User> {
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"redis的报名信息activityId---为空"
));
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"redis的报名信息activityId---为空"
));
}
}
User
userInfo
=
new
User
();
User
userInfo
=
new
User
();
String
nickName
=
"苹果呀"
;
//
userinfo_json.getString("nickname");
String
nickName
=
userinfo_json
.
getString
(
"nickname"
);
String
headimgurl
=
"http://thirdwx.qlogo.cn/mmopen/4eFHvhmOX6XuiaG6ib7wxkLa8AwMLFIbW9BSJ7EmwC3kRMUdgCrobdRUbhjMXbkY7aBc2CazjXFJiap5ianMH6yQnH2UQ4TfkXJw/132"
;
//
userinfo_json.getString("headimgurl");
String
headimgurl
=
userinfo_json
.
getString
(
"headimgurl"
);
String
sex
=
"2"
;
//
userinfo_json.getString("sex");
String
sex
=
userinfo_json
.
getString
(
"sex"
);
if
(
StringUtils
.
isBlank
(
sex
)){
if
(
StringUtils
.
isBlank
(
sex
)){
sex
=
"0"
;
sex
=
"0"
;
}
}
...
...
xx-vehicle/xx-vehicle-api/pom.xml
View file @
c75bb70a
...
@@ -17,7 +17,6 @@
...
@@ -17,7 +17,6 @@
<version>
2.0-SNAPSHOT
</version>
<version>
2.0-SNAPSHOT
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
<plugins>
<plugins>
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/Vehicle.java
View file @
c75bb70a
...
@@ -151,6 +151,24 @@ public class Vehicle {
...
@@ -151,6 +151,24 @@ public class Vehicle {
@Column
(
name
=
"travel_status"
)
@Column
(
name
=
"travel_status"
)
private
Integer
travelStatus
;
private
Integer
travelStatus
;
/**
* 终端号
*/
@Column
(
name
=
"terminal_number"
)
private
String
terminalNumber
;
/**
* SIM卡号
*/
@Column
(
name
=
"sim_number"
)
private
String
simNumber
;
/**
* 通讯类型
*/
@Column
(
name
=
"communication_type"
)
private
String
communicationType
;
/**
/**
* 是否删除;0-正常;1-删除
* 是否删除;0-正常;1-删除
*/
*/
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/ResultVehicleVo.java
View file @
c75bb70a
...
@@ -5,7 +5,7 @@ import lombok.Data;
...
@@ -5,7 +5,7 @@ import lombok.Data;
import
java.util.Date
;
import
java.util.Date
;
@Data
@Data
public
class
ResultVehicleVo
{
public
class
ResultVehicleVo
{
/**
/**
* 主键(uuid)
* 主键(uuid)
*/
*/
...
@@ -26,6 +26,12 @@ public class ResultVehicleVo {
...
@@ -26,6 +26,12 @@ public class ResultVehicleVo {
*/
*/
private
String
numberPlate
;
private
String
numberPlate
;
/**
* 车型
*/
private
String
vehicleType
;
/**
/**
* 品牌(编码,对应关系见相关常量),0-未填写
* 品牌(编码,对应关系见相关常量),0-未填写
*/
*/
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehicleExcelVo.java
0 → 100644
View file @
c75bb70a
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
;
import
lombok.Data
;
import
java.util.HashMap
;
import
java.util.Map
;
@Data
public
class
VehicleExcelVo
{
/**
* 车牌号,空字符串-没有
*/
private
String
numberPlate
;
/**
* 车辆编号,0-没有
*/
private
Integer
code
;
/**
* 车型
*/
private
String
vehicleType
;
/**
*
*/
private
String
useType
;
/**
* 停靠分支机构(名)
*/
private
String
parkBranchCompanyName
;
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
c75bb70a
...
@@ -317,6 +317,8 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -317,6 +317,8 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
return
RestResponse
.
codeAndMessage
(
objectRestResponse
.
getStatus
(),
objectRestResponse
.
getMessage
());
return
RestResponse
.
codeAndMessage
(
objectRestResponse
.
getStatus
(),
objectRestResponse
.
getMessage
());
}
}
}
else
{
continue
;
}
}
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleInformationDownloadBiz.java
0 → 100644
View file @
c75bb70a
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
import
com.alibaba.fastjson.JSON
;
import
com.github.pagehelper.PageHelper
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.google.common.collect.Lists
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.mapper.VehicleMapper
;
import
com.xxfc.platform.vehicle.pojo.ResultVehicleVo
;
import
com.xxfc.platform.vehicle.pojo.VehicleExcelVo
;
import
com.xxfc.platform.vehicle.pojo.VehiclePageQueryVo
;
import
org.apache.commons.beanutils.BeanUtilsBean
;
import
org.apache.commons.beanutils.PropertyUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
@Service
public
class
VehicleInformationDownloadBiz
extends
BaseBiz
<
VehicleMapper
,
Vehicle
>
{
@Autowired
private
VehicleBiz
vehicleBiz
;
public
List
<
VehicleExcelVo
>
getByPageNotAllData
(
VehiclePageQueryVo
vehiclePageQueryVo
,
List
<
Integer
>
companyList
)
throws
Exception
{
Map
<
String
,
Object
>
params
=
PropertyUtils
.
describe
(
vehiclePageQueryVo
);
//处理预定日期相关参数
vehicleBiz
.
adjustBookedInfoParam
(
params
,
vehiclePageQueryVo
);
if
(
companyList
!=
null
&&
companyList
.
size
()
>
0
)
{
params
.
put
(
"companyList"
,
companyList
);
}
else
{
params
.
put
(
"companyList"
,
Arrays
.
asList
(-
1
));
}
return
mapper
.
getVehicleExcelVoNotAllData
(
params
);
}
public
List
<
VehicleExcelVo
>
getByPage
(
VehiclePageQueryVo
vehiclePageQueryVo
)
throws
Exception
{
Map
<
String
,
Object
>
params
=
PropertyUtils
.
describe
(
vehiclePageQueryVo
);
//处理预定日期相关参数
vehicleBiz
.
adjustBookedInfoParam
(
params
,
vehiclePageQueryVo
);
params
.
get
(
"yearMonthAndParam"
);
if
(
vehiclePageQueryVo
.
getModelId
()
==
null
)
{
params
.
remove
(
"modelId"
);
}
return
mapper
.
getVehicleExcelVo
(
params
);
}
public
List
<
VehicleExcelVo
>
getList
(
String
vehiclePageQueryVoJson
,
UserDTO
userDTO
)
{
VehiclePageQueryVo
vehiclePageQueryVo
=
new
VehiclePageQueryVo
();
try
{
if
(
StringUtils
.
isNotBlank
(
vehiclePageQueryVoJson
)){
vehiclePageQueryVo
=
JSON
.
parseObject
(
vehiclePageQueryVoJson
,
VehiclePageQueryVo
.
class
);
}
if
(
userDTO
.
getDataAll
()
==
2
)
{
List
<
Integer
>
companyList
=
vehicleBiz
.
dataCompany
(
userDTO
.
getDataZone
(),
userDTO
.
getDataCompany
());
return
getByPageNotAllData
(
vehiclePageQueryVo
,
companyList
);
}
return
getByPage
(
vehiclePageQueryVo
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
new
ArrayList
();
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehicleMapper.java
View file @
c75bb70a
...
@@ -12,9 +12,13 @@ import java.util.Map;
...
@@ -12,9 +12,13 @@ import java.util.Map;
public
interface
VehicleMapper
extends
Mapper
<
Vehicle
>
{
public
interface
VehicleMapper
extends
Mapper
<
Vehicle
>
{
public
List
<
ResultVehicleVo
>
getByPage
(
Map
<
String
,
Object
>
params
);
public
List
<
ResultVehicleVo
>
getByPage
(
Map
<
String
,
Object
>
params
);
public
List
<
ResultVehicleVo
>
getByPageNotAllData
(
Map
<
String
,
Object
>
params
);
public
List
<
ResultVehicleVo
>
getByPageNotAllData
(
Map
<
String
,
Object
>
params
);
List
<
VehicleExcelVo
>
getVehicleExcelVo
(
Map
<
String
,
Object
>
params
);
List
<
VehicleExcelVo
>
getVehicleExcelVoNotAllData
(
Map
<
String
,
Object
>
params
);
public
int
updateStatusById
(
Map
<
String
,
Object
>
params
);
public
int
updateStatusById
(
Map
<
String
,
Object
>
params
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/VehicleInformationDownloadController.java
0 → 100644
View file @
c75bb70a
package
com
.
xxfc
.
platform
.
vehicle
.
rest
.
admin
;
import
cn.hutool.core.io.IoUtil
;
import
cn.hutool.poi.excel.ExcelUtil
;
import
cn.hutool.poi.excel.ExcelWriter
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.xxfc.platform.vehicle.biz.VehicleBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleInformationDownloadBiz
;
import
com.xxfc.platform.vehicle.common.BaseController
;
import
com.xxfc.platform.vehicle.pojo.VehicleExcelVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
@RestController
@RequestMapping
(
"VehicleInformationDownload"
)
@Slf4j
public
class
VehicleInformationDownloadController
extends
BaseController
<
VehicleInformationDownloadBiz
>
{
@Autowired
UserFeign
userFeign
;
@Autowired
private
UserAuthConfig
userAuthConfig
;
@Autowired
private
VehicleBiz
vehicleBiz
;
@Autowired
HttpServletResponse
response
;
@GetMapping
(
"/excel"
)
public
void
downloadExcel
(
@RequestParam
(
value
=
"vehiclePageQueryVoJson"
,
required
=
false
)
String
vehiclePageQueryVoJson
)
throws
Exception
{
UserDTO
userDTO
=
userFeign
.
userinfoByToken
(
userAuthConfig
.
getToken
(
request
)).
getData
();
if
(
userDTO
==
null
)
{
throw
new
BaseException
(
"token已失效"
);
}
List
<
VehicleExcelVo
>
rows
=
baseBiz
.
getList
(
vehiclePageQueryVoJson
,
userDTO
);
ExcelWriter
writer
=
ExcelUtil
.
getWriter
(
true
);
writer
.
addHeaderAlias
(
"numberPlate"
,
"车牌号"
);
writer
.
addHeaderAlias
(
"code"
,
"车辆编码"
);
writer
.
addHeaderAlias
(
"vehicleType"
,
"车型"
);
writer
.
addHeaderAlias
(
"useType"
,
"用途"
);
writer
.
addHeaderAlias
(
"parkBranchCompanyName"
,
"停靠分公司"
);
// 一次性写出内容,使用默认样式,强制输出标题
writer
.
write
(
rows
,
true
);
//response为HttpServletResponse对象
response
.
setContentType
(
"application/vnd.ms-excel;charset=utf-8"
);
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename=clxx.xlsx"
);
//out为OutputStream,需要写出到的目标流
ServletOutputStream
out
=
response
.
getOutputStream
();
writer
.
flush
(
out
,
true
);
// 关闭writer,释放内存
writer
.
close
();
//此处记得关闭输出Servlet流
IoUtil
.
close
(
out
);
}
}
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
c75bb70a
...
@@ -41,7 +41,8 @@
...
@@ -41,7 +41,8 @@
SELECT r.* FROM (
SELECT r.* FROM (
select DISTINCT v.`id`,
select DISTINCT v.`id`,
v.`code`,
v.`code`,
v.`status`,
(CASE WHEN #{status} != null THEN #{status}
ELSE v.status END) status ,
v.number_plate,
v.number_plate,
v.brand,
v.brand,
v.park_branch_company_id,
v.park_branch_company_id,
...
@@ -69,7 +70,8 @@
...
@@ -69,7 +70,8 @@
v.receive_time,
v.receive_time,
v.update_time,
v.update_time,
v.model_id,
v.model_id,
v.mileage_last_update as mileage
v.mileage_last_update as mileage,
vm.name as vehicleType
<if
test=
" yearMonthAndParam != null "
>
<if
test=
" yearMonthAndParam != null "
>
,vbi.booked_date
,vbi.booked_date
</if>
</if>
...
@@ -86,6 +88,7 @@
...
@@ -86,6 +88,7 @@
LEFT JOIN branch_company bc2 ON v.subordinate_branch = bc2.id
LEFT JOIN branch_company bc2 ON v.subordinate_branch = bc2.id
LEFT JOIN vehicle_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1)
LEFT JOIN vehicle_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1)
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
LEFT JOIN vehicle_model vm ON v.model_id = vm.id
where
where
v.is_del=0
v.is_del=0
<if
test=
"mRangeDateEnd !=null"
>
<if
test=
"mRangeDateEnd !=null"
>
...
@@ -113,7 +116,7 @@
...
@@ -113,7 +116,7 @@
and v.insurance_company = #{insuranceCompany}
and v.insurance_company = #{insuranceCompany}
</if>
</if>
<if
test=
"belongToName !=null and belongToName != ''"
>
<if
test=
"belongToName !=null and belongToName != ''"
>
and v.belong_to_name
=
like concat('%',#{belongToName},'%')
and v.belong_to_name like concat('%',#{belongToName},'%')
</if>
</if>
<if
test=
"vin !=null and vin != ''"
>
<if
test=
"vin !=null and vin != ''"
>
and v.vin = #{vin}
and v.vin = #{vin}
...
@@ -173,12 +176,14 @@
...
@@ -173,12 +176,14 @@
) r ORDER BY r.parkBranchCompanyName
) r ORDER BY r.parkBranchCompanyName
</select>
</select>
<select
id=
"getByPageNotAllData"
parameterType=
"java.util.Map"
<select
id=
"getByPageNotAllData"
parameterType=
"java.util.Map"
resultType=
"com.xxfc.platform.vehicle.pojo.ResultVehicleVo"
>
resultType=
"com.xxfc.platform.vehicle.pojo.ResultVehicleVo"
>
SELECT r.* FROM (
SELECT r.* FROM (
select DISTINCT v.`id`,
select DISTINCT v.`id`,
v.`code`,
v.`code`,
v.`status`,
(CASE WHEN #{status} != null THEN #{status}
ELSE v.status END) status ,
v.number_plate,
v.number_plate,
v.brand,
v.brand,
-- IFNULL(v.park_branch_company_id,v.expect_destination_branch_company_id) AS subordinate_branch,
-- IFNULL(v.park_branch_company_id,v.expect_destination_branch_company_id) AS subordinate_branch,
...
@@ -208,7 +213,8 @@
...
@@ -208,7 +213,8 @@
v.receive_time,
v.receive_time,
v.update_time,
v.update_time,
v.model_id,
v.model_id,
v.mileage_last_update as mileage
v.mileage_last_update as mileage,
vm.name as vehicleType
<if
test=
" yearMonthAndParam !=null "
>
<if
test=
" yearMonthAndParam !=null "
>
,vbi.booked_date
,vbi.booked_date
</if>
</if>
...
@@ -225,6 +231,247 @@
...
@@ -225,6 +231,247 @@
LEFT JOIN branch_company bc2 ON v.subordinate_branch = bc2.id
LEFT JOIN branch_company bc2 ON v.subordinate_branch = bc2.id
LEFT JOIN vehicle_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1)
LEFT JOIN vehicle_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1)
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
LEFT JOIN vehicle_model vm ON v.model_id = vm.id
where
v.is_del=0
<if
test=
"companyList != null"
>
and ( v.park_branch_company_id in (
<trim
suffixOverrides=
","
>
<foreach
collection=
"companyList"
item=
"companyId"
>
#{companyId},
</foreach>
</trim>
)
<!--or v.expect_destination_branch_company_id in (
<trim suffixOverrides=",">
<foreach collection="companyList" item="companyId">
#{companyId},
</foreach>
</trim>
)-->
<!-- or v.subordinate_branch in (-->
<!-- <trim suffixOverrides=",">-->
<!-- <foreach collection="companyList" item="companyId">-->
<!-- #{companyId},-->
<!-- </foreach>-->
<!-- </trim>-->
)
</if>
<if
test=
"mRangeDateEnd !=null"
>
and v.maintenance_date
<
= #{mRangeDateEnd}
</if>
<if
test=
"modelId != null and modelId != ''"
>
and v.model_id = #{modelId}
</if>
<if
test=
"mRangeDateStart !=null"
>
and v.maintenance_date
>
= #{mRangeDateStart}
</if>
<if
test=
"aVRangeDateStart !=null"
>
and v.annual_verification_date
<
= #{aVRangeDateEnd}
</if>
<if
test=
"aVRangeDateEnd !=null"
>
and v.annual_verification_date
>
= #{aVRangeDateStart}
</if>
<if
test=
"insuranceDateRangeStart !=null"
>
and v.insurance_end_date
<
= #{insuranceDateRangeEnd}
</if>
<if
test=
"insuranceDateRangeEnd !=null"
>
and v.insurance_end_date
>
= #{insuranceDateRangeStart}
</if>
<if
test=
"insuranceCompany !=null"
>
and v.insurance_company = #{insuranceCompany}
</if>
<if
test=
"belongToName !=null"
>
and v.belong_to_name = #{belongToName}
</if>
<if
test=
"vin !=null and vin != ''"
>
and v.vin = #{vin}
</if>
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- </if>-->
<if
test=
"code !=null"
>
and v.code = #{code}
</if>
<if
test=
"status !=null"
>
and v.status = #{status}
</if>
<if
test=
"numberPlate !=null and numberPlate != ''"
>
and v.number_plate like concat('%',#{numberPlate},'%')
</if>
<if
test=
"brand !=null"
>
and v.brand = #{brand}
</if>
<if
test=
"useType !=null"
>
and v.use_type = #{useType}
</if>
-- 添加所属大区搜索条件
<if
test=
"zoneId !=null"
>
and bc.zone_id=#{zoneId}
</if>
<!-- 若需根据预定日期条件查询,针对换为位操作 -->
<if
test=
" yearMonthAndParam !=null "
>
<foreach
collection=
"yearMonthAndParam"
index=
"yearMonth"
item=
"andOperation"
>
and
( (vbi.`year_month` = #{yearMonth} or vbi.`year_month` is null) and
ifnull(vbi.`booked_date`,0)
&
#{andOperation.andOperationFactor} = #{andOperation.andOperationRs}
)
</foreach>
</if>
<if
test=
"subordinateBranch !=null "
>
and ( v.park_branch_company_id = #{subordinateBranch} or
v.expect_destination_branch_company_id=#{subordinateBranch} )
</if>
<if
test=
" addrProvince !=null or addrCity !=null or zoneId !=null "
>
<if
test=
"addrProvince !=null"
>
and bc.addr_province=#{addrProvince}
</if>
<if
test=
"addrCity !=null"
>
and bc.addr_city=#{addrCity}
</if>
<if
test=
"zoneId !=null"
>
and bc.zone_id=#{zoneId}
</if>
</if>
order by v.code
) r ORDER BY r.parkBranchCompanyName
</select>
<select
id=
"getVehicleExcelVo"
parameterType=
"java.util.Map"
resultType=
"com.xxfc.platform.vehicle.pojo.VehicleExcelVo"
>
SELECT r.* FROM (
select
v.`code`,
v.number_plate,
bc.name as parkBranchCompanyName,
c.val as useType,
vm.name as vehicleType
from vehicle v
<if
test=
" yearMonthAndParam != null "
>
left join
vehicle_book_info vbi on v.`id` = vbi.vehicle
</if>
-- 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
-- 停车分公司
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
-- 所属分公司
LEFT JOIN branch_company bc2 ON v.subordinate_branch = bc2.id
LEFT JOIN vehicle_book_record v2 on v2.vehicle_id = v.id
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
LEFT JOIN vehicle_model vm ON v.model_id = vm.id
LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code
where
v.is_del=0
<if
test=
"mRangeDateEnd !=null"
>
and v.maintenance_date
<
= #{mRangeDateEnd}
</if>
<if
test=
"modelId != null and modelId != ''"
>
and v.model_id = #{modelId}
</if>
<if
test=
"mRangeDateStart !=null"
>
and v.maintenance_date
>
= #{mRangeDateStart}
</if>
<if
test=
"aVRangeDateStart !=null"
>
and v.annual_verification_date
<
= #{aVRangeDateEnd}
</if>
<if
test=
"aVRangeDateEnd !=null"
>
and v.annual_verification_date
>
= #{aVRangeDateStart}
</if>
<if
test=
"insuranceDateRangeStart !=null"
>
and v.insurance_end_date
<
= #{insuranceDateRangeEnd}
</if>
<if
test=
"insuranceDateRangeEnd !=null"
>
and v.insurance_end_date
>
= #{insuranceDateRangeStart}
</if>
<if
test=
"insuranceCompany !=null"
>
and v.insurance_company = #{insuranceCompany}
</if>
<if
test=
"belongToName !=null"
>
and v.belong_to_name = #{belongToName}
</if>
<if
test=
"vin !=null and vin != ''"
>
and v.vin = #{vin}
</if>
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- </if>-->
<if
test=
"code !=null"
>
and v.code = #{code}
</if>
<if
test=
"status !=null and status != 6 and status != 7"
>
and v.status = #{status}
</if>
<if
test=
"status !=null and status == 6"
>
and v3.id is not NULL and v2.book_type = 3 and v3.state = 0
</if>
<if
test=
"status !=null and status == 7"
>
and v3.id is not NULL and v2.book_type = 6 and v3.state = 0
</if>
<if
test=
"numberPlate !=null and numberPlate != ''"
>
and v.number_plate like concat('%',#{numberPlate},'%')
</if>
<if
test=
"brand !=null"
>
and v.brand = #{brand}
</if>
<if
test=
"useType !=null"
>
and v.use_type = #{useType}
</if>
-- 添加所属大区搜索条件
<if
test=
"zoneId !=null"
>
and bc.zone_id=#{zoneId}
</if>
<!-- 若需根据预定日期条件查询,针对换为位操作 -->
<if
test=
" yearMonthAndParam !=null "
>
<foreach
collection=
"yearMonthAndParam"
index=
"yearMonth"
item=
"andOperation"
>
and
( (vbi.`year_month` = #{yearMonth} or vbi.`year_month` is null) and
ifnull(vbi.`booked_date`,0)
&
#{andOperation.andOperationFactor} = #{andOperation.andOperationRs}
)
</foreach>
</if>
<if
test=
"subordinateBranch !=null "
>
and ( v.park_branch_company_id = #{subordinateBranch})
</if>
<if
test=
" addrProvince !=null or addrCity !=null or zoneId !=null "
>
<if
test=
"addrProvince !=null"
>
and bc.addr_province=#{addrProvince}
</if>
<if
test=
"addrCity !=null"
>
and bc.addr_city=#{addrCity}
</if>
<if
test=
"zoneId !=null"
>
and bc.zone_id=#{zoneId}
</if>
</if>
order by v.code
) r ORDER BY r.parkBranchCompanyName
</select>
<select
id=
"getVehicleExcelVoNotAllData"
parameterType=
"java.util.Map"
resultType=
"com.xxfc.platform.vehicle.pojo.VehicleExcelVo"
>
SELECT r.* FROM (
select
v.`code`,
v.number_plate,
bc.name as parkBranchCompanyName,
c.val as useType,
vm.name as vehicleType
from vehicle v
<if
test=
" yearMonthAndParam !=null "
>
left join
vehicle_book_info vbi on v.`id` = vbi.vehicle
</if>
-- 停车分公司
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
-- 所属分公司
LEFT JOIN branch_company bc2 ON v.subordinate_branch = bc2.id
LEFT JOIN vehicle_model vm ON v.model_id = vm.id
LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code
where
where
v.is_del=0
v.is_del=0
<if
test=
"companyList != null"
>
<if
test=
"companyList != null"
>
...
@@ -275,7 +522,7 @@
...
@@ -275,7 +522,7 @@
and v.insurance_company = #{insuranceCompany}
and v.insurance_company = #{insuranceCompany}
</if>
</if>
<if
test=
"belongToName !=null and belongToName != ''"
>
<if
test=
"belongToName !=null and belongToName != ''"
>
and v.belong_to_name
=
like concat('%',#{belongToName},'%')
and v.belong_to_name like concat('%',#{belongToName},'%')
</if>
</if>
<if
test=
"vin !=null and vin != ''"
>
<if
test=
"vin !=null and vin != ''"
>
and v.vin = #{vin}
and v.vin = #{vin}
...
@@ -335,6 +582,8 @@
...
@@ -335,6 +582,8 @@
) r ORDER BY r.parkBranchCompanyName
) r ORDER BY r.parkBranchCompanyName
</select>
</select>
<select
id=
"lockByCode"
resultType=
"com.xxfc.platform.vehicle.entity.Vehicle"
<select
id=
"lockByCode"
resultType=
"com.xxfc.platform.vehicle.entity.Vehicle"
parameterType=
"com.xxfc.platform.vehicle.pojo.AddOrUpdateVehicleVo"
>
parameterType=
"com.xxfc.platform.vehicle.pojo.AddOrUpdateVehicleVo"
>
select
select
...
...
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