rain
2024-03-23 08f58c4a65fc6cbdb530ecac9153b3904763d8b6
图斑
6 files modified
35 ■■■■■ changed files
src/main/java/com/dji/sample/patches/controller/PatchesController.java 7 ●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/dao/PatchesMapper.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/model/PatchesEntity.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/service/PatchesService.java 7 ●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/service/impl/PatchesServiceImpl.java 7 ●●●● patch | view | raw | blame | history
src/main/resources/application-dev.yml 2 ●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/controller/PatchesController.java
@@ -2,12 +2,15 @@
import com.dji.sample.patches.model.PageBean;
import com.dji.sample.patches.service.impl.PatchesServiceImpl;
import org.opengis.geometry.coordinate.Polygon;
import org.locationtech.jts.geom.Geometry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.geo.Polygon;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.sql.Array;
@RequestMapping("${url.patches.prefix}${url.patches.version}")
@RestController
@@ -17,7 +20,7 @@
    @GetMapping("/getPatches")
    public PageBean page(@RequestParam(defaultValue = "1") Integer page,
                         @RequestParam(defaultValue = "5") Integer pageSize,
                         Integer id, String bsm, Polygon dkfw, String dklx){
                         Integer id, String bsm, String dkfw, String dklx){
        //调用service分页查询
        PageBean pageBean =patchesServiceimpl.limitGet( id,  bsm, dkfw, dklx,  page,  pageSize);
        return pageBean;
src/main/java/com/dji/sample/patches/dao/PatchesMapper.java
@@ -3,12 +3,14 @@
import com.dji.sample.patches.model.PatchesEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.opengis.geometry.coordinate.Polygon;
import org.locationtech.jts.geom.Geometry;
import org.springframework.data.geo.Polygon;
import java.sql.Array;
import java.util.List;
public interface PatchesMapper {
    @Select("select id ,bsm,dkfw ,dklx from tb_lot_info")
List<PatchesEntity> limitGet(@Param("id") Integer id, @Param("bsm") String bsm,
                             @Param("dkfw") Polygon dkfw,@Param("dklx") String dklx);
                             @Param("dkfw") String dkfw, @Param("dklx") String dklx);
}
src/main/java/com/dji/sample/patches/model/PatchesEntity.java
@@ -6,10 +6,12 @@
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.opengis.geometry.coordinate.Polygon;
import org.locationtech.jts.geom.Polygon;
import java.awt.*;
import java.io.Serializable;
import java.sql.Array;
import java.time.LocalDateTime;
@Data
@@ -59,7 +61,7 @@
    private String kzxx;
    @TableField("dkfw")
    private Polygon dkfw;
    private String dkfw;
    @TableField("sjlx")
    private String sjlx;
src/main/java/com/dji/sample/patches/service/PatchesService.java
@@ -1,8 +1,11 @@
package com.dji.sample.patches.service;
import com.dji.sample.patches.model.PageBean;
import org.opengis.geometry.coordinate.Polygon;
import org.locationtech.jts.geom.Geometry;
import org.springframework.data.geo.Polygon;
import java.sql.Array;
public interface PatchesService {
    PageBean limitGet (Integer id,String bsm, Polygon dkfw ,String dklx,int page, int pageSize);
    PageBean limitGet (Integer id, String bsm, String dkfw , String dklx, int page, int pageSize);
}
src/main/java/com/dji/sample/patches/service/impl/PatchesServiceImpl.java
@@ -6,10 +6,13 @@
import com.dji.sample.patches.service.PatchesService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.opengis.geometry.coordinate.Polygon;
import lombok.NoArgsConstructor;
import org.locationtech.jts.geom.Geometry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.geo.Polygon;
import org.springframework.stereotype.Service;
import java.sql.Array;
import java.util.List;
@Service
public class PatchesServiceImpl implements PatchesService {
@@ -17,7 +20,7 @@
    private PatchesMapper mapper;
    @Override
    public PageBean limitGet(Integer id, String bsm, Polygon dkfw, String dklx, int page, int pageSize) {
    public PageBean limitGet(Integer id, String bsm, String dkfw, String dklx, int page, int pageSize) {
        //1. 设置分页参数
        PageHelper.startPage(page,pageSize);
src/main/resources/application-dev.yml
@@ -1,7 +1,7 @@
#spring
spring:
  datasource:
      url: jdbc:mysql://182.108.40.114:3308/drone_zt_test?useSSL=false&allowPublicKeyRetrieval=true
      url: jdbc:mysql://182.108.40.114:3308/drone_zt_test?useUnicode=true&characterEncoding=utf8mb4
      username: root
      password: yshb@123