rain
2024-03-23 3d92c321b2159983fda398d2d5a2b2b93737c84d
图斑
7 files modified
43 ■■■■■ changed files
src/main/java/com/dji/sample/patches/controller/PatchesController.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/dao/PatchesMapper.java 9 ●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/model/PatchesEntity.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/service/PatchesService.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/service/impl/PatchesServiceImpl.java 4 ●●●● patch | view | raw | blame | history
src/main/resources/application-dev.yml 10 ●●●● patch | view | raw | blame | history
src/main/resources/application-prod.yml 10 ●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/patches/controller/PatchesController.java
@@ -2,9 +2,7 @@
import com.dji.sample.patches.model.PageBean;
import com.dji.sample.patches.service.impl.PatchesServiceImpl;
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;
@@ -20,9 +18,9 @@
    @GetMapping("/getPatches")
    public PageBean page(@RequestParam(defaultValue = "1") Integer page,
                         @RequestParam(defaultValue = "5") Integer pageSize,
                         Integer id, String bsm, String tuban, String dklx){
                         Integer id, String dkbh, String dkfw){
        //调用service分页查询
        PageBean pageBean =patchesServiceimpl.limitGet( id,  bsm, tuban, dklx,  page,  pageSize);
        PageBean pageBean =patchesServiceimpl.limitGet( id,  dkbh, dkfw,page, pageSize);
        return pageBean;
    }
}
src/main/java/com/dji/sample/patches/dao/PatchesMapper.java
@@ -3,14 +3,9 @@
import com.dji.sample.patches.model.PatchesEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
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,tuban ,dklx from tb_lot_info")
List<PatchesEntity> limitGet(@Param("id") Integer id, @Param("bsm") String bsm,
                             @Param("tuban") String tuban, @Param("dklx") String dklx);
    @Select("select id ,dkbh,dkfw  from tb_lot_info")
    List<PatchesEntity> limitGet(@Param("id") Integer id, @Param("dkbh") String dkbh, @Param("dkfw") String dkfw);
}
src/main/java/com/dji/sample/patches/model/PatchesEntity.java
@@ -61,8 +61,6 @@
    @TableField("sjlx")
    private String sjlx;
    @TableField("tuban")
    private String tuban;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
src/main/java/com/dji/sample/patches/service/PatchesService.java
@@ -7,5 +7,5 @@
import java.sql.Array;
public interface PatchesService {
    PageBean limitGet (Integer id, String bsm, String tuban , String dklx, int page, int pageSize);
    PageBean limitGet (Integer id, String dkbh, String dkfw , int page, int pageSize);
}
src/main/java/com/dji/sample/patches/service/impl/PatchesServiceImpl.java
@@ -20,13 +20,13 @@
    private PatchesMapper mapper;
    @Override
    public PageBean limitGet(Integer id, String bsm, String tuban, String dklx, int page, int pageSize) {
    public PageBean limitGet(Integer id, String dkbh, String dkfw,int page, int pageSize) {
        //1. 设置分页参数
        PageHelper.startPage(page,pageSize);
        //2. 执行查询
        List<PatchesEntity> PatchersList = mapper.limitGet(id,bsm,tuban,dklx);
        List<PatchesEntity> PatchersList = mapper.limitGet(id,dkbh,dkfw);
        com.github.pagehelper.Page<PatchesEntity> p = (Page<PatchesEntity>) PatchersList;
        //3. 封装PageBean对象
src/main/resources/application-dev.yml
@@ -1,12 +1,12 @@
#spring
spring:
  datasource:
#    url: jdbc:mysql://182.108.40.114:3308/drone_zt_test?useSSL=false&allowPublicKeyRetrieval=true
#    username: root
#    password: yshb@123
    url: jdbc:mysql://192.168.2.104:3306/drone_test?useSSL=false&allowPublicKeyRetrieval=true
    url: jdbc:mysql://182.108.40.114:3308/drone_zt_test?useSSL=false&allowPublicKeyRetrieval=true
    username: root
    password: 123456
    password: yshb@123
#    url: jdbc:mysql://192.168.2.104:3306/drone_test?useSSL=false&allowPublicKeyRetrieval=true
#    username: root
#    password: 123456
  redis:
    host: 127.0.0.1
src/main/resources/application-prod.yml
@@ -1,12 +1,12 @@
#spring
spring:
  datasource:
#      url: jdbc:mysql://182.108.40.114:3308/drone_zt_test?useSSL=false&allowPublicKeyRetrieval=true
#      username: root
#      password: yshb@123
      url: jdbc:mysql://127.0.0.1:3306/drone_test?useSSL=false&allowPublicKeyRetrieval=true
      url: jdbc:mysql://182.108.40.114:3308/drone_zt_test?useSSL=false&allowPublicKeyRetrieval=true
      username: root
      password: jxpskj_2018
      password: yshb@123
#      url: jdbc:mysql://127.0.0.1:3306/drone_test?useSSL=false&allowPublicKeyRetrieval=true
#      username: root
#      password: jxpskj_2018
  redis:
    host: 127.0.0.1