src/main/java/com/moral/entity/Area.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/moral/entity/City.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/moral/entity/Province.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/moral/entity/RealTimeWeather.java | ●●●●● patch | view | raw | blame | history | |
src/main/resources/mapper/AreaMapper.xml | ●●●●● patch | view | raw | blame | history | |
src/main/resources/mapper/CityMapper.xml | ●●●●● patch | view | raw | blame | history | |
src/main/resources/mapper/MonitorPointMapper.xml | ●●●●● patch | view | raw | blame | history | |
src/main/resources/mapper/ProvinceMapper.xml | ●●●●● patch | view | raw | blame | history | |
src/main/resources/mapper/RealTimeWeatherMapper.xml | ●●●●● patch | view | raw | blame | history | |
src/main/resources/mapper/mybatis-config.xml | ●●●●● patch | view | raw | blame | history |
src/main/java/com/moral/entity/Area.java
@@ -7,6 +7,7 @@ @Data public class Area { @Id private Integer areaCode; private String areaName; src/main/java/com/moral/entity/City.java
@@ -7,6 +7,7 @@ @Data public class City { @Id private Integer cityCode; private String cityName; src/main/java/com/moral/entity/Province.java
@@ -7,6 +7,7 @@ @Data public class Province { @Id private Integer provinceCode; private String provinceName; src/main/java/com/moral/entity/RealTimeWeather.java
New file @@ -0,0 +1,15 @@ package com.moral.entity; import java.util.Date; import lombok.Data; import javax.persistence.Id; @Data public class RealTimeWeather { @Id private Integer monitorPointId; private Date time; private String json; } src/main/resources/mapper/AreaMapper.xml
@@ -1,7 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <mapper namespace="com.moral.mapper.AreaMapper"> <select id="getAreaByAreaCode" resultType="com.moral.entity.Area"> <resultMap id="BaseResultMap" type="com.moral.entity.Area" > <id column="area_code" property="areaCode" jdbcType="INTEGER" /> <result column="area_name" property="areaName" jdbcType="VARCHAR" /> <result column="city_code" property="cityCode" jdbcType="INTEGER" /> </resultMap> <select id="getAreaByAreaCode" resultType="com.moral.entity.Area" resultMap="BaseResultMap"> select * from area where area_code=#{areaCode} </select> </mapper> src/main/resources/mapper/CityMapper.xml
@@ -1,7 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <mapper namespace="com.moral.mapper.CityMapper"> <select id="getCityByCityCode" resultType="com.moral.entity.City"> <resultMap id="BaseResultMap" type="com.moral.entity.City"> <id column="city_code" property="cityCode" jdbcType="INTEGER"/> <result column="city_name" property="cityName" jdbcType="VARCHAR"/> <result column="province_code" property="provinceCode" jdbcType="INTEGER"/> </resultMap> <select id="getCityByCityCode" resultType="com.moral.entity.City" resultMap="BaseResultMap"> select * from city where city_code=#{cityCode} </select> </mapper> src/main/resources/mapper/MonitorPointMapper.xml
@@ -1,7 +1,21 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.moral.mapper.MonitorPointMapper"> <select id="getMonitorPointList" resultType="com.moral.entity.MonitorPoint"> <resultMap id="BaseResultMap" type="com.moral.entity.MonitorPoint"> <id column="id" jdbcType="INTEGER" property="id" /> <result column="name" jdbcType="VARCHAR" property="name" /> <result column="longitude" jdbcType="REAL" property="longitude" /> <result column="latitude" jdbcType="REAL" property="latitude" /> <result column="province_code" jdbcType="INTEGER" property="provinceCode" /> <result column="city_code" jdbcType="INTEGER" property="cityCode" /> <result column="area_code" jdbcType="INTEGER" property="areaCode" /> <result column="organization_id" jdbcType="INTEGER" property="organizationId" /> <result column="address" jdbcType="VARCHAR" property="address" /> <result column="is_delete" jdbcType="CHAR" property="isDelete" /> <result column="description" jdbcType="VARCHAR" property="description" /> <result column="state" jdbcType="INTEGER" property="state" /> </resultMap> <select id="getMonitorPointList" resultType="com.moral.entity.MonitorPoint" resultMap="BaseResultMap"> select * from monitor_point </select> </mapper> src/main/resources/mapper/ProvinceMapper.xml
@@ -1,7 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <mapper namespace="com.moral.mapper.ProvinceMapper"> <select id="getProvinceByProvinceCode" resultType="com.moral.entity.Province"> <resultMap id="BaseResultMap" type="com.moral.entity.Province" > <id column="province_code" property="provinceCode" jdbcType="INTEGER" /> <result column="province_name" property="provinceName" jdbcType="VARCHAR" /> </resultMap> <select id="getProvinceByProvinceCode" resultType="com.moral.entity.Province" resultMap="BaseResultMap"> select * from province where province_code=#{provinceCode} </select> </mapper> src/main/resources/mapper/RealTimeWeatherMapper.xml
@@ -1,6 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.moral.mapper.RealTimeWeatherMapper"> <resultMap id="BaseResultMap" type="com.moral.entity.RealTimeWeather" > <id column="monitor_point_id" property="monitorPointId" jdbcType="INTEGER" /> </resultMap> <insert id="insertRealTimeWeather"> insert into realtime_weather src/main/resources/mapper/mybatis-config.xml
File was deleted