管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-12-05 c3ca2f26a73dc5fc7dc6f652a159c2697abd53cf
1
已修改5个文件
59 ■■■■ 文件已修改
src/main/java/com/lf/server/controller/data/ProjectController.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/mapper/data/DirMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/data/DirService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/data/DirMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
说明.txt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/data/ProjectController.java
@@ -1,5 +1,8 @@
package com.lf.server.controller.data;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lf.server.annotation.SysLog;
import com.lf.server.controller.all.BaseController;
import com.lf.server.entity.all.ResponseMsg;
@@ -24,9 +27,7 @@
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * é¡¹ç›®ç®¡ç†
@@ -64,11 +65,12 @@
    }
    @SysLog()
    @ApiOperation(value = "查询所有目录数据")
    @GetMapping(value = "/selectDirAll")
    public ResponseMsg<List<DirEntity>> selectDirAll() {
    @ApiOperation(value = "查询根目录")
    @GetMapping(value = "/selectDirRoot")
    public ResponseMsg<List<DirEntity>> selectDirRoot() {
        try {
            List<DirEntity> list = dirService.selectDirAll();
            List<DirEntity> list = dirService.selectDirRoot();
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
@@ -76,22 +78,26 @@
    }
    @SysLog()
    @ApiOperation(value = "根据目录ID查询")
    @ApiOperation(value = "分页查询并返回记录数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dirid", value = "目录ID", dataType = "int", paramType = "query", example = "0")
            @ApiImplicitParam(name = "dirid", value = "目录ID", dataType = "Integer", paramType = "query", example = "1"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/selectByDirid")
    public ResponseMsg<BsprojectEntity> selectByDirid(int dirid) {
    @GetMapping(value = "/selectByPageAndCount")
    public ResponseMsg<Object> selectByPageAndCount(Integer dirid, Integer pageSize, Integer pageIndex) {
        try {
            Map<String, Object> map = new HashMap<>(1);
            map.put("dirid", dirid);
            List<BsprojectEntity> list = bsprojectMapper.selectByMap(map);
            if (null == list || list.isEmpty()) {
                return success(null);
            QueryWrapper<BsprojectEntity> wrapper = null;
            if (null != dirid) {
                wrapper = new QueryWrapper<>();
                wrapper.eq("dirid", dirid);
            }
            return success(list.get(0));
            Page<BsprojectEntity> page = new Page<>(pageIndex, pageSize);
            page.addOrder(OrderItem.asc("gid"));
            Page paged = bsprojectMapper.selectPage(page, wrapper);
            return success(paged.getTotal(), paged.getRecords());
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
src/main/java/com/lf/server/mapper/data/DirMapper.java
@@ -79,6 +79,13 @@
    public List<DirEntity> selectDirAll();
    /**
     * æŸ¥è¯¢æ ¹ç›®å½•
     *
     * @return
     */
    public List<DirEntity> selectDirRoot();
    /**
     * é€’归查询
     *
     * @param name
src/main/java/com/lf/server/service/data/DirService.java
@@ -59,6 +59,11 @@
    }
    @Override
    public List<DirEntity> selectDirRoot() {
        return dirMapper.selectDirRoot();
    }
    @Override
    public List<DirEntity> selectDirRecursive(String name) {
        return dirMapper.selectDirRecursive(name);
    }
src/main/resources/mapper/data/DirMapper.xml
@@ -18,6 +18,10 @@
        select * from lf.sys_dir order by order_num;
    </select>
    <select id="selectDirRoot" resultType="com.lf.server.entity.data.DirEntity">
        select * from lf.sys_dir where pid=0 order by order_num;
    </select>
    <select id="selectDirRecursive" resultMap="resultMap" resultType="com.lf.server.entity.data.DirEntity">
        with recursive rs as(
            select * from lf.sys_dir where name=#{name}
˵Ã÷.txt
@@ -59,6 +59,9 @@
58.
59.
60.
Access:
https://blog.csdn.net/weixin_43407520/article/details/122165848
-----------------------------------------------
.开发上传shp文件转换为JSON数据接口
.开发读取Excel表格功能