Commit 6f3806c3 authored by jiaorz's avatar jiaorz

Merge branch 'master-vehicle-bg' into dev

parents 689b4731 16d00b54
package com.xxfc.platform.vehicle.pojo;
import lombok.Data;
@Data
public class BranchCompanyVehicleCount {
private String parkBranchCompanyName;
private Integer count;
}
...@@ -1516,7 +1516,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -1516,7 +1516,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
return vehicles.stream().map(Vehicle::getId).collect(Collectors.toList()); return vehicles.stream().map(Vehicle::getId).collect(Collectors.toList());
} }
public List<VehicleExcelVo> getAllVehicleInfo() { public List<BranchCompanyVehicleCount> getAllVehicleInfo() {
return mapper.getAllVehicleInfo(); return mapper.getAllVehicleInfo();
} }
......
...@@ -6,6 +6,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz; ...@@ -6,6 +6,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.xxfc.platform.vehicle.entity.Vehicle; import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.mapper.VehicleMapper; import com.xxfc.platform.vehicle.mapper.VehicleMapper;
import com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCount;
import com.xxfc.platform.vehicle.pojo.ResultVehicleVo; import com.xxfc.platform.vehicle.pojo.ResultVehicleVo;
import com.xxfc.platform.vehicle.pojo.VehicleExcelVo; import com.xxfc.platform.vehicle.pojo.VehicleExcelVo;
import com.xxfc.platform.vehicle.pojo.VehiclePageQueryVo; import com.xxfc.platform.vehicle.pojo.VehiclePageQueryVo;
...@@ -93,7 +94,7 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl ...@@ -93,7 +94,7 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
} }
public List<VehicleExcelVo> getAllVehicleInfo() { public List<BranchCompanyVehicleCount> getAllVehicleInfo() {
return vehicleBiz.getAllVehicleInfo(); return vehicleBiz.getAllVehicleInfo();
} }
......
...@@ -54,5 +54,5 @@ public interface VehicleMapper extends Mapper<Vehicle> { ...@@ -54,5 +54,5 @@ public interface VehicleMapper extends Mapper<Vehicle> {
@Select("select `id` from `vehicle` where `is_del`=0") @Select("select `id` from `vehicle` where `is_del`=0")
List<String> findExistVehicleIds(); List<String> findExistVehicleIds();
List<VehicleExcelVo> getAllVehicleInfo(); List<BranchCompanyVehicleCount> getAllVehicleInfo();
} }
\ No newline at end of file
...@@ -10,6 +10,7 @@ import com.github.wxiaoqi.security.common.exception.BaseException; ...@@ -10,6 +10,7 @@ import com.github.wxiaoqi.security.common.exception.BaseException;
import com.xxfc.platform.vehicle.biz.VehicleBiz; import com.xxfc.platform.vehicle.biz.VehicleBiz;
import com.xxfc.platform.vehicle.biz.VehicleInformationDownloadBiz; import com.xxfc.platform.vehicle.biz.VehicleInformationDownloadBiz;
import com.xxfc.platform.vehicle.common.BaseController; import com.xxfc.platform.vehicle.common.BaseController;
import com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCount;
import com.xxfc.platform.vehicle.pojo.VehicleExcelVo; import com.xxfc.platform.vehicle.pojo.VehicleExcelVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -70,11 +71,10 @@ public class VehicleInformationDownloadController extends BaseController<Vehicle ...@@ -70,11 +71,10 @@ public class VehicleInformationDownloadController extends BaseController<Vehicle
@GetMapping("/app/unauth/import") @GetMapping("/app/unauth/import")
public void exportVehicleInfo() throws Exception { public void exportVehicleInfo() throws Exception {
List<VehicleExcelVo> rows = baseBiz.getAllVehicleInfo(); List<BranchCompanyVehicleCount> rows = baseBiz.getAllVehicleInfo();
ExcelWriter writer = ExcelUtil.getWriter(true); ExcelWriter writer = ExcelUtil.getWriter(true);
writer.addHeaderAlias("numberPlate", "车牌号");
writer.addHeaderAlias("code", "车辆编码");
writer.addHeaderAlias("parkBranchCompanyName", "停靠分公司"); writer.addHeaderAlias("parkBranchCompanyName", "停靠分公司");
writer.addHeaderAlias("count", "车辆数量");
// 一次性写出内容,使用默认样式,强制输出标题 // 一次性写出内容,使用默认样式,强制输出标题
writer.write(rows, true); writer.write(rows, true);
//response为HttpServletResponse对象 //response为HttpServletResponse对象
......
...@@ -591,10 +591,18 @@ ...@@ -591,10 +591,18 @@
</select> </select>
<!--导出分公司停靠所有车辆--> <!--导出分公司停靠所有车辆-->
<select id="getAllVehicleInfo" resultType="com.xxfc.platform.vehicle.pojo.VehicleExcelVo"> <select id="getAllVehicleInfo" resultType="com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCount">
select b1.name as parkBranchCompanyName, v1.number_plate as numberPlate, v1.code as code from branch_company b1 SELECT
left join vehicle v1 on v1.park_branch_company_id = b1.id b1. NAME AS parkBranchCompanyName,
where b1.is_del = 0 and v1.is_del = 0 count(v1.id) as count
FROM
branch_company b1
LEFT JOIN vehicle v1 ON v1.park_branch_company_id = b1.id
WHERE
b1.is_del = 0
AND v1.is_del = 0
GROUP BY b1.`name`
order by b1.`name`
</select> </select>
<select id="lockByCode" resultType="com.xxfc.platform.vehicle.entity.Vehicle" <select id="lockByCode" resultType="com.xxfc.platform.vehicle.entity.Vehicle"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment