From 406909d42262c1b1ea7659847412aa1d04776f24 Mon Sep 17 00:00:00 2001 From: "DESKTOP-4U0TDEF\\20371" <2037158277@qq.com> Date: Thu, 15 Jul 2021 15:33:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=BA=86=E5=B1=B1=E4=B8=9C?= =?UTF-8?q?=E7=9C=81=E5=90=84=E5=B8=82=E4=BF=A1=E6=81=AF=E7=9A=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xkrs/model/entity/CityEntity.java | 137 ++++++++++++++++++ .../xkrs/model/entity/FirePointEntity.java | 4 +- 2 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/xkrs/model/entity/CityEntity.java diff --git a/src/main/java/com/xkrs/model/entity/CityEntity.java b/src/main/java/com/xkrs/model/entity/CityEntity.java new file mode 100644 index 0000000..8739fc3 --- /dev/null +++ b/src/main/java/com/xkrs/model/entity/CityEntity.java @@ -0,0 +1,137 @@ +package com.xkrs.model.entity; + +import javax.persistence.*; +import java.io.Serializable; + +/** + * @author xkrs + */ +@Entity +@Table(name = "city") +public class CityEntity implements Serializable { + /** + * 主键id + */ + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "city_seq_gen") + @SequenceGenerator(name = "city_seq_gen", sequenceName = "city_id_seq",allocationSize = 1) + private Integer id; + + /** + * 省名称 + */ + @Column(length = 65, columnDefinition = "varchar(65)") + private String proName; + + /** + * 省编码 + */ + @Column(length = 65, columnDefinition = "varchar(65)") + private String proCode; + + /** + * 市名称 + */ + @Column(length = 65, columnDefinition = "varchar(65)") + private String cityName; + + /** + * 市编码 + */ + @Column(length = 65, columnDefinition = "varchar(65)") + private String cityCode; + + /** + * 市纬度 + */ + @Column(length = 65, columnDefinition = "varchar(65)") + private String cityLatitude; + + /** + * 市经度 + */ + @Column(length = 65, columnDefinition = "varchar(65)") + private String cityLongitude; + + public CityEntity() { + } + + public CityEntity(Integer id, String proName, String proCode, String cityName, String cityCode, String cityLatitude, String cityLongitude) { + this.id = id; + this.proName = proName; + this.proCode = proCode; + this.cityName = cityName; + this.cityCode = cityCode; + this.cityLatitude = cityLatitude; + this.cityLongitude = cityLongitude; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getProName() { + return proName; + } + + public void setProName(String proName) { + this.proName = proName; + } + + public String getProCode() { + return proCode; + } + + public void setProCode(String proCode) { + this.proCode = proCode; + } + + public String getCityName() { + return cityName; + } + + public void setCityName(String cityName) { + this.cityName = cityName; + } + + public String getCityCode() { + return cityCode; + } + + public void setCityCode(String cityCode) { + this.cityCode = cityCode; + } + + public String getCityLatitude() { + return cityLatitude; + } + + public void setCityLatitude(String cityLatitude) { + this.cityLatitude = cityLatitude; + } + + public String getCityLongitude() { + return cityLongitude; + } + + public void setCityLongitude(String cityLongitude) { + this.cityLongitude = cityLongitude; + } + + @Override + public String toString() { + return "City{" + + "id=" + id + + ", proName='" + proName + '\'' + + ", proCode='" + proCode + '\'' + + ", cityName='" + cityName + '\'' + + ", cityCode='" + cityCode + '\'' + + ", cityLatitude='" + cityLatitude + '\'' + + ", cityLongitude='" + cityLongitude + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/model/entity/FirePointEntity.java b/src/main/java/com/xkrs/model/entity/FirePointEntity.java index 8a3717b..fe79a01 100644 --- a/src/main/java/com/xkrs/model/entity/FirePointEntity.java +++ b/src/main/java/com/xkrs/model/entity/FirePointEntity.java @@ -14,8 +14,8 @@ public class FirePointEntity implements Serializable { * 指定主键,建立自增序列,主键值取自序列 */ @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sys_user_seq_gen") - @SequenceGenerator(name = "sys_user_seq_gen", sequenceName = "sys_user_id_seq",allocationSize = 1) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "fire_point_seq_gen") + @SequenceGenerator(name = "fire_point_seq_gen", sequenceName = "fire_point_id_seq",allocationSize = 1) private Integer id; /**