Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
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
吴迪
gs1-office-web-sit
Commits
3a7fd0a4
Commit
3a7fd0a4
authored
Jan 14, 2022
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改】提供商管理修改传参方式
parent
9c6088da
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
28 deletions
+32
-28
PartnersController.java
.../office/modules/manage/controller/PartnersController.java
+5
-5
PartnersDao.java
src/main/java/io/office/modules/manage/dao/PartnersDao.java
+2
-1
NewsParams.java
.../java/io/office/modules/manage/entity/dto/NewsParams.java
+4
-0
PartnersService.java
...ava/io/office/modules/manage/service/PartnersService.java
+2
-1
PartnersServiceImpl.java
...fice/modules/manage/service/impl/PartnersServiceImpl.java
+2
-1
PartnersDao.xml
src/main/resources/mapper/manage/PartnersDao.xml
+17
-20
No files found.
src/main/java/io/office/modules/manage/controller/PartnersController.java
View file @
3a7fd0a4
...
...
@@ -8,6 +8,7 @@ import java.util.Map;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.manage.entity.ProductEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
...
...
@@ -38,12 +39,11 @@ public class PartnersController extends AbstractController {
/**
* 列表
*/
@
Reque
stMapping
(
"/list"
)
@
Po
stMapping
(
"/list"
)
// @RequiresPermissions("manage:partners:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
Page
<
PartnersEntity
>
page
=
this
.
partnersService
.
selectPartnersList
(
params
,
new
Page
(
Integer
.
valueOf
(
params
.
get
(
"page"
).
toString
()),
Integer
.
valueOf
(
params
.
get
(
"limit"
).
toString
())));
public
R
list
(
@RequestBody
NewsParams
newsParams
){
Page
<
PartnersEntity
>
page
=
this
.
partnersService
.
selectPartnersList
(
newsParams
,
new
Page
(
newsParams
.
getPage
(),
newsParams
.
getLimit
()));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"page"
,
pageUtils
);
}
...
...
src/main/java/io/office/modules/manage/dao/PartnersDao.java
View file @
3a7fd0a4
...
...
@@ -3,6 +3,7 @@ package io.office.modules.manage.dao;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.PartnersEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
...
...
@@ -20,7 +21,7 @@ import java.util.Map;
@Mapper
public
interface
PartnersDao
extends
BaseMapper
<
PartnersEntity
>
{
List
<
PartnersEntity
>
selectPartnersList
(
@Param
(
"
params"
)
Map
<
String
,
Object
>
params
,
Page
page
);
List
<
PartnersEntity
>
selectPartnersList
(
@Param
(
"
newsParams"
)
NewsParams
params
,
Page
page
);
@Select
(
"select * from Partners where status=#{status} and levels>#{levels} order by id desc"
)
List
<
PartnersEntity
>
selectByStatusAndLevels
(
@Param
(
"status"
)
String
status
,
@Param
(
"levels"
)
String
levels
);
...
...
src/main/java/io/office/modules/manage/entity/dto/NewsParams.java
View file @
3a7fd0a4
...
...
@@ -34,4 +34,8 @@ public class NewsParams extends PageParams {
private
String
type
;
private
List
list
;
private
String
firmname
;
private
String
technology
;
private
String
service
;
}
src/main/java/io/office/modules/manage/service/PartnersService.java
View file @
3a7fd0a4
...
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.PartnersEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
java.util.List
;
...
...
@@ -23,7 +24,7 @@ public interface PartnersService extends IService<PartnersEntity> {
R
deletePartners
(
List
<
Long
>
ids
,
SysUserEntity
user
);
Page
<
PartnersEntity
>
selectPartnersList
(
Map
<
String
,
Object
>
params
,
Page
page
);
Page
<
PartnersEntity
>
selectPartnersList
(
NewsParams
params
,
Page
page
);
R
verifyPartners
(
PartnersEntity
partnersEntity
,
SysUserEntity
user
);
...
...
src/main/java/io/office/modules/manage/service/impl/PartnersServiceImpl.java
View file @
3a7fd0a4
...
...
@@ -3,6 +3,7 @@ package io.office.modules.manage.service.impl;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.CasesEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -56,7 +57,7 @@ public class PartnersServiceImpl extends ServiceImpl<PartnersDao, PartnersEntity
}
@Override
public
Page
<
PartnersEntity
>
selectPartnersList
(
Map
<
String
,
Object
>
params
,
Page
page
)
{
public
Page
<
PartnersEntity
>
selectPartnersList
(
NewsParams
params
,
Page
page
)
{
List
<
PartnersEntity
>
list
=
this
.
partnersDao
.
selectPartnersList
(
params
,
page
);
page
.
setRecords
(
list
);
return
page
;
...
...
src/main/resources/mapper/manage/PartnersDao.xml
View file @
3a7fd0a4
...
...
@@ -25,39 +25,36 @@
<result
property=
"checkdate"
column=
"checkdate"
/>
</resultMap>
<select
id=
"selectPartnersList"
resultMap=
"partnersMap"
parameterType=
"java.util.Map"
>
<select
id=
"selectPartnersList"
resultMap=
"partnersMap"
>
select * from Partners where 1=1
<choose>
<when
test=
"
params.levels == 0
"
>
AND levels = #{
p
arams.levels}
<when
test=
"
newsParams.levels !=null
"
>
AND levels = #{
newsP
arams.levels}
</when>
<otherwise>
AND levels > 0
</otherwise>
</choose>
<if
test=
"
params.firmname !=null and p
arams.firmname !=''"
>
and firmname like concat('%',#{
p
arams.firmname},'%')
<if
test=
"
newsParams.firmname !=null and newsP
arams.firmname !=''"
>
and firmname like concat('%',#{
newsP
arams.firmname},'%')
</if>
<if
test=
"
params.editor !=null and p
arams.editor !=''"
>
and editor = #{
p
arams.editor}
<if
test=
"
newsParams.editor !=null and newsP
arams.editor !=''"
>
and editor = #{
newsP
arams.editor}
</if>
<if
test=
"
params.status !=null and p
arams.status !=''"
>
and status = #{
p
arams.status}
<if
test=
"
newsParams.status !=null and newsP
arams.status !=''"
>
and status = #{
newsP
arams.status}
</if>
<if
test=
"
params.technology !=null and p
arams.technology !=''"
>
and technology = #{
p
arams.technology}
<if
test=
"
newsParams.technology !=null and newsP
arams.technology !=''"
>
and technology = #{
newsP
arams.technology}
</if>
<if
test=
"
params.service !=null and p
arams.service !=''"
>
and service = #{
p
arams.service}
<if
test=
"
newsParams.service !=null and newsP
arams.service !=''"
>
and service = #{
newsP
arams.service}
</if>
<if
test=
"
params.levels !=
null"
>
and
levels = #{params.levels
}
<if
test=
"
newsParams.releaseTimeStart !=null and newsParams.releaseTimeEnd !=
null"
>
and
registerdate BETWEEN #{newsParams.releaseTimeStart} AND #{newsParams.releaseTimeEnd
}
</if>
<if
test=
"params.releaseTimeStart !=null and params.releaseTimeEnd !=null"
>
and registerdate BETWEEN #{params.releaseTimeStart} AND #{params.releaseTimeEnd}
</if>
<if
test=
"params.updateTimeStart !=null and params.updateTimeEnd !=null"
>
and updatedate BETWEEN #{params.updateTimeStart} AND #{params.updateTimeEnd}
<if
test=
"newsParams.updateTimeStart !=null and newsParams.updateTimeEnd !=null"
>
and updatedate BETWEEN #{newsParams.updateTimeStart} AND #{newsParams.updateTimeEnd}
</if>
order by id desc
</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