Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
integration
Commits
8e3f15e9
Commit
8e3f15e9
authored
Mar 09, 2026
by
wujipeng
Browse files
报表分页
parent
650cddb4
Changes
9
Show whitespace changes
Inline
Side-by-side
src/main/java/com/ruzhoukj/integration/controller/ReportController.java
0 → 100644
View file @
8e3f15e9
package
com.ruzhoukj.integration.controller
;
import
com.ruzhoukj.integration.pojo.dto.ReportDTO
;
import
com.ruzhoukj.integration.pojo.dto.TemplateDTO
;
import
com.ruzhoukj.integration.pojo.vo.ReportVO
;
import
com.ruzhoukj.integration.pojo.vo.TemplateVO
;
import
com.ruzhoukj.integration.result.PageResult
;
import
com.ruzhoukj.integration.service.ReportService
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
/**
* @author : wujipeng
* @date : 2026/3/9 10:25
* @Version: 1.0
* @Desc : 描述信息
*/
@RestController
@RequestMapping
(
"/report"
)
public
class
ReportController
{
@Resource
private
ReportService
reportService
;
@ApiOperation
(
"分页"
)
@PostMapping
(
"/page"
)
public
PageResult
<
ReportVO
>
getPageData
(
@RequestBody
ReportDTO
reportDTO
)
{
return
reportService
.
getPageData
(
reportDTO
);
}
}
src/main/java/com/ruzhoukj/integration/mapper/ReportMapper.java
0 → 100644
View file @
8e3f15e9
package
com.ruzhoukj.integration.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.ruzhoukj.integration.pojo.dto.ReportDTO
;
import
com.ruzhoukj.integration.pojo.entity.ReportEntity
;
import
com.ruzhoukj.integration.pojo.vo.ReportVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* @author : wujipeng
* @date : 2026/3/9 10:23
* @Version: 1.0
* @Desc : 描述信息
*/
@Mapper
public
interface
ReportMapper
extends
BaseMapper
<
ReportEntity
>
{
List
<
ReportVO
>
getPageData
(
ReportDTO
reportDTO
);
}
src/main/java/com/ruzhoukj/integration/pojo/dto/ReportDTO.java
0 → 100644
View file @
8e3f15e9
package
com.ruzhoukj.integration.pojo.dto
;
import
com.ruzhoukj.integration.pojo.entity.ReportEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* @author : wujipeng
* @date : 2026/3/9 10:27
* @Version: 1.0
* @Desc : 描述信息
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
public
class
ReportDTO
extends
ReportEntity
{
private
Integer
pageNum
=
1
;
private
Integer
pageSize
=
10
;
}
src/main/java/com/ruzhoukj/integration/pojo/entity/ReportEntity.java
0 → 100644
View file @
8e3f15e9
package
com.ruzhoukj.integration.pojo.entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author : wujipeng
* @date : 2026/3/9 10:21
* @Version: 1.0
* @Desc : 描述信息
*/
@Data
@TableName
(
"report"
)
public
class
ReportEntity
{
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
private
String
id
;
@ApiModelProperty
(
value
=
"模板id"
)
@TableField
(
value
=
"template_id"
)
private
String
templateId
;
@ApiModelProperty
(
value
=
"模板名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"行数"
)
@TableField
(
"line_number"
)
private
Integer
lineNumber
;
@ApiModelProperty
(
value
=
"列数"
)
@TableField
(
"column_number"
)
private
Integer
columnNumber
;
@ApiModelProperty
(
value
=
"版本"
)
@TableField
(
"version"
)
private
String
version
;
@ApiModelProperty
(
value
=
"年"
)
private
String
year
;
@ApiModelProperty
(
value
=
"月"
)
private
String
month
;
@ApiModelProperty
(
value
=
"日"
)
private
String
day
;
@ApiModelProperty
(
value
=
"基础单元格"
)
@TableField
(
exist
=
false
)
private
Map
<
String
,
TemplateDetailBasicEntity
>
cells
;
@ApiModelProperty
(
value
=
"复合单元格"
)
@TableField
(
exist
=
false
)
private
List
<
TemplateDetailMergeEntity
>
merges
;
@ApiModelProperty
(
value
=
"行配置"
)
@TableField
(
exist
=
false
)
private
Map
<
String
,
TemplateConfigEntity
>
rows
;
@ApiModelProperty
(
value
=
"列配置"
)
@TableField
(
exist
=
false
)
private
Map
<
String
,
TemplateConfigEntity
>
columns
;
}
src/main/java/com/ruzhoukj/integration/pojo/vo/ReportVO.java
0 → 100644
View file @
8e3f15e9
package
com.ruzhoukj.integration.pojo.vo
;
import
com.ruzhoukj.integration.pojo.entity.ReportEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* @author : wujipeng
* @date : 2026/3/9 10:26
* @Version: 1.0
* @Desc : 描述信息
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
public
class
ReportVO
extends
ReportEntity
{
}
src/main/java/com/ruzhoukj/integration/service/ReportService.java
0 → 100644
View file @
8e3f15e9
package
com.ruzhoukj.integration.service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.ruzhoukj.integration.pojo.dto.ReportDTO
;
import
com.ruzhoukj.integration.pojo.entity.ReportEntity
;
import
com.ruzhoukj.integration.pojo.vo.ReportVO
;
import
com.ruzhoukj.integration.result.PageResult
;
/**
* @author : wujipeng
* @date : 2026/3/9 10:23
* @Version: 1.0
* @Desc : 描述信息
*/
public
interface
ReportService
extends
IService
<
ReportEntity
>
{
PageResult
<
ReportVO
>
getPageData
(
ReportDTO
reportDTO
);
}
src/main/java/com/ruzhoukj/integration/service/impl/ReportServiceImpl.java
0 → 100644
View file @
8e3f15e9
package
com.ruzhoukj.integration.service.impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.ruzhoukj.integration.mapper.ReportMapper
;
import
com.ruzhoukj.integration.pojo.dto.ReportDTO
;
import
com.ruzhoukj.integration.pojo.entity.ReportEntity
;
import
com.ruzhoukj.integration.pojo.vo.ReportVO
;
import
com.ruzhoukj.integration.pojo.vo.TemplateVO
;
import
com.ruzhoukj.integration.result.PageResult
;
import
com.ruzhoukj.integration.service.ReportService
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @author : wujipeng
* @date : 2026/3/9 10:24
* @Version: 1.0
* @Desc : 描述信息
*/
@Service
public
class
ReportServiceImpl
extends
ServiceImpl
<
ReportMapper
,
ReportEntity
>
implements
ReportService
{
@Override
public
PageResult
<
ReportVO
>
getPageData
(
ReportDTO
reportDTO
)
{
//开启分页
PageHelper
.
startPage
(
reportDTO
.
getPageNum
(),
reportDTO
.
getPageSize
());
List
<
ReportVO
>
userList
=
baseMapper
.
getPageData
(
reportDTO
);
Page
<
ReportVO
>
page
=
(
Page
<
ReportVO
>)
userList
;
return
new
PageResult
<>(
page
.
getPageNum
(),
page
.
getPageSize
(),
page
.
getTotal
(),
page
.
getResult
()
);
}
}
src/main/resources/com/ruzhoukj/integration/mapper/ReportMapper.xml
0 → 100644
View file @
8e3f15e9
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.ruzhoukj.integration.mapper.ReportMapper"
>
<select
id=
"getPageData"
resultType=
"com.ruzhoukj.integration.pojo.vo.ReportVO"
>
select
id,
template_id,
name,
line_number,
column_number,
version,
year,
month,
day
from
report
</select>
</mapper>
src/main/resources/com/ruzhoukj/integration/mapper/TemplateMapper.xml
View file @
8e3f15e9
...
@@ -21,7 +21,8 @@
...
@@ -21,7 +21,8 @@
id,
id,
name,
name,
line_number,
line_number,
column_number
column_number,
version
from
from
template
template
</select>
</select>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment