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
邬吉朋
ops
Commits
e4227e8a
Commit
e4227e8a
authored
Feb 20, 2025
by
朱翔
Browse files
报表模板接口
parent
0de680ec
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/ruzhoukj/sms/controller/ReportDataInfoController.java
0 → 100644
View file @
e4227e8a
package
com.ruzhoukj.sms.controller
;
import
com.platform.controller.BaseController
;
import
com.platform.model.resp.Result
;
import
com.platform.page.TableDataInfo
;
import
com.platform.utils.DozerUtils
;
import
com.ruzhoukj.sms.model.dto.ReportDataInfoDTO
;
import
com.ruzhoukj.sms.model.vo.ReportDataInfoVO
;
import
com.ruzhoukj.sms.service.ReportDataInfoService
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
/**
* @Author:zhuxiang
* @Package:com.ruzhoukj.sms.controller
* @Project:OA
* @name:ReporDataInfoController
* @Date:2025/2/20 17:05
* @Filename:ReporDataInfoController
*/
@Api
(
tags
=
"报表数据"
)
@RestController
@RequestMapping
(
"/report/data"
)
public
class
ReportDataInfoController
extends
BaseController
{
@Resource
private
ReportDataInfoService
reportDataInfoService
;
@PostMapping
(
"/page"
)
public
TableDataInfo
page
(
@RequestBody
ReportDataInfoDTO
reportDataInfoDTO
){
startPage
(
reportDataInfoDTO
.
getPageNum
(),
reportDataInfoDTO
.
getPageSize
());
return
getDataTable
(
reportDataInfoService
.
queryList
(
reportDataInfoDTO
));
}
@GetMapping
(
"/{id}"
)
public
Result
<
ReportDataInfoVO
>
getInfo
(
@PathVariable
String
id
){
return
Result
.
data
(
DozerUtils
.
convertBean
(
reportDataInfoService
.
getById
(
id
),
ReportDataInfoVO
.
class
));
}
}
src/main/java/com/ruzhoukj/sms/dao/ReportDataInfoMapper.java
View file @
e4227e8a
...
...
@@ -2,8 +2,12 @@ package com.ruzhoukj.sms.dao;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.ruzhoukj.sms.entity.ReportDataInfoEntity
;
import
com.ruzhoukj.sms.model.dto.ReportDataInfoDTO
;
import
com.ruzhoukj.sms.model.vo.ReportDataInfoVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* @Author:zhuxiang
* @Package:com.ruzhoukj.sms.dao
...
...
@@ -14,4 +18,5 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public
interface
ReportDataInfoMapper
extends
BaseMapper
<
ReportDataInfoEntity
>
{
List
<
ReportDataInfoVO
>
queryList
(
ReportDataInfoDTO
reportDataInfoDTO
);
}
src/main/java/com/ruzhoukj/sms/entity/ReportDataInfoEntity.java
View file @
e4227e8a
...
...
@@ -32,4 +32,13 @@ public class ReportDataInfoEntity {
@TableField
(
"template_id"
)
private
String
templateId
;
@TableField
(
"user_id"
)
private
String
userId
;
@TableField
(
"year"
)
private
Integer
year
;
@TableField
(
"month"
)
private
Integer
month
;
}
src/main/java/com/ruzhoukj/sms/model/dto/ReportDataInfoDTO.java
0 → 100644
View file @
e4227e8a
package
com.ruzhoukj.sms.model.dto
;
import
com.ruzhoukj.sms.entity.ReportDataInfoEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* @Author:zhuxiang
* @Package:com.ruzhoukj.sms.model.dto
* @Project:OA
* @name:ReportDataInfoDTO
* @Date:2025/2/20 17:19
* @Filename:ReportDataInfoDTO
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
public
class
ReportDataInfoDTO
extends
ReportDataInfoEntity
{
private
Integer
pageNum
;
private
Integer
pageSize
;
}
src/main/java/com/ruzhoukj/sms/model/vo/ReportDataInfoVO.java
0 → 100644
View file @
e4227e8a
package
com.ruzhoukj.sms.model.vo
;
import
com.ruzhoukj.sms.entity.ReportDataInfoEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* @Author:zhuxiang
* @Package:com.ruzhoukj.sms.model.vo
* @Project:OA
* @name:ReportDataInfoVO
* @Date:2025/2/20 17:25
* @Filename:ReportDataInfoVO
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
public
class
ReportDataInfoVO
extends
ReportDataInfoEntity
{
@ApiModelProperty
(
value
=
"用户名"
)
private
String
userName
;
}
src/main/java/com/ruzhoukj/sms/service/ReportDataInfoService.java
View file @
e4227e8a
...
...
@@ -2,6 +2,10 @@ package com.ruzhoukj.sms.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.ruzhoukj.sms.entity.ReportDataInfoEntity
;
import
com.ruzhoukj.sms.model.dto.ReportDataInfoDTO
;
import
com.ruzhoukj.sms.model.vo.ReportDataInfoVO
;
import
java.util.List
;
/**
* @Author:zhuxiang
...
...
@@ -12,4 +16,5 @@ import com.ruzhoukj.sms.entity.ReportDataInfoEntity;
* @Filename:ReportDataInfoService
*/
public
interface
ReportDataInfoService
extends
IService
<
ReportDataInfoEntity
>
{
List
<
ReportDataInfoVO
>
queryList
(
ReportDataInfoDTO
reportDataInfoDTO
);
}
src/main/java/com/ruzhoukj/sms/service/impl/ReportDataInfoServiceImpl.java
View file @
e4227e8a
...
...
@@ -3,9 +3,13 @@ package com.ruzhoukj.sms.service.impl;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruzhoukj.sms.dao.ReportDataInfoMapper
;
import
com.ruzhoukj.sms.entity.ReportDataInfoEntity
;
import
com.ruzhoukj.sms.model.dto.ReportDataInfoDTO
;
import
com.ruzhoukj.sms.model.vo.ReportDataInfoVO
;
import
com.ruzhoukj.sms.service.ReportDataInfoService
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @Author:zhuxiang
* @Package:com.ruzhoukj.sms.service.impl
...
...
@@ -16,4 +20,8 @@ import org.springframework.stereotype.Service;
*/
@Service
public
class
ReportDataInfoServiceImpl
extends
ServiceImpl
<
ReportDataInfoMapper
,
ReportDataInfoEntity
>
implements
ReportDataInfoService
{
@Override
public
List
<
ReportDataInfoVO
>
queryList
(
ReportDataInfoDTO
reportDataInfoDTO
)
{
return
baseMapper
.
queryList
(
reportDataInfoDTO
);
}
}
src/main/resources/com/ruzhoukj/sms/dao/ReportDataInfoDao.xml
0 → 100644
View file @
e4227e8a
<?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.sms.dao.ReportDataInfoMapper"
>
<select
id=
"queryList"
resultType=
"com.ruzhoukj.sms.model.vo.ReportDataInfoVO"
>
select
rdi.name name,
u.name userName,
rdi.id id,
rdi.user_id userId,
rdi.year year,
rdi.month month
from
report_data_info rdi
left join user u on
rdi.user_id = u.id
left join
report_data_and_user rdau on
rdi.id = rdau.report_data_info_id
where
rdi.user_id = #{userId}
or
rdau.user_id = #{userId}
</select>
</mapper>
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