管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-11-03 db78fd0347326b3b06c4b6a7353757c4f4a8d4ae
src/main/java/com/lf/server/controller/data/DomainController.java
@@ -39,12 +39,13 @@
    @SysLog()
    @ApiOperation(value = "查询记录数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "domName", value = "值域表名", dataType = "String", paramType = "query", required = false, example = "")
            @ApiImplicitParam(name = "ns", value = "名称空间", dataType = "String", paramType = "query", example = "bd"),
            @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "dlg_25w_aanp")
    })
    @GetMapping({"/selectCount"})
    public ResponseMsg<Integer> selectCount(String domName) {
    public ResponseMsg<Integer> selectCount(String ns, String tab) {
        try {
            int count = domainService.selectCount(domName);
            int count = domainService.selectCount(ns, tab);
            return success(count);
        } catch (Exception ex) {
@@ -55,18 +56,19 @@
    @SysLog()
    @ApiOperation(value = "分页查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "domName", value = "值域表名", dataType = "String", paramType = "query", example = ""),
            @ApiImplicitParam(name = "ns", value = "名称空间", dataType = "String", paramType = "query", example = "bd"),
            @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "dlg_25w_aanp"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/selectByPage")
    public ResponseMsg<List<DomainEntity>> selectByPage(String domName, Integer pageSize, Integer pageIndex) {
    public ResponseMsg<List<DomainEntity>> selectByPage(String ns, String tab, Integer pageSize, Integer pageIndex) {
        try {
            if (pageSize < 1 || pageIndex < 1) {
                return fail("每页页数或分页数小于1", null);
            }
            List<DomainEntity> rs = domainService.selectByPage(domName, pageSize, pageSize * (pageIndex - 1));
            List<DomainEntity> rs = domainService.selectByPage(ns, tab, pageSize, pageSize * (pageIndex - 1));
            return success(rs);
        } catch (Exception ex) {
@@ -77,23 +79,24 @@
    @SysLog()
    @ApiOperation(value = "分页查询并返回记录数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "domName", value = "值域表名", dataType = "String", paramType = "query", example = ""),
            @ApiImplicitParam(name = "ns", value = "名称空间", dataType = "String", paramType = "query", example = "bd"),
            @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "dlg_25w_aanp"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/selectByPageAndCount")
    public ResponseMsg<List<DomainEntity>> selectByPageAndCount(String domName, Integer pageSize, Integer pageIndex) {
    public ResponseMsg<List<DomainEntity>> selectByPageAndCount(String ns, String tab, Integer pageSize, Integer pageIndex) {
        try {
            if (pageSize < 1 || pageIndex < 1) {
                return fail("每页页数或分页数小于1", null);
            }
            int count = domainService.selectCount(domName);
            int count = domainService.selectCount(ns, tab);
            if (count == 0) {
                return success(0, null);
            }
            List<DomainEntity> rs = domainService.selectByPage(domName, pageSize, pageSize * (pageIndex - 1));
            List<DomainEntity> rs = domainService.selectByPage(ns, tab, pageSize, pageSize * (pageIndex - 1));
            return success(count, rs);
        } catch (Exception ex) {