From d118afb4c1dcd9c6dde81987e8f4aae797bb3b1e Mon Sep 17 00:00:00 2001 From: topsun Date: Fri, 28 Apr 2023 01:48:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E6=95=B0=E6=8D=AE=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E5=8F=8D=E5=90=91=E7=94=9F=E6=88=90=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service-driver-user/pom.xml | 13 ++ .../controller/CarController.java | 20 ++ .../taxi/servicedriveruser/entity/Car.java | 199 ++++++++++++++++++ .../generator/MysqlGenerator.java | 24 +++ .../servicedriveruser/mapper/CarMapper.java | 18 ++ .../servicedriveruser/service/CarService.java | 7 + 6 files changed, 281 insertions(+) create mode 100644 online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/controller/CarController.java create mode 100644 online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/entity/Car.java create mode 100644 online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/generator/MysqlGenerator.java create mode 100644 online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/mapper/CarMapper.java create mode 100644 online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/service/CarService.java diff --git a/online-taxi-public/service-driver-user/pom.xml b/online-taxi-public/service-driver-user/pom.xml index 9b2e217..9b90cf7 100644 --- a/online-taxi-public/service-driver-user/pom.xml +++ b/online-taxi-public/service-driver-user/pom.xml @@ -32,6 +32,19 @@ com.alibaba.cloud spring-cloud-starter-alibaba-nacos-discovery + + + + com.baomidou + mybatis-plus-generator + 3.5.1 + + + + org.freemarker + freemarker + 2.3.28 + \ No newline at end of file diff --git a/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/controller/CarController.java b/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/controller/CarController.java new file mode 100644 index 0000000..10de689 --- /dev/null +++ b/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/controller/CarController.java @@ -0,0 +1,20 @@ +package com.taxi.servicedriveruser.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.stereotype.Controller; + +/** + *

+ * 前端控制器 + *

+ * + * @author author + * @since 2023-04-28 + */ +@Controller +@RequestMapping("/car") +public class CarController { + +} diff --git a/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/entity/Car.java b/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/entity/Car.java new file mode 100644 index 0000000..7e7e3e8 --- /dev/null +++ b/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/entity/Car.java @@ -0,0 +1,199 @@ +package com.taxi.servicedriveruser.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + *

+ * + *

+ * + * @author author + * @since 2023-04-28 + */ +@Data +public class Car implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 车辆所在城市 + */ + private String address; + + /** + * 车辆号牌 + */ + private String vehicleNo; + + /** + * 车牌颜色(1:蓝色,2:黄色,3:黑色,4:白色,5:绿色,9:其他) + */ + private String plateColor; + + /** + * 核定载客位 + */ + private Integer seats; + + /** + * 车辆厂牌 + */ + private String brand; + + /** + * 车辆型号 + */ + private String model; + + /** + * 车辆类型 + */ + private String vehicleType; + + /** + * 车辆所有人 + */ + private String ownerName; + + /** + * 车辆颜色(1:白色,2:黑色) + */ + private String vehicleColor; + + /** + * 发动机号 + */ + private String engineId; + + private String vin; + + /** + * 车辆注册日期 + */ + private LocalDate certifyDateA; + + /** + * 燃料类型(1:汽油,2:柴油,3:天然气,4:液化气,5:电动,9:其他) + */ + private String fueType; + + /** + * 发动机排量(毫升) + */ + private String engineDisplace; + + /** + * 车辆运输证发证机构 + */ + private String transAgency; + + /** + * 车辆经验区域 + */ + private String transArea; + + /** + * 车辆运输证有效期起 + */ + private LocalDate transDateStart; + + /** + * 车辆运输证有效期止 + */ + private LocalDate transDateEnd; + + /** + * 车辆初次登记日期 + */ + private LocalDate certifyDateB; + + /** + * 车辆的检修状态(0:未检修,1:已检修,2:未知) + */ + private String fixState; + + /** + * 下次年检时间 + */ + private LocalDate nextFixDate; + + /** + * 年度审验状态(0:未年审,1:年审合格,2:年审不合格) + */ + private String checkState; + + /** + * 发票打印设备序列号 + */ + private String feePrintId; + + /** + * 卫星定位装置品牌 + */ + private String gpsBrand; + + /** + * 卫星型号 + */ + private String gpsModel; + + /** + * 卫星定位设备安装日期 + */ + private LocalDate gpsInstallDate; + + /** + * 报备日期 + */ + private LocalDate registerDate; + + /** + * 服务类型:1:网络预约出租车,2:巡游出租车,3:私人小客车合乘 + */ + private Integer commercialType; + + /** + * 运价编码 关联计价规则 + */ + private String fareType; + + /** + * 状态:0:有效,1:失效 + */ + private Boolean state; + + /** + * 终端Id + */ + private String tid; + + /** + * 轨迹ID + */ + private String trid; + + /** + * 轨迹名称 + */ + private String trname; + + /** + * 创建时间 + */ + private LocalDateTime gmtCreate; + + /** + * 修改时间 + */ + private LocalDateTime gmtModified; + +} diff --git a/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/generator/MysqlGenerator.java b/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/generator/MysqlGenerator.java new file mode 100644 index 0000000..97ab640 --- /dev/null +++ b/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/generator/MysqlGenerator.java @@ -0,0 +1,24 @@ +package com.taxi.servicedriveruser.generator; + +import com.baomidou.mybatisplus.generator.FastAutoGenerator; +import com.baomidou.mybatisplus.generator.config.OutputFile; +import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; + +import java.util.Collections; + +public class MysqlGenerator { + + public static void main(String[] args) { + FastAutoGenerator.create("jdbc:mysql://localhost:3306/service-driver-user?characterEncoding=utf-8&serverTimezone=GMT%2B8", + "root", "topsun123") + .globalConfig(builder -> { + builder.author("author").fileOverride().outputDir("/Users/topsun/Documents/workSpce/gitlab-projectTest/online-taxi-public/service-driver-user/src/main/java"); + }).packageConfig(builder -> { + builder.parent("com.taxi.servicedriveruser").pathInfo(Collections.singletonMap(OutputFile.mapperXml, + "/Users/topsun/Documents/workSpce/gitlab-projectTest/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/mapper")); + }).strategyConfig(builder -> { + builder.addInclude("car"); + }).templateEngine(new FreemarkerTemplateEngine()).execute(); + + } +} diff --git a/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/mapper/CarMapper.java b/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/mapper/CarMapper.java new file mode 100644 index 0000000..ed05902 --- /dev/null +++ b/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/mapper/CarMapper.java @@ -0,0 +1,18 @@ +package com.taxi.servicedriveruser.mapper; + +import com.taxi.servicedriveruser.entity.Car; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author author + * @since 2023-04-28 + */ +@Repository +public interface CarMapper extends BaseMapper { + +} diff --git a/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/service/CarService.java b/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/service/CarService.java new file mode 100644 index 0000000..4ebc020 --- /dev/null +++ b/online-taxi-public/service-driver-user/src/main/java/com/taxi/servicedriveruser/service/CarService.java @@ -0,0 +1,7 @@ +package com.taxi.servicedriveruser.service; + +import org.springframework.stereotype.Service; + +@Service +public class CarService { +}