车辆数据表的反向生成代码

main
topsun 2 years ago
parent 5ee65d6685
commit d118afb4c1

@ -32,6 +32,19 @@
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- 引入自动生成代码jar包-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.28</version>
</dependency>
</dependencies>
</project>

@ -0,0 +1,20 @@
package com.taxi.servicedriveruser.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
/**
* <p>
*
* </p>
*
* @author author
* @since 2023-04-28
*/
@Controller
@RequestMapping("/car")
public class CarController {
}

@ -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;
/**
* <p>
*
* </p>
*
* @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;
/**
* 12345绿9
*/
private String plateColor;
/**
*
*/
private Integer seats;
/**
*
*/
private String brand;
/**
*
*/
private String model;
/**
*
*/
private String vehicleType;
/**
*
*/
private String ownerName;
/**
* 12
*/
private String vehicleColor;
/**
*
*/
private String engineId;
private String vin;
/**
*
*/
private LocalDate certifyDateA;
/**
* (123459
*/
private String fueType;
/**
*
*/
private String engineDisplace;
/**
*
*/
private String transAgency;
/**
*
*/
private String transArea;
/**
*
*/
private LocalDate transDateStart;
/**
*
*/
private LocalDate transDateEnd;
/**
*
*/
private LocalDate certifyDateB;
/**
* (012
*/
private String fixState;
/**
*
*/
private LocalDate nextFixDate;
/**
* 012
*/
private String checkState;
/**
*
*/
private String feePrintId;
/**
*
*/
private String gpsBrand;
/**
*
*/
private String gpsModel;
/**
*
*/
private LocalDate gpsInstallDate;
/**
*
*/
private LocalDate registerDate;
/**
* 123
*/
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;
}

@ -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();
}
}

@ -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;
/**
* <p>
* Mapper
* </p>
*
* @author author
* @since 2023-04-28
*/
@Repository
public interface CarMapper extends BaseMapper<Car> {
}

@ -0,0 +1,7 @@
package com.taxi.servicedriveruser.service;
import org.springframework.stereotype.Service;
@Service
public class CarService {
}
Loading…
Cancel
Save