| | |
| | | |
| | | 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; |
| | |
| | | @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; |
| | | } |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | @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") |
| | |
| | | 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); |
| | | } |
| | |
| | | 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对象 |
| | |
| | | #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 |
| | |
| | | #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 |