Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
serviceApi
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
antaile
serviceApi
Commits
3386692a
Commit
3386692a
authored
Apr 16, 2021
by
XiaHou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询展览纪念馆
parent
29e19a4b
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
220 additions
and
23 deletions
+220
-23
CommonPage.java
...ava/com/atlgroupasia/servicecenter/common/CommonPage.java
+85
-0
Page.java
...main/java/com/atlgroupasia/servicecenter/common/Page.java
+24
-0
OshExhibitController.java
...upasia/servicecenter/controller/OshExhibitController.java
+36
-0
QueryExhibitParam.java
...rvicecenter/operation/exhibit/pojo/QueryExhibitParam.java
+0
-22
QueryExhibitVO.java
.../servicecenter/operation/exhibit/pojo/QueryExhibitVO.java
+21
-0
IOshExhibitService.java
...ecenter/operation/exhibit/service/IOshExhibitService.java
+14
-0
OshExhibitServiceImpl.java
...operation/exhibit/service/impl/OshExhibitServiceImpl.java
+33
-0
OshExhibitDao.xml
...main/resources/mapper/operation/exhibit/OshExhibitDao.xml
+7
-1
No files found.
src/main/java/com/atlgroupasia/servicecenter/common/CommonPage.java
0 → 100644
View file @
3386692a
package
com
.
atlgroupasia
.
servicecenter
.
common
;
import
com.github.pagehelper.PageInfo
;
import
org.springframework.data.domain.Page
;
import
java.util.List
;
/**
* 分页数据封装类
* Created by macro on 2019/4/19.
*/
public
class
CommonPage
<
T
>
{
private
Integer
pageNum
;
private
Integer
pageSize
;
private
Integer
totalPage
;
private
Long
total
;
private
List
<
T
>
list
;
/**
* 将PageHelper分页后的list转为分页信息
*/
public
static
<
T
>
CommonPage
<
T
>
restPage
(
List
<
T
>
list
)
{
CommonPage
<
T
>
result
=
new
CommonPage
<
T
>();
PageInfo
<
T
>
pageInfo
=
new
PageInfo
<
T
>(
list
);
result
.
setTotalPage
(
pageInfo
.
getPages
());
result
.
setPageNum
(
pageInfo
.
getPageNum
());
result
.
setPageSize
(
pageInfo
.
getPageSize
());
result
.
setTotal
(
pageInfo
.
getTotal
());
result
.
setList
(
pageInfo
.
getList
());
return
result
;
}
/**
* 将SpringData分页后的list转为分页信息
*/
public
static
<
T
>
CommonPage
<
T
>
restPage
(
Page
<
T
>
pageInfo
)
{
CommonPage
<
T
>
result
=
new
CommonPage
<
T
>();
result
.
setTotalPage
(
pageInfo
.
getTotalPages
());
result
.
setPageNum
(
pageInfo
.
getNumber
());
result
.
setPageSize
(
pageInfo
.
getSize
());
result
.
setTotal
(
pageInfo
.
getTotalElements
());
result
.
setList
(
pageInfo
.
getContent
());
return
result
;
}
public
Integer
getPageNum
()
{
return
pageNum
;
}
public
void
setPageNum
(
Integer
pageNum
)
{
this
.
pageNum
=
pageNum
;
}
public
Integer
getPageSize
()
{
return
pageSize
;
}
public
void
setPageSize
(
Integer
pageSize
)
{
this
.
pageSize
=
pageSize
;
}
public
Integer
getTotalPage
()
{
return
totalPage
;
}
public
void
setTotalPage
(
Integer
totalPage
)
{
this
.
totalPage
=
totalPage
;
}
public
List
<
T
>
getList
()
{
return
list
;
}
public
void
setList
(
List
<
T
>
list
)
{
this
.
list
=
list
;
}
public
Long
getTotal
()
{
return
total
;
}
public
void
setTotal
(
Long
total
)
{
this
.
total
=
total
;
}
}
src/main/java/com/atlgroupasia/servicecenter/common/Page.java
0 → 100644
View file @
3386692a
package
com
.
atlgroupasia
.
servicecenter
.
common
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author chenwf
* @date 2020/4/2
*/
@Data
public
class
Page
{
@ApiModelProperty
(
"页码"
)
private
Integer
pageNum
;
@ApiModelProperty
(
"页数"
)
private
Integer
pageSize
;
public
Page
()
{
}
public
Page
(
Integer
pageNum
,
Integer
pageSize
)
{
this
.
pageNum
=
pageNum
;
this
.
pageSize
=
pageSize
;
}
}
src/main/java/com/atlgroupasia/servicecenter/controller/OshExhibitController.java
0 → 100644
View file @
3386692a
package
com
.
atlgroupasia
.
servicecenter
.
controller
;
import
com.atlgroupasia.servicecenter.common.Page
;
import
com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryExhibitParam
;
import
com.atlgroupasia.servicecenter.operation.exhibit.service.IOshExhibitService
;
import
com.atlgroupasia.servicecenter.utils.JsonResult
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
/**
* @Author xh
* @Date 2020/12/2
* description:
*/
@Controller
@Api
(
tags
=
"展览纪念馆相关接口"
,
description
=
"展览纪念馆控制器"
)
@RequestMapping
(
"/oshExhibit"
)
public
class
OshExhibitController
{
@Autowired
private
IOshExhibitService
oshExhibitService
;
@ApiOperation
(
"分页查询展览纪念馆"
)
@RequestMapping
(
value
=
"/selectExhibitListByOther"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
JsonResult
selectExhibitListByOther
(
@ModelAttribute
Page
page
,
@ModelAttribute
QueryExhibitParam
queryExhibitParam
)
{
return
JsonResult
.
success
(
"查询成功"
,
this
.
oshExhibitService
.
selectExhibitListByOther
(
queryExhibitParam
,
page
));
}
}
src/main/java/com/atlgroupasia/servicecenter/operation/exhibit/pojo/QueryExhibitParam.java
View file @
3386692a
...
@@ -14,27 +14,5 @@ import java.util.Date;
...
@@ -14,27 +14,5 @@ import java.util.Date;
@Data
@Data
public
class
QueryExhibitParam
implements
Serializable
{
public
class
QueryExhibitParam
implements
Serializable
{
@ApiModelProperty
(
value
=
"展览纪念馆id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"寺庙id"
)
private
Integer
templeId
;
@ApiModelProperty
(
value
=
"参观开始时间"
)
private
String
phone
;
@ApiModelProperty
(
value
=
"参观开始时间"
)
private
String
joinStartTime
;
@ApiModelProperty
(
value
=
"参观结束时间"
)
private
String
joinEndTime
;
@ApiModelProperty
(
value
=
"报名开始时间"
)
private
String
applyStartTime
;
@ApiModelProperty
(
value
=
"报名结束时间"
)
private
String
applyEndTime
;
@ApiModelProperty
(
value
=
"最大报名人数"
)
private
Integer
totalNumber
;
@ApiModelProperty
(
value
=
"已报名人数"
)
private
Integer
appNumber
;
@ApiModelProperty
(
value
=
"寺庙名称"
)
private
String
templeName
;
}
}
src/main/java/com/atlgroupasia/servicecenter/operation/exhibit/pojo/QueryExhibitVO.java
View file @
3386692a
package
com
.
atlgroupasia
.
servicecenter
.
operation
.
exhibit
.
pojo
;
package
com
.
atlgroupasia
.
servicecenter
.
operation
.
exhibit
.
pojo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -12,6 +13,26 @@ import java.io.Serializable;
...
@@ -12,6 +13,26 @@ import java.io.Serializable;
@Data
@Data
public
class
QueryExhibitVO
implements
Serializable
{
public
class
QueryExhibitVO
implements
Serializable
{
@ApiModelProperty
(
value
=
"展览纪念馆id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"寺庙id"
)
private
Integer
templeId
;
@ApiModelProperty
(
value
=
"参观开始时间"
)
private
String
phone
;
@ApiModelProperty
(
value
=
"参观开始时间"
)
private
String
joinStartTime
;
@ApiModelProperty
(
value
=
"参观结束时间"
)
private
String
joinEndTime
;
@ApiModelProperty
(
value
=
"报名开始时间"
)
private
String
applyStartTime
;
@ApiModelProperty
(
value
=
"报名结束时间"
)
private
String
applyEndTime
;
@ApiModelProperty
(
value
=
"最大报名人数"
)
private
Integer
totalNumber
;
@ApiModelProperty
(
value
=
"已报名人数"
)
private
Integer
appNumber
;
@ApiModelProperty
(
value
=
"寺庙名称"
)
private
String
templeName
;
}
}
src/main/java/com/atlgroupasia/servicecenter/operation/exhibit/service/IOshExhibitService.java
View file @
3386692a
package
com
.
atlgroupasia
.
servicecenter
.
operation
.
exhibit
.
service
;
package
com
.
atlgroupasia
.
servicecenter
.
operation
.
exhibit
.
service
;
import
com.atlgroupasia.servicecenter.common.CommonPage
;
import
com.atlgroupasia.servicecenter.common.Page
;
import
com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryExhibitParam
;
import
com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryExhibitVO
;
/**
/**
* @Author xh
* @Author xh
* @Date 2021/4/15
* @Date 2021/4/15
* description:
* description:
*/
*/
public
interface
IOshExhibitService
{
public
interface
IOshExhibitService
{
/**
* 分页查询 可展览机娘
* @param queryExhibitParam
* @param page
* @return
*/
CommonPage
<
QueryExhibitVO
>
selectExhibitListByOther
(
QueryExhibitParam
queryExhibitParam
,
Page
page
);
}
}
src/main/java/com/atlgroupasia/servicecenter/operation/exhibit/service/impl/OshExhibitServiceImpl.java
View file @
3386692a
package
com
.
atlgroupasia
.
servicecenter
.
operation
.
exhibit
.
service
.
impl
;
package
com
.
atlgroupasia
.
servicecenter
.
operation
.
exhibit
.
service
.
impl
;
import
com.atlgroupasia.servicecenter.common.CommonPage
;
import
com.atlgroupasia.servicecenter.common.Page
;
import
com.atlgroupasia.servicecenter.mbg.mapper.OshExhibitMapper
;
import
com.atlgroupasia.servicecenter.mbg.mapper.OshExhibitMapper
;
import
com.atlgroupasia.servicecenter.operation.exhibit.dao.OshExhibitDao
;
import
com.atlgroupasia.servicecenter.operation.exhibit.dao.OshExhibitDao
;
import
com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryExhibitParam
;
import
com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryExhibitVO
;
import
com.atlgroupasia.servicecenter.operation.exhibit.service.IOshExhibitService
;
import
com.atlgroupasia.servicecenter.operation.exhibit.service.IOshExhibitService
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
/**
* @Author xh
* @Author xh
...
@@ -21,4 +29,29 @@ public class OshExhibitServiceImpl implements IOshExhibitService {
...
@@ -21,4 +29,29 @@ public class OshExhibitServiceImpl implements IOshExhibitService {
private
OshExhibitDao
oshExhibitDao
;
private
OshExhibitDao
oshExhibitDao
;
/**
* 分页查询 可展览机娘
* @param queryExhibitParam
* @param page
* @return
*/
@Override
public
CommonPage
<
QueryExhibitVO
>
selectExhibitListByOther
(
QueryExhibitParam
queryExhibitParam
,
Page
page
){
if
(
page
!=
null
&&
page
.
getPageNum
()
!=
null
&&
page
.
getPageSize
()
!=
null
)
{
PageHelper
.
startPage
(
page
.
getPageNum
(),
page
.
getPageSize
());
}
List
<
QueryExhibitVO
>
queryExhibitVOList
=
this
.
oshExhibitDao
.
selectExhibitListByOther
(
queryExhibitParam
);
//记录下 pagehelper第一次分页查询的 返回得总条数 等信息
PageInfo
<
QueryExhibitVO
>
pageInfo
=
new
PageInfo
<>(
queryExhibitVOList
);
//因为进行了第二次查询 所以pageHelp得分页总数得到了变化 导致不准确 因此我们需要手动校准一下
CommonPage
<
QueryExhibitVO
>
result
=
new
CommonPage
<
QueryExhibitVO
>();
result
.
setTotalPage
(
pageInfo
.
getPages
());
result
.
setPageNum
(
pageInfo
.
getPageNum
());
result
.
setPageSize
(
pageInfo
.
getPageSize
());
result
.
setTotal
(
pageInfo
.
getTotal
());
result
.
setList
(
queryExhibitVOList
);
return
result
;
}
}
}
src/main/resources/mapper/operation/exhibit/OshExhibitDao.xml
View file @
3386692a
...
@@ -7,9 +7,14 @@
...
@@ -7,9 +7,14 @@
<select
id=
"selectExhibitListByOther"
parameterType=
"com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryExhibitParam"
resultType=
"com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryExhibitVO"
>
<select
id=
"selectExhibitListByOther"
parameterType=
"com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryExhibitParam"
resultType=
"com.atlgroupasia.servicecenter.operation.exhibit.pojo.QueryExhibitVO"
>
select
select
a.id,a.temple_id templeId
a.id,a.temple_id templeId,a.phone,a.join_start_time joinStartTime,
a.join_end_time joinEndTime,a.apply_start_time applyStartTime,a.apply_end_time applyEndTime,
a.total_number totalNumber,a.app_number appNumber,
b.name templeName
from osh_exhibit a
from osh_exhibit a
left join mis_temple b ON a.temple_id = b.id
left join mis_temple b ON a.temple_id = b.id
where 1= 1
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
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