src/main/java/com/yssh/controller/LocationController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/application-dev.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/mapper/LocationMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/yssh/controller/LocationController.java
@@ -39,7 +39,7 @@ @GetMapping("/query") public Result query( @RequestParam(value = "name", required = false) String name, @RequestParam(value = "type", required = true) String type) { @RequestParam(value = "type", required = false) String type) { List<Location> data = locationService.query(name, type); return Result.OK(data); } src/main/resources/application-dev.yml
@@ -3,8 +3,8 @@ datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver #url: jdbc:mysql://192.168.20.228:3306/yssh?useUnicode=true&rewriteBatchedStatements=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://192.168.22.31:3306/yssh?useUnicode=true&rewriteBatchedStatements=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://192.168.20.228:3306/yssh?useUnicode=true&rewriteBatchedStatements=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8 #url: jdbc:mysql://192.168.22.31:3306/yssh?useUnicode=true&rewriteBatchedStatements=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8 username: root password: 123456 # 初始连接数 src/main/resources/mapper/LocationMapper.xml
@@ -13,8 +13,8 @@ SELECT id, name, type, format(lon, 6) lon, format(lat, 6) lat FROM location </sql> <select id="selectByXY" resultMap="locationResult"> <include refid="locationSql"></include> <select id="selectByXY" resultType="com.yssh.entity.Location"> select id, name, type, lon, lat from location <where> lon between (#{x} - 0.0009) and (#{x} + 0.0009) and @@ -22,13 +22,13 @@ </where> </select> <select id="selectVocAddrs" resultMap="locationResult"> <select id="selectVocAddrs" resultType="com.yssh.entity.Location"> select id, x "lon", y "lat", addr "name" from voc_addr where length(addr) > 0; </select> <select id="query" resultMap="locationResult"> <select id="query" resultType="com.yssh.entity.Location"> <include refid="locationSql"></include> <where> <if test="name != null and name != ''"> @@ -39,9 +39,10 @@ </if> </where> </select> <select id="getAll" resultMap="locationResult"> <include refid="locationSql"></include> <!--include refid="locationSql"></include--> <select id="getAll" resultType="com.yssh.entity.Location"> select id, name, type, lon, lat from location; </select> <insert id="insertLocation" parameterType="com.yssh.entity.Location">