管道基础大数据平台系统开发-【后端】-Server
13693261870
2023-06-28 a4e74d2684146cb5e3790fddc6d077e52e71205e
src/main/java/com/lf/server/controller/data/PublishController.java
@@ -56,7 +56,7 @@
                return fail("数据类别为空", null);
            }
            String types = getType(type);
            String types = getType(dircode, type);
            int count = publishService.selectMetasByCount(depcode, dircode, verid, types, name);
            if (count == 0) {
                return success(0, null);
@@ -73,12 +73,12 @@
    /**
     * 获取类型
     */
    private String getType(String type) throws Exception {
    private String getType(String dircode, String type) throws Exception {
        switch (type) {
            case "DOM":
                return "type in ('tif', 'tiff', 'img')";
                return "type in ('tif', 'tiff', 'img')" + getFilter(dircode, type);
            case "DEM":
                return "type in ('tif', 'tiff')";
                return "type in ('tif', 'tiff')" + getFilter(dircode, type);
            case "MPT":
                return "type = 'mpt'";
            case "3DML":
@@ -96,6 +96,34 @@
        }
    }
    /**
     * 获取过滤条件
     */
    private String getFilter(String dircode, String type) {
        dircode = StringHelper.isEmpty(dircode) ? "" : StringHelper.getRightLike(dircode);
        List<String> list = null;
        switch (type) {
            case "DOM":
                list = publishService.selectCodesForDir(dircode, 0);
                break;
            case "DEM":
                list = publishService.selectCodesForDir(dircode, 1);
                break;
            default:
                break;
        }
        if (null == list || list.isEmpty()) {
            return "";
        }
        for (int i = 0, c = list.size(); i < c; i++) {
            list.set(i, "'" + list.get(i) + "'");
        }
        return " and dircode not in (" + StringHelper.join(list, ",") + ")";
    }
    @SysLog()
    @ApiOperation(value = "分页查询并返回记录数")
    @ApiImplicitParams({