Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-api
Project
Project
Details
Activity
Releases
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
李伟
cust-api
Commits
6aaa0cf0
Commit
6aaa0cf0
authored
Dec 24, 2024
by
曹泽华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
话题管理
parent
519c93b4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
747 additions
and
0 deletions
+747
-0
OpmTopicController.java
...soft/business/opmTopic/controller/OpmTopicController.java
+172
-0
OpmTopicRepository.java
...org/rcisoft/business/opmTopic/dao/OpmTopicRepository.java
+40
-0
OpmTopic.java
...n/java/org/rcisoft/business/opmTopic/entity/OpmTopic.java
+155
-0
OpmTopicService.java
...rg/rcisoft/business/opmTopic/service/OpmTopicService.java
+74
-0
OpmTopicServiceImpl.java
...t/business/opmTopic/service/impl/OpmTopicServiceImpl.java
+177
-0
OpmTopicMapper.xml
...ources/mapper/business/opmTopic.mapper/OpmTopicMapper.xml
+129
-0
No files found.
src/main/java/org/rcisoft/business/opmTopic/controller/OpmTopicController.java
0 → 100644
View file @
6aaa0cf0
package
org
.
rcisoft
.
business
.
opmTopic
.
controller
;
/*固定导入*/
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.Parameters
;
import
jakarta.servlet.http.HttpServletResponse
;
import
org.rcisoft.business.opmTopic.entity.OpmTopic
;
import
org.rcisoft.business.opmTopic.service.OpmTopicService
;
import
org.rcisoft.core.anno.CyOpeLogAnno
;
import
org.rcisoft.core.constant.CyMessCons
;
import
org.rcisoft.core.controller.CyPaginationController
;
import
org.rcisoft.core.model.CyGridModel
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.operlog.enums.CyLogTypeEnum
;
import
org.rcisoft.core.result.CyResult
;
import
org.rcisoft.core.util.CyEpExcelUtil
;
import
org.rcisoft.core.util.CyResultGenUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
java.util.List
;
/**
* @author cy
* @date 2024年3月25日 下午1:42:40
*/
@RestController
@RequestMapping
(
"/opmTopic"
)
public
class
OpmTopicController
extends
CyPaginationController
<
OpmTopic
>
{
@Autowired
private
OpmTopicService
opmTopicServiceImpl
;
@PreAuthorize
(
"@cyPerm.hasPerm('opm:topic:increase')"
)
@CyOpeLogAnno
(
title
=
"system-话题管理-新增话题"
,
businessType
=
CyLogTypeEnum
.
INSERT
)
@Operation
(
summary
=
"添加话题"
,
description
=
"添加话题"
)
@PostMapping
(
value
=
"/add"
)
public
CyResult
add
(
@Valid
OpmTopic
opmTopic
,
BindingResult
bindingResult
)
{
CyPersistModel
data
=
opmTopicServiceImpl
.
persist
(
opmTopic
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
opmTopic
);
}
@PreAuthorize
(
"@cyPerm.hasPerm('opm:topic:removing')"
)
@CyOpeLogAnno
(
title
=
"system-话题管理-删除话题"
,
businessType
=
CyLogTypeEnum
.
DELETE
)
@Operation
(
summary
=
"删除话题"
,
description
=
"删除话题"
)
@Parameters
({
@Parameter
(
name
=
"businessId"
,
description
=
"businessId"
,
required
=
true
)})
@DeleteMapping
(
"/delete/{businessId:\\w+}"
)
public
CyResult
delete
(
@PathVariable
Integer
businessId
,
OpmTopic
opmTopic
)
{
opmTopic
.
setBusinessId
(
businessId
);
CyPersistModel
data
=
opmTopicServiceImpl
.
remove
(
opmTopic
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
businessId
);
}
@PreAuthorize
(
"@cyPerm.hasPerm('opm:topic:modifications')"
)
@CyOpeLogAnno
(
title
=
"system-话题管理-修改话题"
,
businessType
=
CyLogTypeEnum
.
INSERT
)
@Operation
(
summary
=
"修改话题"
,
description
=
"修改话题"
)
@Parameters
({
@Parameter
(
name
=
"businessId"
,
description
=
"businessId"
,
required
=
false
)})
@PostMapping
(
"/update/{businessId:\\w+}"
)
public
CyResult
update
(
@PathVariable
Integer
businessId
,
@Valid
OpmTopic
opmTopic
,
BindingResult
bindingResult
)
{
opmTopic
.
setBusinessId
(
businessId
);
CyPersistModel
data
=
opmTopicServiceImpl
.
merge
(
opmTopic
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
opmTopic
);
}
// @PreAuthorize("@cyPerm.hasPerm('opm:notice:singleSearch')")
@CyOpeLogAnno
(
title
=
"system-公告管理-查询公告"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@Operation
(
summary
=
"查询单一公告"
,
description
=
"查询单一公告"
)
@Parameters
({
@Parameter
(
name
=
"businessId"
,
description
=
"businessId"
,
required
=
true
)})
@GetMapping
(
"/detail/{businessId:\\w+}"
)
public
CyResult
detail
(
@PathVariable
Integer
businessId
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
opmTopicServiceImpl
.
findById
(
businessId
));
}
//@PreAuthorize("@cyPerm.hasPerm('sys:contentNewsInformation:list')")
@CyOpeLogAnno
(
title
=
"system-话题管理-查询话题"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@Operation
(
summary
=
"查询话题集合"
,
description
=
"查询话题集合"
)
@GetMapping
(
value
=
"/queryOpmTopic"
)
public
CyResult
querySysContentNewsInformations
(
OpmTopic
opmTopic
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
opmTopicServiceImpl
.
findAll
(
opmTopic
));
}
// @PreAuthorize("@cyPerm.hasPerm('opm:topic:pageSearch')")
@CyOpeLogAnno
(
title
=
"system-话题管理-查询话题"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@Operation
(
summary
=
"分页查询话题集合"
,
description
=
"分页查询话题集合"
)
@GetMapping
(
value
=
"/queryOpmTopicByPagination"
)
public
CyGridModel
listByPagination
(
OpmTopic
opmTopic
)
{
opmTopicServiceImpl
.
findAllByPagination
(
getPaginationUtility
(),
opmTopic
);
return
getGridModelResponse
();
}
//修改状态
@PreAuthorize
(
"@cyPerm.hasPerm('opm:topic:modificationsStatus')"
)
@CyOpeLogAnno
(
title
=
"system-话题管理-修改话题状态"
,
businessType
=
CyLogTypeEnum
.
UPDATE
)
@Operation
(
summary
=
"修改话题状态"
,
description
=
"修改话题状态"
)
@Parameters
({
@Parameter
(
name
=
"businessId"
,
description
=
"businessId"
,
required
=
true
)})
@PostMapping
(
"/updateStatus/{businessId:\\w+}"
)
public
CyResult
updateStatus
(
OpmTopic
opmTopic
)
{
CyPersistModel
data
=
opmTopicServiceImpl
.
updateStatus
(
opmTopic
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
opmTopic
);
}
//修改审核状态
@CyOpeLogAnno
(
title
=
"system-话题管理-修改话题状态"
,
businessType
=
CyLogTypeEnum
.
UPDATE
)
@Operation
(
summary
=
"修改话题状态"
,
description
=
"修改话题状态"
)
@Parameters
({
@Parameter
(
name
=
"businessId"
,
description
=
"businessId"
,
required
=
true
)})
@PostMapping
(
"/updateExamStatus/{businessId:\\w+}"
)
public
CyResult
updateExamStatus
(
OpmTopic
opmTopic
)
{
CyPersistModel
data
=
opmTopicServiceImpl
.
updateExamStatus
(
opmTopic
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
opmTopic
);
}
//修改审核状态
@CyOpeLogAnno
(
title
=
"system-话题管理-修改话题状态"
,
businessType
=
CyLogTypeEnum
.
UPDATE
)
@Operation
(
summary
=
"修改话题状态"
,
description
=
"修改话题状态"
)
@Parameters
({
@Parameter
(
name
=
"businessId"
,
description
=
"businessId"
,
required
=
true
)})
@PostMapping
(
"/updateNoExamStatus/{businessId:\\w+}"
)
public
CyResult
updateNoExamStatus
(
OpmTopic
opmTopic
)
{
CyPersistModel
data
=
opmTopicServiceImpl
.
updateNoExamStatus
(
opmTopic
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
opmTopic
);
}
@PreAuthorize
(
"@cyPerm.hasPerm('opm:topic:derive')"
)
@CyOpeLogAnno
(
title
=
"system-话题管理-查询话题"
,
businessType
=
CyLogTypeEnum
.
EXPORT
)
@Operation
(
summary
=
"导出话题信息"
,
description
=
"导出话题信息"
)
@GetMapping
(
value
=
"/export"
)
public
void
outSysContentNewsInformation
(
HttpServletResponse
response
,
OpmTopic
opmTopic
,
@PathVariable
@RequestParam
(
defaultValue
=
"0"
)
String
excelId
)
{
String
excelName
=
""
;
switch
(
excelId
)
{
case
"0"
:
excelName
=
"话题信息.xls"
;
break
;
case
"1"
:
excelName
=
"话题信息.xlsx"
;
break
;
case
"2"
:
excelName
=
"话题信息.csv"
;
break
;
}
List
<
OpmTopic
>
opmTopicList
=
opmTopicServiceImpl
.
export
(
opmTopic
);
CyEpExcelUtil
.
exportExcel
(
opmTopicList
,
"话题信息"
,
"话题信息"
,
OpmTopic
.
class
,
excelName
,
response
);
}
}
src/main/java/org/rcisoft/business/opmTopic/dao/OpmTopicRepository.java
0 → 100644
View file @
6aaa0cf0
package
org
.
rcisoft
.
business
.
opmTopic
.
dao
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.apache.ibatis.annotations.Param
;
import
org.rcisoft.business.opmTopic.entity.OpmTopic
;
import
org.rcisoft.core.mapper.CyBaseMapper
;
import
org.rcisoft.core.model.CyPageInfo
;
import
java.util.List
;
/**
* Created with cy on 2024年3月25日 下午1:42:40.
* @author wangFeilong
*/
public
interface
OpmTopicRepository
extends
CyBaseMapper
<
OpmTopic
>
{
List
<
OpmTopic
>
queryOpmTopic
(
@Param
(
"entity"
)
OpmTopic
opmTopic
);
/**
* 分页查询 cmsActivity
*
*/
IPage
<
OpmTopic
>
queryOpmTopicPaged
(
CyPageInfo
cyPageInfo
,
@Param
(
"entity"
)
OpmTopic
opmTopic
);
//根据id逻辑删除
int
deleteOpmTopic
(
@Param
(
"businessId"
)
Integer
businessId
);
//修改状态
int
updateStatus
(
@Param
(
"entity"
)
OpmTopic
opmTopic
);
//修改审核状态
int
updateExamStatus
(
@Param
(
"entity"
)
OpmTopic
opmTopic
);
int
updateNoExamStatus
(
@Param
(
"entity"
)
OpmTopic
opmTopic
);
OpmTopic
selectById
(
@Param
(
"businessId"
)
Integer
businessId
);
//权重验重
OpmTopic
checkWeight
(
@Param
(
"weight"
)
Integer
weight
);
}
src/main/java/org/rcisoft/business/opmTopic/entity/OpmTopic.java
0 → 100644
View file @
6aaa0cf0
package
org
.
rcisoft
.
business
.
opmTopic
.
entity
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
lombok.Data
;
import
org.rcisoft.core.entity.CyIdIncreEntity
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
/**
* Created with cy on 2024年3月25日 下午1:42:40.
*
* @author
*/
@Data
@TableName
(
"opm_topic"
)
public
class
OpmTopic
extends
CyIdIncreEntity
<
OpmTopic
>
{
/**
* @desc 创建人
* @column create_by
* @default
*/
@Excel
(
name
=
"创建人"
)
@TableField
(
"create_by"
)
private
String
createBy
;
/**
* @desc 创建时间
* @column create_date
* @default
*/
@Excel
(
name
=
"创建时间"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@TableField
(
"create_date"
)
private
Date
createDate
;
/**
* @desc 更新人
* @column update_by
* @default
*/
@Excel
(
name
=
"更新人"
)
@TableField
(
"update_by"
)
private
String
updateBy
;
/**
* @desc 更新时间
* @column update_date
* @default
*/
@Excel
(
name
=
"更新时间"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@TableField
(
"update_date"
)
private
Date
updateDate
;
/**
* @desc 备注
* @column remarks
* @default
*/
@JsonIgnore
@Excel
(
name
=
"备注"
)
@TableField
(
"remarks"
)
private
String
remarks
;
/**
* @desc 话题名称
* @column topic_name
* @default
*/
@Excel
(
name
=
"话题名称"
)
@TableField
(
"topic_name"
)
private
String
topicName
;
/**
* @desc 审核状态(0未审核、1已审核)
* @column exam_status
* @default
*/
@Excel
(
name
=
"审核状态(0未审核、1已审核)"
)
@TableField
(
"exam_status"
)
private
String
examStatus
;
/**
* @desc 启动状态(0禁用、1启动)
* @column flag
* @default
*/
@Excel
(
name
=
"启动状态(0禁用、1启动)"
)
@TableField
(
"flag"
)
private
String
flag
;
/**
* @desc 删除标志(0删除,1已删除)
* @column del_flag
* @default
*/
@Excel
(
name
=
"删除标志(0删除,1已删除)"
)
@TableField
(
"del_flag"
)
private
String
delFlag
;
/**
* @desc 排序
* @column weight
* @default
*/
@Excel
(
name
=
"排序"
)
private
Integer
weight
;
/**
* @desc 话题下的动态数
* @column article_count
* @default
*/
@Excel
(
name
=
"话题下的动态数"
)
@TableField
(
"article_count"
)
private
Integer
articleCount
;
/**
* 开始时间
*/
@JsonIgnore
@TableField
(
exist
=
false
)
private
String
beginTime
;
/**
* 结束时间
*/
@JsonIgnore
@TableField
(
exist
=
false
)
private
String
endTime
;
@TableField
(
exist
=
false
)
private
String
nickName
;
@TableField
(
exist
=
false
)
private
String
path
;
}
src/main/java/org/rcisoft/business/opmTopic/service/OpmTopicService.java
0 → 100644
View file @
6aaa0cf0
package
org
.
rcisoft
.
business
.
opmTopic
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.rcisoft.business.opmTopic.entity.OpmTopic
;
import
org.rcisoft.core.model.CyPageInfo
;
import
org.rcisoft.core.model.CyPersistModel
;
import
java.util.List
;
/**
* Created by cy on 2024年3月25日 下午1:42:40.
*/
public
interface
OpmTopicService
{
/**
* 保存 话题
* @param opmTopic
* @return
*/
CyPersistModel
persist
(
OpmTopic
opmTopic
);
/**
* 删除 话题
* @param opmTopic
* @return
*/
CyPersistModel
remove
(
OpmTopic
opmTopic
);
/**
* 修改 话题
* @param opmTopic
* @return
*/
CyPersistModel
merge
(
OpmTopic
opmTopic
);
/**
* 根据id查询 话题
* @param id
* @return
*/
OpmTopic
findById
(
Integer
id
);
/**
* 分页查询 话题
* @param opmTopic
* @return
*/
IPage
<
OpmTopic
>
findAllByPagination
(
CyPageInfo
<
OpmTopic
>
paginationUtility
,
OpmTopic
opmTopic
);
/**
* 查询list 话题
* @param opmTopic
* @return
*/
List
<
OpmTopic
>
findAll
(
OpmTopic
opmTopic
);
/**
* 导出话题
* @return
*/
List
<
OpmTopic
>
export
(
OpmTopic
opmTopic
);
/**
* 修改状态
*/
CyPersistModel
updateStatus
(
OpmTopic
opmTopic
);
CyPersistModel
updateExamStatus
(
OpmTopic
opmTopic
);
CyPersistModel
updateNoExamStatus
(
OpmTopic
opmTopic
);
}
src/main/java/org/rcisoft/business/opmTopic/service/impl/OpmTopicServiceImpl.java
0 → 100644
View file @
6aaa0cf0
package
org
.
rcisoft
.
business
.
opmTopic
.
service
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.rcisoft.business.opmTopic.dao.OpmTopicRepository
;
import
org.rcisoft.business.opmTopic.entity.OpmTopic
;
import
org.rcisoft.business.opmTopic.service.OpmTopicService
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.core.exception.CyServiceException
;
import
org.rcisoft.core.model.CyPageInfo
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
/**
* @author cy
* @date 2024年3月25日 下午1:42:40
*/
@Service
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
@Slf4j
public
class
OpmTopicServiceImpl
extends
ServiceImpl
<
OpmTopicRepository
,
OpmTopic
>
implements
OpmTopicService
{
@Autowired
private
Global
global
;
/**
* 保存 话题
*
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
CyPersistModel
persist
(
OpmTopic
opmTopic
)
{
//增加操作
opmTopic
.
setDelFlag
(
"0"
);
opmTopic
.
setExamStatus
(
"0"
);
//当图片字段没有时增加默认1
/* if (ObjectUtil.isNull(cmsNotice.getPictureId())) {
cmsNotice.setPictureId(global.getDEFAULT_NEWS_LOCATION());
}*/
OpmTopic
check
=
baseMapper
.
checkWeight
(
opmTopic
.
getWeight
());
if
(
ObjectUtil
.
isNotNull
(
check
))
{
throw
new
CyServiceException
(
500
,
"权重已存在"
);
}
else
{
int
line
=
baseMapper
.
insert
(
opmTopic
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"新增了ID为"
+
opmTopic
.
getBusinessId
()
+
"的话题信息"
);
return
new
CyPersistModel
(
line
);
}
}
/**
* 删除 话题
*
* @param opmTopic
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
CyPersistModel
remove
(
OpmTopic
opmTopic
)
{
int
line
=
baseMapper
.
deleteOpmTopic
(
opmTopic
.
getBusinessId
());
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"删除了ID为"
+
opmTopic
.
getBusinessId
()
+
"的话题信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 修改 话题
*
* @param opmTopic
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
CyPersistModel
merge
(
OpmTopic
opmTopic
)
{
//修改文本中的#image
OpmTopic
check
=
baseMapper
.
checkWeight
(
opmTopic
.
getWeight
());
if
(
ObjectUtil
.
isNotNull
(
check
)
&&
!
check
.
getBusinessId
().
equals
(
opmTopic
.
getBusinessId
()))
{
throw
new
CyServiceException
(
500
,
"权重已存在"
);
}
else
{
int
line
=
baseMapper
.
updateById
(
opmTopic
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"修改了ID为"
+
opmTopic
.
getBusinessId
()
+
"的话题信息"
);
return
new
CyPersistModel
(
line
);
}
}
/**
* 根据id查询 话题
*
* @param id
* @return
*/
@Override
public
OpmTopic
findById
(
Integer
id
)
{
OpmTopic
opmTopic
=
baseMapper
.
selectById
(
id
);
if
(
opmTopic
.
getPath
()
!=
null
)
{
opmTopic
.
setPath
(
global
.
getBase_Discovery
()
+
opmTopic
.
getPath
());
}
return
opmTopic
;
}
/**
* 分页查询 话题
*
* @param opmTopic
* @return
*/
@Override
public
IPage
<
OpmTopic
>
findAllByPagination
(
CyPageInfo
<
OpmTopic
>
paginationUtility
,
OpmTopic
opmTopic
)
{
IPage
<
OpmTopic
>
opmTopicIPage
=
baseMapper
.
queryOpmTopicPaged
(
paginationUtility
,
opmTopic
);
List
<
OpmTopic
>
newsInformation
=
opmTopicIPage
.
getRecords
();
for
(
OpmTopic
news
:
newsInformation
)
{
if
(
news
.
getPath
()
!=
null
)
{
news
.
setPath
(
global
.
getBase_Discovery
()
+
news
.
getPath
());
}
}
opmTopicIPage
.
setRecords
(
newsInformation
);
return
opmTopicIPage
;
}
/**
* 查询list 话题
*
* @param opmTopic
* @return
*/
@Override
public
List
<
OpmTopic
>
findAll
(
OpmTopic
opmTopic
)
{
return
baseMapper
.
queryOpmTopic
(
opmTopic
);
}
/**
* 导出话题
*
* @return
*/
@Override
public
List
<
OpmTopic
>
export
(
OpmTopic
opmTopic
)
{
List
<
OpmTopic
>
opmTopicList
=
baseMapper
.
queryOpmTopic
(
opmTopic
);
return
opmTopicList
;
}
@Override
public
CyPersistModel
updateStatus
(
OpmTopic
opmTopic
)
{
int
line
=
baseMapper
.
updateStatus
(
opmTopic
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"修改了ID为"
+
opmTopic
.
getBusinessId
()
+
"的话题信息状态"
);
return
new
CyPersistModel
(
line
);
}
@Override
public
CyPersistModel
updateExamStatus
(
OpmTopic
opmTopic
)
{
int
line
=
baseMapper
.
updateExamStatus
(
opmTopic
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"修改了ID为"
+
opmTopic
.
getBusinessId
()
+
"的话题信息状态"
);
return
new
CyPersistModel
(
line
);
}
@Override
public
CyPersistModel
updateNoExamStatus
(
OpmTopic
opmTopic
)
{
int
line
=
baseMapper
.
updateNoExamStatus
(
opmTopic
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"修改了ID为"
+
opmTopic
.
getBusinessId
()
+
"的话题信息状态"
);
return
new
CyPersistModel
(
line
);
}
}
src/main/resources/mapper/business/opmTopic.mapper/OpmTopicMapper.xml
0 → 100644
View file @
6aaa0cf0
<?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=
"org.rcisoft.business.opmTopic.dao.OpmTopicRepository"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.opmTopic.entity.OpmTopic"
>
<id
column=
"business_id"
jdbcType=
"INTEGER"
property=
"businessId"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"update_date"
jdbcType=
"DATE"
property=
"updateDate"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
<result
column=
"exam_status"
jdbcType=
"VARCHAR"
property=
"examStatus"
/>
<result
column=
"topic_name"
jdbcType=
"VARCHAR"
property=
"topicName"
/>
<result
column=
"weight"
jdbcType=
"INTEGER"
property=
"weight"
/>
<result
column=
"article_count"
jdbcType=
"INTEGER"
property=
"articleCount"
/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select
id=
"queryOpmTopic"
resultMap=
"BaseResultMap"
>
select * from opm_topic
where 1=1
<if
test=
"entity.createBy !=null and entity.createBy != '' "
>
and create_by like concat('%',#{entity.createBy},'%')
</if>
<if
test=
"entity.beginTime !=null and entity.beginTime != '' "
>
and create_date
>
= #{entity.beginTime}
</if>
<if
test=
"entity.endTime !=null and entity.endTime != '' "
>
and create_date
<
= #{entity.endTime}
</if>
<if
test=
"entity.updateBy !=null and entity.updateBy != '' "
>
and update_by like concat('%',#{entity.updateBy},'%')
</if>
<if
test=
"entity.beginTime !=null and entity.beginTime != '' "
>
and update_date
>
= #{entity.beginTime}
</if>
<if
test=
"entity.endTime !=null and entity.endTime != '' "
>
and update_date
<
= #{entity.endTime}
</if>
<if
test=
"entity.topicName !=null and entity.topicName != '' "
>
and topic_name like concat('%',#{entity.topicName},'%')
</if>
<if
test=
"entity.weight !=null and entity.weight != '' "
>
and weight like concat('%',#{entity.weight},'%')
</if>
ORDER BY business_id DESC
</select>
<select
id=
"queryOpmTopicPaged"
resultMap=
"BaseResultMap"
>
SELECT cn.business_id,
cn.create_by,
cn.create_date,
cn.update_by,
cn.del_flag,
cn.flag,
cn.topic_name,
cn.exam_status,
cn.weight,
cn.article_count,
su.nick_name as nickName
FROM opm_topic cn
LEFT JOIN sys_user su on su.business_id = cn.create_by
where cn.del_flag='0'
<if
test=
"entity.flag!=null and entity.flag != '' "
>
and cn.flag = #{entity.flag}
</if>
<if
test=
"entity.examStatus!=null and entity.examStatus != '' "
>
and cn.exam_status = #{entity.examStatus}
</if>
<if
test=
"entity.createBy !=null and entity.createBy != '' "
>
and create_by like concat('%',#{entity.createBy},'%')
</if>
<if
test=
"entity.beginTime !=null "
>
and cn.createDate
>
= #{entity.beginTime}
</if>
<if
test=
"entity.endTime !=null "
>
and cn.createDate
<
= #{entity.endTime}
</if>
<if
test=
"entity.updateBy !=null and entity.updateBy != '' "
>
and update_by like concat('%',#{entity.updateBy},'%')
</if>
<if
test=
"entity.weight !=null and entity.weight != '' "
>
and weight like concat('%',#{entity.weight},'%')
</if>
<if
test=
"entity.articleCount !=null and entity.articleCount != '' "
>
and article_count like concat('%',#{entity.articleCount},'%')
</if>
<if
test=
"entity.topicName !=null and entity.topicName != '' "
>
and topic_name like concat('%',#{entity.topicName},'%')
</if>
ORDER BY cn.create_date DESC
</select>
<update
id=
"deleteOpmTopic"
parameterType=
"java.lang.Integer"
>
update opm_topic
set del_flag = '1'
where business_id = #{businessId}
</update>
<update
id=
"updateStatus"
parameterType=
"org.rcisoft.business.opmTopic.entity.OpmTopic"
>
update opm_topic
set flag = #{ entity.flag}
where business_id = #{entity.businessId}
</update>
<update
id=
"updateExamStatus"
parameterType=
"org.rcisoft.business.opmTopic.entity.OpmTopic"
>
update opm_topic
set exam_status = '1'
where business_id = #{entity.businessId}
</update>
<update
id=
"updateNoExamStatus"
parameterType=
"org.rcisoft.business.opmTopic.entity.OpmTopic"
>
update opm_topic
set exam_status = '0'
where business_id = #{entity.businessId}
</update>
<select
id=
"selectById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select cn.*
from opm_topic cn
where cn.business_id = #{businessId}
</select>
<select
id=
"checkWeight"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select * from opm_topic
where 1=1
and del_flag = '0'
and weight = #{weight}
</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