Commit d1ff59e6 authored by 廖旭伟's avatar 廖旭伟

增加新闻点赞记录表,增加取消点赞接口

parent fb8c323c
......@@ -88,3 +88,22 @@ INSERT INTO `mortals_xhx_task` (`name`, `taskKey`, `status`, `excuteService`, `e
ALTER TABLE `mortals_xhx_bussinesscard` ADD COLUMN `backdrop` varchar(256) COMMENT '名片背景';
ALTER TABLE `mortals_xhx_news` ADD COLUMN `upNums` tinyint(4) NOT NULL DEFAULT '0' COMMENT '点赞次数';
-- ----------------------------
-- 新闻点赞记录信息表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_news_up`;
CREATE TABLE mortals_xhx_news_up(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`newsId` bigint(20) COMMENT '新闻ID',
`upId` bigint(20) COMMENT '点赞人ID',
`upName` varchar(64) NOT NULL COMMENT '点赞人名称',
`sumUp` int(4) DEFAULT '0' COMMENT '累计分享次数',
`remark` varchar(255) COMMENT '备注',
`upTime` datetime NOT NULL COMMENT '点赞时间',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
,KEY `upName` (`upName`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='新闻点赞记录信息';
......@@ -26,7 +26,30 @@ public class NewsListInfo {
* 发布时间
*/
private Date publishTime;
/**
* 所属部门名称
*/
private String deptName;
/**
* 声明
*/
private String statement;
/**
* 文章来源
*/
private String source;
/**
* 责任编辑
*/
private String editor;
/**点赞状态**/
private Integer upStatus;
/**分享状态**/
private Integer shareStatus;
/**
* 头像地址
*/
private String photoPath;
}
......@@ -172,7 +172,33 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
if (ObjectUtils.isEmpty(newsReq.getId())) {
throw new AppException("新闻id不能为空!");
}
NewsEntity newsEntity = newsService.upNews(newsReq.getId());
NewsEntity newsEntity = newsService.upNews(newsReq.getId(),context,1);
rest.setData(newsEntity);
this.init(model, context);
rest.setDict(model.get("dict"));
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
/**
* 新闻取消点赞
*/
@PostMapping(value = "cancelUp")
public Rest<NewsEntity> cancelUpNews(@RequestBody NewsReq newsReq) {
String busiDesc = "新闻点赞";
log.info("【{}】【请求体】--> {}", busiDesc, JSONObject.toJSONString(newsReq));
Rest<NewsEntity> rest = Rest.ok(busiDesc + " 【成功】");
Context context = this.getContext();
Map<String, Object> model = new HashMap<>();
try {
if (ObjectUtils.isEmpty(newsReq.getId())) {
throw new AppException("新闻id不能为空!");
}
NewsEntity newsEntity = newsService.upNews(newsReq.getId(),context,-1);
rest.setData(newsEntity);
this.init(model, context);
rest.setDict(model.get("dict"));
......
package com.mortals.xhx.module.news.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.news.model.NewsUpEntity;
import java.util.List;
/**
* 新闻点赞记录信息Dao
* 新闻点赞记录信息 DAO接口
*
* @author zxfei
* @date 2024-12-04
*/
public interface NewsUpDao extends ICRUDDao<NewsUpEntity,Long>{
}
package com.mortals.xhx.module.news.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.news.dao.NewsUpDao;
import com.mortals.xhx.module.news.model.NewsUpEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 新闻点赞记录信息DaoImpl DAO接口
*
* @author zxfei
* @date 2024-12-04
*/
@Repository("newsUpDao")
public class NewsUpDaoImpl extends BaseCRUDDaoMybatis<NewsUpEntity,Long> implements NewsUpDao {
}
package com.mortals.xhx.module.news.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.news.model.vo.NewsUpVo;
import lombok.Data;
/**
* 新闻点赞记录信息实体对象
*
* @author zxfei
* @date 2024-12-04
*/
@Data
public class NewsUpEntity extends NewsUpVo {
private static final long serialVersionUID = 1L;
/**
* 新闻ID
*/
private Long newsId;
/**
* 点赞人ID
*/
private Long upId;
/**
* 点赞人名称
*/
private String upName;
/**
* 累计分享次数
*/
private Integer sumUp;
/**
* 备注
*/
private String remark;
/**
* 点赞时间
*/
private Date upTime;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof NewsUpEntity) {
NewsUpEntity tmp = (NewsUpEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.newsId = null;
this.upId = null;
this.upName = "";
this.sumUp = 0;
this.remark = "";
this.upTime = null;
}
}
\ No newline at end of file
package com.mortals.xhx.module.news.model;
import java.util.Date;
import java.util.List;
import com.mortals.xhx.module.news.model.NewsUpEntity;
/**
* 新闻点赞记录信息查询对象
*
* @author zxfei
* @date 2024-12-04
*/
public class NewsUpQuery extends NewsUpEntity {
/** 开始 序号,主键,自增长 */
private Long idStart;
/** 结束 序号,主键,自增长 */
private Long idEnd;
/** 增加 序号,主键,自增长 */
private Long idIncrement;
/** 序号,主键,自增长列表 */
private List <Long> idList;
/** 序号,主键,自增长排除列表 */
private List <Long> idNotList;
/** 开始 新闻ID */
private Long newsIdStart;
/** 结束 新闻ID */
private Long newsIdEnd;
/** 增加 新闻ID */
private Long newsIdIncrement;
/** 新闻ID列表 */
private List <Long> newsIdList;
/** 新闻ID排除列表 */
private List <Long> newsIdNotList;
/** 开始 点赞人ID */
private Long upIdStart;
/** 结束 点赞人ID */
private Long upIdEnd;
/** 增加 点赞人ID */
private Long upIdIncrement;
/** 点赞人ID列表 */
private List <Long> upIdList;
/** 点赞人ID排除列表 */
private List <Long> upIdNotList;
/** 点赞人名称 */
private List<String> upNameList;
/** 点赞人名称排除列表 */
private List <String> upNameNotList;
/** 开始 累计分享次数 */
private Integer sumUpStart;
/** 结束 累计分享次数 */
private Integer sumUpEnd;
/** 增加 累计分享次数 */
private Integer sumUpIncrement;
/** 累计分享次数列表 */
private List <Integer> sumUpList;
/** 累计分享次数排除列表 */
private List <Integer> sumUpNotList;
/** 备注 */
private List<String> remarkList;
/** 备注排除列表 */
private List <String> remarkNotList;
/** 开始 点赞时间 */
private String upTimeStart;
/** 结束 点赞时间 */
private String upTimeEnd;
/** 开始 创建用户 */
private Long createUserIdStart;
/** 结束 创建用户 */
private Long createUserIdEnd;
/** 增加 创建用户 */
private Long createUserIdIncrement;
/** 创建用户列表 */
private List <Long> createUserIdList;
/** 创建用户排除列表 */
private List <Long> createUserIdNotList;
/** 开始 创建时间 */
private String createTimeStart;
/** 结束 创建时间 */
private String createTimeEnd;
/** 开始 更新用户 */
private Long updateUserIdStart;
/** 结束 更新用户 */
private Long updateUserIdEnd;
/** 增加 更新用户 */
private Long updateUserIdIncrement;
/** 更新用户列表 */
private List <Long> updateUserIdList;
/** 更新用户排除列表 */
private List <Long> updateUserIdNotList;
/** 开始 更新时间 */
private String updateTimeStart;
/** 结束 更新时间 */
private String updateTimeEnd;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<NewsUpQuery> orConditionList;
/** AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4) */
private List<NewsUpQuery> andConditionList;
public NewsUpQuery(){}
/**
* 获取 开始 序号,主键,自增长
* @return idStart
*/
public Long getIdStart(){
return this.idStart;
}
/**
* 设置 开始 序号,主键,自增长
* @param idStart
*/
public void setIdStart(Long idStart){
this.idStart = idStart;
}
/**
* 获取 结束 序号,主键,自增长
* @return $idEnd
*/
public Long getIdEnd(){
return this.idEnd;
}
/**
* 设置 结束 序号,主键,自增长
* @param idEnd
*/
public void setIdEnd(Long idEnd){
this.idEnd = idEnd;
}
/**
* 获取 增加 序号,主键,自增长
* @return idIncrement
*/
public Long getIdIncrement(){
return this.idIncrement;
}
/**
* 设置 增加 序号,主键,自增长
* @param idIncrement
*/
public void setIdIncrement(Long idIncrement){
this.idIncrement = idIncrement;
}
/**
* 获取 序号,主键,自增长
* @return idList
*/
public List<Long> getIdList(){
return this.idList;
}
/**
* 设置 序号,主键,自增长
* @param idList
*/
public void setIdList(List<Long> idList){
this.idList = idList;
}
/**
* 获取 序号,主键,自增长
* @return idNotList
*/
public List<Long> getIdNotList(){
return this.idNotList;
}
/**
* 设置 序号,主键,自增长
* @param idNotList
*/
public void setIdNotList(List<Long> idNotList){
this.idNotList = idNotList;
}
/**
* 获取 开始 新闻ID
* @return newsIdStart
*/
public Long getNewsIdStart(){
return this.newsIdStart;
}
/**
* 设置 开始 新闻ID
* @param newsIdStart
*/
public void setNewsIdStart(Long newsIdStart){
this.newsIdStart = newsIdStart;
}
/**
* 获取 结束 新闻ID
* @return $newsIdEnd
*/
public Long getNewsIdEnd(){
return this.newsIdEnd;
}
/**
* 设置 结束 新闻ID
* @param newsIdEnd
*/
public void setNewsIdEnd(Long newsIdEnd){
this.newsIdEnd = newsIdEnd;
}
/**
* 获取 增加 新闻ID
* @return newsIdIncrement
*/
public Long getNewsIdIncrement(){
return this.newsIdIncrement;
}
/**
* 设置 增加 新闻ID
* @param newsIdIncrement
*/
public void setNewsIdIncrement(Long newsIdIncrement){
this.newsIdIncrement = newsIdIncrement;
}
/**
* 获取 新闻ID
* @return newsIdList
*/
public List<Long> getNewsIdList(){
return this.newsIdList;
}
/**
* 设置 新闻ID
* @param newsIdList
*/
public void setNewsIdList(List<Long> newsIdList){
this.newsIdList = newsIdList;
}
/**
* 获取 新闻ID
* @return newsIdNotList
*/
public List<Long> getNewsIdNotList(){
return this.newsIdNotList;
}
/**
* 设置 新闻ID
* @param newsIdNotList
*/
public void setNewsIdNotList(List<Long> newsIdNotList){
this.newsIdNotList = newsIdNotList;
}
/**
* 获取 开始 点赞人ID
* @return upIdStart
*/
public Long getUpIdStart(){
return this.upIdStart;
}
/**
* 设置 开始 点赞人ID
* @param upIdStart
*/
public void setUpIdStart(Long upIdStart){
this.upIdStart = upIdStart;
}
/**
* 获取 结束 点赞人ID
* @return $upIdEnd
*/
public Long getUpIdEnd(){
return this.upIdEnd;
}
/**
* 设置 结束 点赞人ID
* @param upIdEnd
*/
public void setUpIdEnd(Long upIdEnd){
this.upIdEnd = upIdEnd;
}
/**
* 获取 增加 点赞人ID
* @return upIdIncrement
*/
public Long getUpIdIncrement(){
return this.upIdIncrement;
}
/**
* 设置 增加 点赞人ID
* @param upIdIncrement
*/
public void setUpIdIncrement(Long upIdIncrement){
this.upIdIncrement = upIdIncrement;
}
/**
* 获取 点赞人ID
* @return upIdList
*/
public List<Long> getUpIdList(){
return this.upIdList;
}
/**
* 设置 点赞人ID
* @param upIdList
*/
public void setUpIdList(List<Long> upIdList){
this.upIdList = upIdList;
}
/**
* 获取 点赞人ID
* @return upIdNotList
*/
public List<Long> getUpIdNotList(){
return this.upIdNotList;
}
/**
* 设置 点赞人ID
* @param upIdNotList
*/
public void setUpIdNotList(List<Long> upIdNotList){
this.upIdNotList = upIdNotList;
}
/**
* 获取 点赞人名称
* @return upNameList
*/
public List<String> getUpNameList(){
return this.upNameList;
}
/**
* 设置 点赞人名称
* @param upNameList
*/
public void setUpNameList(List<String> upNameList){
this.upNameList = upNameList;
}
/**
* 获取 点赞人名称
* @return upNameNotList
*/
public List<String> getUpNameNotList(){
return this.upNameNotList;
}
/**
* 设置 点赞人名称
* @param upNameNotList
*/
public void setUpNameNotList(List<String> upNameNotList){
this.upNameNotList = upNameNotList;
}
/**
* 获取 开始 累计分享次数
* @return sumUpStart
*/
public Integer getSumUpStart(){
return this.sumUpStart;
}
/**
* 设置 开始 累计分享次数
* @param sumUpStart
*/
public void setSumUpStart(Integer sumUpStart){
this.sumUpStart = sumUpStart;
}
/**
* 获取 结束 累计分享次数
* @return $sumUpEnd
*/
public Integer getSumUpEnd(){
return this.sumUpEnd;
}
/**
* 设置 结束 累计分享次数
* @param sumUpEnd
*/
public void setSumUpEnd(Integer sumUpEnd){
this.sumUpEnd = sumUpEnd;
}
/**
* 获取 增加 累计分享次数
* @return sumUpIncrement
*/
public Integer getSumUpIncrement(){
return this.sumUpIncrement;
}
/**
* 设置 增加 累计分享次数
* @param sumUpIncrement
*/
public void setSumUpIncrement(Integer sumUpIncrement){
this.sumUpIncrement = sumUpIncrement;
}
/**
* 获取 累计分享次数
* @return sumUpList
*/
public List<Integer> getSumUpList(){
return this.sumUpList;
}
/**
* 设置 累计分享次数
* @param sumUpList
*/
public void setSumUpList(List<Integer> sumUpList){
this.sumUpList = sumUpList;
}
/**
* 获取 累计分享次数
* @return sumUpNotList
*/
public List<Integer> getSumUpNotList(){
return this.sumUpNotList;
}
/**
* 设置 累计分享次数
* @param sumUpNotList
*/
public void setSumUpNotList(List<Integer> sumUpNotList){
this.sumUpNotList = sumUpNotList;
}
/**
* 获取 备注
* @return remarkList
*/
public List<String> getRemarkList(){
return this.remarkList;
}
/**
* 设置 备注
* @param remarkList
*/
public void setRemarkList(List<String> remarkList){
this.remarkList = remarkList;
}
/**
* 获取 备注
* @return remarkNotList
*/
public List<String> getRemarkNotList(){
return this.remarkNotList;
}
/**
* 设置 备注
* @param remarkNotList
*/
public void setRemarkNotList(List<String> remarkNotList){
this.remarkNotList = remarkNotList;
}
/**
* 获取 开始 点赞时间
* @return upTimeStart
*/
public String getUpTimeStart(){
return this.upTimeStart;
}
/**
* 设置 开始 点赞时间
* @param upTimeStart
*/
public void setUpTimeStart(String upTimeStart){
this.upTimeStart = upTimeStart;
}
/**
* 获取 结束 点赞时间
* @return upTimeEnd
*/
public String getUpTimeEnd(){
return this.upTimeEnd;
}
/**
* 设置 结束 点赞时间
* @param upTimeEnd
*/
public void setUpTimeEnd(String upTimeEnd){
this.upTimeEnd = upTimeEnd;
}
/**
* 获取 开始 创建用户
* @return createUserIdStart
*/
public Long getCreateUserIdStart(){
return this.createUserIdStart;
}
/**
* 设置 开始 创建用户
* @param createUserIdStart
*/
public void setCreateUserIdStart(Long createUserIdStart){
this.createUserIdStart = createUserIdStart;
}
/**
* 获取 结束 创建用户
* @return $createUserIdEnd
*/
public Long getCreateUserIdEnd(){
return this.createUserIdEnd;
}
/**
* 设置 结束 创建用户
* @param createUserIdEnd
*/
public void setCreateUserIdEnd(Long createUserIdEnd){
this.createUserIdEnd = createUserIdEnd;
}
/**
* 获取 增加 创建用户
* @return createUserIdIncrement
*/
public Long getCreateUserIdIncrement(){
return this.createUserIdIncrement;
}
/**
* 设置 增加 创建用户
* @param createUserIdIncrement
*/
public void setCreateUserIdIncrement(Long createUserIdIncrement){
this.createUserIdIncrement = createUserIdIncrement;
}
/**
* 获取 创建用户
* @return createUserIdList
*/
public List<Long> getCreateUserIdList(){
return this.createUserIdList;
}
/**
* 设置 创建用户
* @param createUserIdList
*/
public void setCreateUserIdList(List<Long> createUserIdList){
this.createUserIdList = createUserIdList;
}
/**
* 获取 创建用户
* @return createUserIdNotList
*/
public List<Long> getCreateUserIdNotList(){
return this.createUserIdNotList;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public void setCreateUserIdNotList(List<Long> createUserIdNotList){
this.createUserIdNotList = createUserIdNotList;
}
/**
* 获取 开始 创建时间
* @return createTimeStart
*/
public String getCreateTimeStart(){
return this.createTimeStart;
}
/**
* 设置 开始 创建时间
* @param createTimeStart
*/
public void setCreateTimeStart(String createTimeStart){
this.createTimeStart = createTimeStart;
}
/**
* 获取 结束 创建时间
* @return createTimeEnd
*/
public String getCreateTimeEnd(){
return this.createTimeEnd;
}
/**
* 设置 结束 创建时间
* @param createTimeEnd
*/
public void setCreateTimeEnd(String createTimeEnd){
this.createTimeEnd = createTimeEnd;
}
/**
* 获取 开始 更新用户
* @return updateUserIdStart
*/
public Long getUpdateUserIdStart(){
return this.updateUserIdStart;
}
/**
* 设置 开始 更新用户
* @param updateUserIdStart
*/
public void setUpdateUserIdStart(Long updateUserIdStart){
this.updateUserIdStart = updateUserIdStart;
}
/**
* 获取 结束 更新用户
* @return $updateUserIdEnd
*/
public Long getUpdateUserIdEnd(){
return this.updateUserIdEnd;
}
/**
* 设置 结束 更新用户
* @param updateUserIdEnd
*/
public void setUpdateUserIdEnd(Long updateUserIdEnd){
this.updateUserIdEnd = updateUserIdEnd;
}
/**
* 获取 增加 更新用户
* @return updateUserIdIncrement
*/
public Long getUpdateUserIdIncrement(){
return this.updateUserIdIncrement;
}
/**
* 设置 增加 更新用户
* @param updateUserIdIncrement
*/
public void setUpdateUserIdIncrement(Long updateUserIdIncrement){
this.updateUserIdIncrement = updateUserIdIncrement;
}
/**
* 获取 更新用户
* @return updateUserIdList
*/
public List<Long> getUpdateUserIdList(){
return this.updateUserIdList;
}
/**
* 设置 更新用户
* @param updateUserIdList
*/
public void setUpdateUserIdList(List<Long> updateUserIdList){
this.updateUserIdList = updateUserIdList;
}
/**
* 获取 更新用户
* @return updateUserIdNotList
*/
public List<Long> getUpdateUserIdNotList(){
return this.updateUserIdNotList;
}
/**
* 设置 更新用户
* @param updateUserIdNotList
*/
public void setUpdateUserIdNotList(List<Long> updateUserIdNotList){
this.updateUserIdNotList = updateUserIdNotList;
}
/**
* 获取 开始 更新时间
* @return updateTimeStart
*/
public String getUpdateTimeStart(){
return this.updateTimeStart;
}
/**
* 设置 开始 更新时间
* @param updateTimeStart
*/
public void setUpdateTimeStart(String updateTimeStart){
this.updateTimeStart = updateTimeStart;
}
/**
* 获取 结束 更新时间
* @return updateTimeEnd
*/
public String getUpdateTimeEnd(){
return this.updateTimeEnd;
}
/**
* 设置 结束 更新时间
* @param updateTimeEnd
*/
public void setUpdateTimeEnd(String updateTimeEnd){
this.updateTimeEnd = updateTimeEnd;
}
/**
* 设置 序号,主键,自增长
* @param id
*/
public NewsUpQuery id(Long id){
setId(id);
return this;
}
/**
* 设置 开始 序号,主键,自增长
* @param idStart
*/
public NewsUpQuery idStart(Long idStart){
this.idStart = idStart;
return this;
}
/**
* 设置 结束 序号,主键,自增长
* @param idEnd
*/
public NewsUpQuery idEnd(Long idEnd){
this.idEnd = idEnd;
return this;
}
/**
* 设置 增加 序号,主键,自增长
* @param idIncrement
*/
public NewsUpQuery idIncrement(Long idIncrement){
this.idIncrement = idIncrement;
return this;
}
/**
* 设置 序号,主键,自增长
* @param idList
*/
public NewsUpQuery idList(List<Long> idList){
this.idList = idList;
return this;
}
/**
* 设置 序号,主键,自增长
* @param idNotList
*/
public NewsUpQuery idNotList(List<Long> idNotList){
this.idNotList = idNotList;
return this;
}
/**
* 设置 新闻ID
* @param newsId
*/
public NewsUpQuery newsId(Long newsId){
setNewsId(newsId);
return this;
}
/**
* 设置 开始 新闻ID
* @param newsIdStart
*/
public NewsUpQuery newsIdStart(Long newsIdStart){
this.newsIdStart = newsIdStart;
return this;
}
/**
* 设置 结束 新闻ID
* @param newsIdEnd
*/
public NewsUpQuery newsIdEnd(Long newsIdEnd){
this.newsIdEnd = newsIdEnd;
return this;
}
/**
* 设置 增加 新闻ID
* @param newsIdIncrement
*/
public NewsUpQuery newsIdIncrement(Long newsIdIncrement){
this.newsIdIncrement = newsIdIncrement;
return this;
}
/**
* 设置 新闻ID
* @param newsIdList
*/
public NewsUpQuery newsIdList(List<Long> newsIdList){
this.newsIdList = newsIdList;
return this;
}
/**
* 设置 新闻ID
* @param newsIdNotList
*/
public NewsUpQuery newsIdNotList(List<Long> newsIdNotList){
this.newsIdNotList = newsIdNotList;
return this;
}
/**
* 设置 点赞人ID
* @param upId
*/
public NewsUpQuery upId(Long upId){
setUpId(upId);
return this;
}
/**
* 设置 开始 点赞人ID
* @param upIdStart
*/
public NewsUpQuery upIdStart(Long upIdStart){
this.upIdStart = upIdStart;
return this;
}
/**
* 设置 结束 点赞人ID
* @param upIdEnd
*/
public NewsUpQuery upIdEnd(Long upIdEnd){
this.upIdEnd = upIdEnd;
return this;
}
/**
* 设置 增加 点赞人ID
* @param upIdIncrement
*/
public NewsUpQuery upIdIncrement(Long upIdIncrement){
this.upIdIncrement = upIdIncrement;
return this;
}
/**
* 设置 点赞人ID
* @param upIdList
*/
public NewsUpQuery upIdList(List<Long> upIdList){
this.upIdList = upIdList;
return this;
}
/**
* 设置 点赞人ID
* @param upIdNotList
*/
public NewsUpQuery upIdNotList(List<Long> upIdNotList){
this.upIdNotList = upIdNotList;
return this;
}
/**
* 设置 点赞人名称
* @param upName
*/
public NewsUpQuery upName(String upName){
setUpName(upName);
return this;
}
/**
* 设置 点赞人名称
* @param upNameList
*/
public NewsUpQuery upNameList(List<String> upNameList){
this.upNameList = upNameList;
return this;
}
/**
* 设置 累计分享次数
* @param sumUp
*/
public NewsUpQuery sumUp(Integer sumUp){
setSumUp(sumUp);
return this;
}
/**
* 设置 开始 累计分享次数
* @param sumUpStart
*/
public NewsUpQuery sumUpStart(Integer sumUpStart){
this.sumUpStart = sumUpStart;
return this;
}
/**
* 设置 结束 累计分享次数
* @param sumUpEnd
*/
public NewsUpQuery sumUpEnd(Integer sumUpEnd){
this.sumUpEnd = sumUpEnd;
return this;
}
/**
* 设置 增加 累计分享次数
* @param sumUpIncrement
*/
public NewsUpQuery sumUpIncrement(Integer sumUpIncrement){
this.sumUpIncrement = sumUpIncrement;
return this;
}
/**
* 设置 累计分享次数
* @param sumUpList
*/
public NewsUpQuery sumUpList(List<Integer> sumUpList){
this.sumUpList = sumUpList;
return this;
}
/**
* 设置 累计分享次数
* @param sumUpNotList
*/
public NewsUpQuery sumUpNotList(List<Integer> sumUpNotList){
this.sumUpNotList = sumUpNotList;
return this;
}
/**
* 设置 备注
* @param remark
*/
public NewsUpQuery remark(String remark){
setRemark(remark);
return this;
}
/**
* 设置 备注
* @param remarkList
*/
public NewsUpQuery remarkList(List<String> remarkList){
this.remarkList = remarkList;
return this;
}
/**
* 设置 创建用户
* @param createUserId
*/
public NewsUpQuery createUserId(Long createUserId){
setCreateUserId(createUserId);
return this;
}
/**
* 设置 开始 创建用户
* @param createUserIdStart
*/
public NewsUpQuery createUserIdStart(Long createUserIdStart){
this.createUserIdStart = createUserIdStart;
return this;
}
/**
* 设置 结束 创建用户
* @param createUserIdEnd
*/
public NewsUpQuery createUserIdEnd(Long createUserIdEnd){
this.createUserIdEnd = createUserIdEnd;
return this;
}
/**
* 设置 增加 创建用户
* @param createUserIdIncrement
*/
public NewsUpQuery createUserIdIncrement(Long createUserIdIncrement){
this.createUserIdIncrement = createUserIdIncrement;
return this;
}
/**
* 设置 创建用户
* @param createUserIdList
*/
public NewsUpQuery createUserIdList(List<Long> createUserIdList){
this.createUserIdList = createUserIdList;
return this;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public NewsUpQuery createUserIdNotList(List<Long> createUserIdNotList){
this.createUserIdNotList = createUserIdNotList;
return this;
}
/**
* 设置 更新用户
* @param updateUserId
*/
public NewsUpQuery updateUserId(Long updateUserId){
setUpdateUserId(updateUserId);
return this;
}
/**
* 设置 开始 更新用户
* @param updateUserIdStart
*/
public NewsUpQuery updateUserIdStart(Long updateUserIdStart){
this.updateUserIdStart = updateUserIdStart;
return this;
}
/**
* 设置 结束 更新用户
* @param updateUserIdEnd
*/
public NewsUpQuery updateUserIdEnd(Long updateUserIdEnd){
this.updateUserIdEnd = updateUserIdEnd;
return this;
}
/**
* 设置 增加 更新用户
* @param updateUserIdIncrement
*/
public NewsUpQuery updateUserIdIncrement(Long updateUserIdIncrement){
this.updateUserIdIncrement = updateUserIdIncrement;
return this;
}
/**
* 设置 更新用户
* @param updateUserIdList
*/
public NewsUpQuery updateUserIdList(List<Long> updateUserIdList){
this.updateUserIdList = updateUserIdList;
return this;
}
/**
* 设置 更新用户
* @param updateUserIdNotList
*/
public NewsUpQuery updateUserIdNotList(List<Long> updateUserIdNotList){
this.updateUserIdNotList = updateUserIdNotList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
*/
public List<NewsUpQuery> getOrConditionList(){
return this.orConditionList;
}
/**
* 设置 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @param orConditionList
*/
public void setOrConditionList(List<NewsUpQuery> orConditionList){
this.orConditionList = orConditionList;
}
/**
* 获取 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @return andConditionList
*/
public List<NewsUpQuery> getAndConditionList(){
return this.andConditionList;
}
/**
* 设置 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @param andConditionList
*/
public void setAndConditionList(List<NewsUpQuery> andConditionList){
this.andConditionList = andConditionList;
}
}
\ No newline at end of file
package com.mortals.xhx.module.news.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.news.model.NewsUpEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 新闻点赞记录信息视图对象
*
* @author zxfei
* @date 2024-12-04
*/
@Data
public class NewsUpVo extends BaseEntityLong {
/** 序号,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
......@@ -23,6 +23,12 @@ public class NewsVo extends BaseEntityLong {
* 分享次数
*/
private Integer shareNums;
/**点赞状态**/
private Integer upStatus;
/**分享状态**/
private Integer shareStatus;
/**
* 头像地址
*/
private String photoPath;
}
\ No newline at end of file
......@@ -19,9 +19,11 @@ public interface NewsService extends ICRUDService<NewsEntity,Long>{
/**
* 点赞
* @param id
* @param context
* @param increment 点赞次数增减值
* @return
*/
NewsEntity upNews(Long id) throws AppException;
NewsEntity upNews(Long id, Context context, int increment) throws AppException;
/**
* 浏览新闻
......
package com.mortals.xhx.module.news.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.news.model.NewsUpEntity;
import com.mortals.xhx.module.news.dao.NewsUpDao;
/**
* NewsUpService
*
* 新闻点赞记录信息 service接口
*
* @author zxfei
* @date 2024-12-04
*/
public interface NewsUpService extends ICRUDService<NewsUpEntity,Long>{
NewsUpDao getDao();
}
\ No newline at end of file
package com.mortals.xhx.module.news.service.impl;
import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.module.news.model.*;
import com.mortals.xhx.module.news.service.NewsRecordService;
import com.mortals.xhx.module.news.service.NewsShareService;
import com.mortals.xhx.module.news.service.NewsUpService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
......@@ -12,6 +18,10 @@ import com.mortals.xhx.module.news.service.NewsService;
import lombok.extern.slf4j.Slf4j;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* NewsService
......@@ -28,16 +38,87 @@ public class NewsServiceImpl extends AbstractCRUDServiceImpl<NewsDao, NewsEntity
private NewsShareService newsShareService;
@Autowired
private NewsRecordService newsRecordService;
@Autowired
private NewsUpService newsUpService;
@Autowired
private UserService userService;
@Override
protected void findAfter(NewsEntity params, PageInfo pageInfo, Context context, List<NewsEntity> list) throws AppException {
if(CollectionUtils.isNotEmpty(list)){
List<Long> userIdList = list.stream().map(NewsEntity::getCreateUserId).collect(Collectors.toList());
List<UserEntity> userList = userService.find(new UserQuery().idList(userIdList));
Map<Long,UserEntity> userMap = userList.parallelStream().collect(Collectors.toMap(x -> x.getId(), z -> z, (o, n) -> n));
if(context!=null && context.getUser()!=null){
List<Long> newsIdList = list.stream().map(NewsEntity::getId).collect(Collectors.toList());
List<NewsUpEntity> upList = newsUpService.find(new NewsUpQuery().newsIdList(newsIdList).upId(context.getUser().getId()));
Map<Long,NewsUpEntity> upMap = new HashMap<>();
if(CollectionUtils.isNotEmpty(upList)){
upMap = upList.parallelStream().collect(Collectors.toMap(x -> x.getId(), z -> z, (o, n) -> n));
}
List<NewsShareEntity> shareList = newsShareService.find(new NewsShareQuery().newsIdList(newsIdList).createUserId(context.getUser().getId()));
Map<Long,NewsShareEntity> shareMap = new HashMap<>();
if(CollectionUtils.isNotEmpty(shareList)) {
shareMap = shareList.parallelStream().collect(Collectors.toMap(x -> x.getId(), z -> z, (o, n) -> n));
}
for(NewsEntity item:list){
if(upMap.containsKey(item.getId())){
item.setUpStatus(1);
}else {
item.setUpStatus(0);
}
if(shareMap.containsKey(item.getId())){
item.setShareStatus(1);
}else {
item.setShareStatus(0);
}
UserEntity userEntity = userMap.get(item.getCreateUserId());
if(userEntity!=null) {
item.setPhotoPath(userEntity.getPhotoPath());
}
}
}
}
}
@Override
public NewsEntity upNews(Long id) throws AppException {
public NewsEntity upNews(Long id, Context context, int increment) throws AppException {
NewsEntity news = this.get(id);
if(news==null){
throw new AppException("新闻不存在");
}
if(context!=null && context.getUser()!=null) {
NewsUpEntity newsUpEntity = newsUpService.selectOne(new NewsUpQuery().newsId(id).upId(context.getUser().getId()));
if(newsUpEntity!=null){
if(increment < 0){
newsUpService.remove(newsUpEntity.getId(),context);
}else {
NewsUpQuery updateUp = new NewsUpQuery();
updateUp.setId(newsUpEntity.getId());
updateUp.setSumUpIncrement(increment);
updateUp.setUpTime(new Date());
updateUp.setUpdateTime(new Date());
updateUp.setUpdateUserId(context.getUser().getId());
newsUpService.update(updateUp);
}
}else {
if(increment > 0) {
newsUpEntity = new NewsUpEntity();
newsUpEntity.initAttrValue();
newsUpEntity.setNewsId(id);
newsUpEntity.setUpId(context.getUser().getId());
newsUpEntity.setUpName(context.getUser().getRealName());
newsUpEntity.setUpTime(new Date());
newsUpEntity.setCreateTime(new Date());
newsUpEntity.setCreateUserId(context.getUser().getId());
newsUpEntity.setSumUp(increment);
newsUpService.save(newsUpEntity);
}
}
}
NewsQuery update = new NewsQuery();
update.setId(id);
update.setUpNumsIncrement(1);
update.setUpNumsIncrement(increment);
return this.update(update);
}
......
package com.mortals.xhx.module.news.service.impl;
import org.springframework.beans.BeanUtils;
import java.util.function.Function;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.news.dao.NewsUpDao;
import com.mortals.xhx.module.news.model.NewsUpEntity;
import com.mortals.xhx.module.news.service.NewsUpService;
import lombok.extern.slf4j.Slf4j;
/**
* NewsUpService
* 新闻点赞记录信息 service实现
*
* @author zxfei
* @date 2024-12-04
*/
@Service("newsUpService")
@Slf4j
public class NewsUpServiceImpl extends AbstractCRUDServiceImpl<NewsUpDao, NewsUpEntity, Long> implements NewsUpService {
}
\ No newline at end of file
package com.mortals.xhx.module.news.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.news.model.NewsUpEntity;
import com.mortals.xhx.module.news.service.NewsUpService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
import com.mortals.xhx.common.code.*;
/**
*
* 新闻点赞记录信息
*
* @author zxfei
* @date 2024-12-04
*/
@RestController
@RequestMapping("news/up")
public class NewsUpController extends BaseCRUDJsonBodyMappingController<NewsUpService,NewsUpEntity,Long> {
@Autowired
private ParamService paramService;
public NewsUpController(){
super.setModuleDesc( "新闻点赞记录信息");
}
@Override
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.news.dao.ibatis.NewsUpDaoImpl">
<!-- 字段和属性映射 -->
<resultMap type="NewsUpEntity" id="NewsUpEntity-Map">
<id property="id" column="id" />
<result property="newsId" column="newsId" />
<result property="upId" column="upId" />
<result property="upName" column="upName" />
<result property="sumUp" column="sumUp" />
<result property="remark" column="remark" />
<result property="upTime" column="upTime" />
<result property="createUserId" column="createUserId" />
<result property="createTime" column="createTime" />
<result property="updateUserId" column="updateUserId" />
<result property="updateTime" column="updateTime" />
</resultMap>
<!-- 表所有列 -->
<sql id="_columns">
<trim suffixOverrides="," suffix="">
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))">
a.id,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('newsId') or colPickMode == 1 and data.containsKey('newsId')))">
a.newsId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('upId') or colPickMode == 1 and data.containsKey('upId')))">
a.upId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('upName') or colPickMode == 1 and data.containsKey('upName')))">
a.upName,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('sumUp') or colPickMode == 1 and data.containsKey('sumUp')))">
a.sumUp,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('remark') or colPickMode == 1 and data.containsKey('remark')))">
a.remark,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('upTime') or colPickMode == 1 and data.containsKey('upTime')))">
a.upTime,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))">
a.createUserId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
a.createTime,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateUserId') or colPickMode == 1 and data.containsKey('updateUserId')))">
a.updateUserId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
a.updateTime,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="NewsUpEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_news_up
(newsId,upId,upName,sumUp,remark,upTime,createUserId,createTime,updateUserId,updateTime)
VALUES
(#{newsId},#{upId},#{upName},#{sumUp},#{remark},#{upTime},#{createUserId},#{createTime},#{updateUserId},#{updateTime})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_news_up
(newsId,upId,upName,sumUp,remark,upTime,createUserId,createTime,updateUserId,updateTime)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.newsId},#{item.upId},#{item.upName},#{item.sumUp},#{item.remark},#{item.upTime},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime})
</foreach>
</insert>
<!-- 根据ParamDto更新 -->
<update id="update" parameterType="paramDto">
update mortals_xhx_news_up as a
set
<trim suffixOverrides="," suffix="">
<if test="(colPickMode==0 and data.containsKey('newsId')) or (colPickMode==1 and !data.containsKey('newsId'))">
a.newsId=#{data.newsId},
</if>
<if test="(colPickMode==0 and data.containsKey('newsIdIncrement')) or (colPickMode==1 and !data.containsKey('newsIdIncrement'))">
a.newsId=ifnull(a.newsId,0) + #{data.newsIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('upId')) or (colPickMode==1 and !data.containsKey('upId'))">
a.upId=#{data.upId},
</if>
<if test="(colPickMode==0 and data.containsKey('upIdIncrement')) or (colPickMode==1 and !data.containsKey('upIdIncrement'))">
a.upId=ifnull(a.upId,0) + #{data.upIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('upName')) or (colPickMode==1 and !data.containsKey('upName'))">
a.upName=#{data.upName},
</if>
<if test="(colPickMode==0 and data.containsKey('sumUp')) or (colPickMode==1 and !data.containsKey('sumUp'))">
a.sumUp=#{data.sumUp},
</if>
<if test="(colPickMode==0 and data.containsKey('sumUpIncrement')) or (colPickMode==1 and !data.containsKey('sumUpIncrement'))">
a.sumUp=ifnull(a.sumUp,0) + #{data.sumUpIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('remark')) or (colPickMode==1 and !data.containsKey('remark'))">
a.remark=#{data.remark},
</if>
<if test="(colPickMode==0 and data.containsKey('upTime')) or (colPickMode==1 and !data.containsKey('upTime'))">
a.upTime=#{data.upTime},
</if>
<if test="(colPickMode==0 and data.containsKey('createUserId')) or (colPickMode==1 and !data.containsKey('createUserId'))">
a.createUserId=#{data.createUserId},
</if>
<if test="(colPickMode==0 and data.containsKey('createUserIdIncrement')) or (colPickMode==1 and !data.containsKey('createUserIdIncrement'))">
a.createUserId=ifnull(a.createUserId,0) + #{data.createUserIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
a.createTime=#{data.createTime},
</if>
<if test="(colPickMode==0 and data.containsKey('updateUserId')) or (colPickMode==1 and !data.containsKey('updateUserId'))">
a.updateUserId=#{data.updateUserId},
</if>
<if test="(colPickMode==0 and data.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !data.containsKey('updateUserIdIncrement'))">
a.updateUserId=ifnull(a.updateUserId,0) + #{data.updateUserIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
a.updateTime=#{data.updateTime},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</update>
<!-- 批量更新 -->
<update id="updateBatch" parameterType="paramDto">
update mortals_xhx_news_up as a
<trim prefix="set" suffixOverrides=",">
<trim prefix="newsId=(case" suffix="ELSE newsId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('newsId')) or (colPickMode==1 and !item.containsKey('newsId'))">
when a.id=#{item.id} then #{item.newsId}
</when>
<when test="(colPickMode==0 and item.containsKey('newsIdIncrement')) or (colPickMode==1 and !item.containsKey('newsIdIncrement'))">
when a.id=#{item.id} then ifnull(a.newsId,0) + #{item.newsIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="upId=(case" suffix="ELSE upId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('upId')) or (colPickMode==1 and !item.containsKey('upId'))">
when a.id=#{item.id} then #{item.upId}
</when>
<when test="(colPickMode==0 and item.containsKey('upIdIncrement')) or (colPickMode==1 and !item.containsKey('upIdIncrement'))">
when a.id=#{item.id} then ifnull(a.upId,0) + #{item.upIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="upName=(case" suffix="ELSE upName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('upName')) or (colPickMode==1 and !item.containsKey('upName'))">
when a.id=#{item.id} then #{item.upName}
</if>
</foreach>
</trim>
<trim prefix="sumUp=(case" suffix="ELSE sumUp end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('sumUp')) or (colPickMode==1 and !item.containsKey('sumUp'))">
when a.id=#{item.id} then #{item.sumUp}
</when>
<when test="(colPickMode==0 and item.containsKey('sumUpIncrement')) or (colPickMode==1 and !item.containsKey('sumUpIncrement'))">
when a.id=#{item.id} then ifnull(a.sumUp,0) + #{item.sumUpIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="remark=(case" suffix="ELSE remark end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('remark')) or (colPickMode==1 and !item.containsKey('remark'))">
when a.id=#{item.id} then #{item.remark}
</if>
</foreach>
</trim>
<trim prefix="upTime=(case" suffix="ELSE upTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('upTime')) or (colPickMode==1 and !item.containsKey('upTime'))">
when a.id=#{item.id} then #{item.upTime}
</if>
</foreach>
</trim>
<trim prefix="createUserId=(case" suffix="ELSE createUserId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('createUserId')) or (colPickMode==1 and !item.containsKey('createUserId'))">
when a.id=#{item.id} then #{item.createUserId}
</when>
<when test="(colPickMode==0 and item.containsKey('createUserIdIncrement')) or (colPickMode==1 and !item.containsKey('createUserIdIncrement'))">
when a.id=#{item.id} then ifnull(a.createUserId,0) + #{item.createUserIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="createTime=(case" suffix="ELSE createTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))">
when a.id=#{item.id} then #{item.createTime}
</if>
</foreach>
</trim>
<trim prefix="updateUserId=(case" suffix="ELSE updateUserId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('updateUserId')) or (colPickMode==1 and !item.containsKey('updateUserId'))">
when a.id=#{item.id} then #{item.updateUserId}
</when>
<when test="(colPickMode==0 and item.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !item.containsKey('updateUserIdIncrement'))">
when a.id=#{item.id} then ifnull(a.updateUserId,0) + #{item.updateUserIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="updateTime=(case" suffix="ELSE updateTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('updateTime')) or (colPickMode==1 and !item.containsKey('updateTime'))">
when a.id=#{item.id} then #{item.updateTime}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</update>
<!-- 根据主健查询 -->
<select id="getByKey" parameterType="paramDto" resultMap="NewsUpEntity-Map">
select <include refid="_columns"/>
from mortals_xhx_news_up as a
where a.id=#{condition.id}
</select>
<!-- 根据主健删除 -->
<delete id="deleteByKey" parameterType="paramDto">
delete a.* from mortals_xhx_news_up as a where a.id=#{condition.id}
</delete>
<!-- 根据主健删除一批,针对单一主健有效 -->
<delete id="deleteByKeys">
delete from mortals_xhx_news_up where id in
<foreach collection="array" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据主健列表删除一批,针对单一主健有效 -->
<delete id="deleteByKeyList">
delete from mortals_xhx_news_up where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据对象列表删除一批,针对单一主健有效 -->
<delete id="deleteByEntityList">
delete from mortals_xhx_news_up where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</delete>
<!-- 根据paramDto删除一批 -->
<delete id="deleteByMap" parameterType="paramDto">
delete a.* from mortals_xhx_news_up as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</delete>
<!-- 获取列表 -->
<select id="getList" parameterType="paramDto" resultMap="NewsUpEntity-Map">
select <include refid="_columns"/>
from mortals_xhx_news_up as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
<include refid="_orderCols_"/>
</select>
<!-- 获取 -->
<select id="getListCount" parameterType="paramDto" resultType="int">
select count(1)
from mortals_xhx_news_up as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</select>
<!-- 条件映射 -->
<sql id="_condition_">
<if test="condition != null and !condition.isEmpty()">
<!-- 条件映射-普通条件 -->
<include refid="_condition_param_">
<property name="_conditionParam_" value="condition"/>
<property name="_conditionType_" value="and"/>
</include>
<!-- 条件映射-集合之间使用AND,集合中元素使用OR-(list[0].1 or list[0].2) and (list[1].3 or list[1].4) -->
<if test="condition.containsKey('andConditionList') and !condition.andConditionList.isEmpty()">
and
<foreach collection="condition.andConditionList" open="(" close=")" index="index" item="andCondition" separator=" and ">
<trim prefixOverrides="or" prefix="(" suffix=")">
<include refid="_condition_param_">
<property name="_conditionParam_" value="andCondition"/>
<property name="_conditionType_" value="or"/>
</include>
</trim>
</foreach>
</if>
<!-- 条件映射-集合之间使用OR,集合中元素使用AND-(list[0].1 and list[0].2) or (list[1].3 and list[1].4) -->
<if test="condition.containsKey('orConditionList') and !condition.orConditionList.isEmpty()">
and
<foreach collection="condition.orConditionList" open="(" close=")" index="index" item="orCondition" separator=" or ">
<trim prefixOverrides="and" prefix="(" suffix=")">
<include refid="_condition_param_">
<property name="_conditionParam_" value="orCondition"/>
<property name="_conditionType_" value="and"/>
</include>
</trim>
</foreach>
</if>
</if>
</sql>
<!-- 条件映射-代参数 -->
<sql id="_condition_param_">
<bind name="conditionParamRef" value="${_conditionParam_}"/>
<if test="permissionSql != null and permissionSql != ''">
${permissionSql}
</if>
<if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null">
${_conditionType_} a.id=#{${_conditionParam_}.id}
</if>
</if>
<if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null ">
${_conditionType_} a.id = #{${_conditionParam_}.id}
</if>
<if test="conditionParamRef.id == null">
${_conditionType_} a.id is null
</if>
</if>
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
${_conditionType_} a.id in
<foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idNotList') and conditionParamRef.idNotList.size() > 0">
${_conditionType_} a.id not in
<foreach collection="conditionParamRef.idNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null">
${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart}
</if>
<if test="conditionParamRef.containsKey('idEnd') and conditionParamRef.idEnd != null">
${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd}
</if>
<if test="conditionParamRef.containsKey('newsId')">
<if test="conditionParamRef.newsId != null ">
${_conditionType_} a.newsId = #{${_conditionParam_}.newsId}
</if>
<if test="conditionParamRef.newsId == null">
${_conditionType_} a.newsId is null
</if>
</if>
<if test="conditionParamRef.containsKey('newsIdList') and conditionParamRef.newsIdList.size() > 0">
${_conditionType_} a.newsId in
<foreach collection="conditionParamRef.newsIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('newsIdNotList') and conditionParamRef.newsIdNotList.size() > 0">
${_conditionType_} a.newsId not in
<foreach collection="conditionParamRef.newsIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('newsIdStart') and conditionParamRef.newsIdStart != null">
${_conditionType_} a.newsId <![CDATA[ >= ]]> #{${_conditionParam_}.newsIdStart}
</if>
<if test="conditionParamRef.containsKey('newsIdEnd') and conditionParamRef.newsIdEnd != null">
${_conditionType_} a.newsId <![CDATA[ <= ]]> #{${_conditionParam_}.newsIdEnd}
</if>
<if test="conditionParamRef.containsKey('upId')">
<if test="conditionParamRef.upId != null ">
${_conditionType_} a.upId = #{${_conditionParam_}.upId}
</if>
<if test="conditionParamRef.upId == null">
${_conditionType_} a.upId is null
</if>
</if>
<if test="conditionParamRef.containsKey('upIdList') and conditionParamRef.upIdList.size() > 0">
${_conditionType_} a.upId in
<foreach collection="conditionParamRef.upIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('upIdNotList') and conditionParamRef.upIdNotList.size() > 0">
${_conditionType_} a.upId not in
<foreach collection="conditionParamRef.upIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('upIdStart') and conditionParamRef.upIdStart != null">
${_conditionType_} a.upId <![CDATA[ >= ]]> #{${_conditionParam_}.upIdStart}
</if>
<if test="conditionParamRef.containsKey('upIdEnd') and conditionParamRef.upIdEnd != null">
${_conditionType_} a.upId <![CDATA[ <= ]]> #{${_conditionParam_}.upIdEnd}
</if>
<if test="conditionParamRef.containsKey('upName')">
<if test="conditionParamRef.upName != null and conditionParamRef.upName != ''">
${_conditionType_} a.upName like #{${_conditionParam_}.upName}
</if>
<if test="conditionParamRef.upName == null">
${_conditionType_} a.upName is null
</if>
</if>
<if test="conditionParamRef.containsKey('upNameList') and conditionParamRef.upNameList.size() > 0">
${_conditionType_} a.upName in
<foreach collection="conditionParamRef.upNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('upNameNotList') and conditionParamRef.upNameNotList.size() > 0">
${_conditionType_} a.upName not in
<foreach collection="conditionParamRef.upNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('sumUp')">
<if test="conditionParamRef.sumUp != null ">
${_conditionType_} a.sumUp = #{${_conditionParam_}.sumUp}
</if>
<if test="conditionParamRef.sumUp == null">
${_conditionType_} a.sumUp is null
</if>
</if>
<if test="conditionParamRef.containsKey('sumUpList') and conditionParamRef.sumUpList.size() > 0">
${_conditionType_} a.sumUp in
<foreach collection="conditionParamRef.sumUpList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('sumUpNotList') and conditionParamRef.sumUpNotList.size() > 0">
${_conditionType_} a.sumUp not in
<foreach collection="conditionParamRef.sumUpNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('sumUpStart') and conditionParamRef.sumUpStart != null">
${_conditionType_} a.sumUp <![CDATA[ >= ]]> #{${_conditionParam_}.sumUpStart}
</if>
<if test="conditionParamRef.containsKey('sumUpEnd') and conditionParamRef.sumUpEnd != null">
${_conditionType_} a.sumUp <![CDATA[ <= ]]> #{${_conditionParam_}.sumUpEnd}
</if>
<if test="conditionParamRef.containsKey('remark')">
<if test="conditionParamRef.remark != null and conditionParamRef.remark != ''">
${_conditionType_} a.remark like #{${_conditionParam_}.remark}
</if>
<if test="conditionParamRef.remark == null">
${_conditionType_} a.remark is null
</if>
</if>
<if test="conditionParamRef.containsKey('remarkList') and conditionParamRef.remarkList.size() > 0">
${_conditionType_} a.remark in
<foreach collection="conditionParamRef.remarkList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('remarkNotList') and conditionParamRef.remarkNotList.size() > 0">
${_conditionType_} a.remark not in
<foreach collection="conditionParamRef.remarkNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('upTime')">
<if test="conditionParamRef.upTime != null ">
${_conditionType_} a.upTime = #{${_conditionParam_}.upTime}
</if>
<if test="conditionParamRef.upTime == null">
${_conditionType_} a.upTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('upTimeStart') and conditionParamRef.upTimeStart != null and conditionParamRef.upTimeStart!=''">
${_conditionType_} a.upTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.upTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('upTimeEnd') and conditionParamRef.upTimeEnd != null and conditionParamRef.upTimeEnd!=''">
${_conditionType_} a.upTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.upTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('createUserId')">
<if test="conditionParamRef.createUserId != null ">
${_conditionType_} a.createUserId = #{${_conditionParam_}.createUserId}
</if>
<if test="conditionParamRef.createUserId == null">
${_conditionType_} a.createUserId is null
</if>
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
${_conditionType_} a.createUserId in
<foreach collection="conditionParamRef.createUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createUserIdNotList') and conditionParamRef.createUserIdNotList.size() > 0">
${_conditionType_} a.createUserId not in
<foreach collection="conditionParamRef.createUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createUserIdStart') and conditionParamRef.createUserIdStart != null">
${_conditionType_} a.createUserId <![CDATA[ >= ]]> #{${_conditionParam_}.createUserIdStart}
</if>
<if test="conditionParamRef.containsKey('createUserIdEnd') and conditionParamRef.createUserIdEnd != null">
${_conditionType_} a.createUserId <![CDATA[ <= ]]> #{${_conditionParam_}.createUserIdEnd}
</if>
<if test="conditionParamRef.containsKey('createTime')">
<if test="conditionParamRef.createTime != null ">
${_conditionType_} a.createTime = #{${_conditionParam_}.createTime}
</if>
<if test="conditionParamRef.createTime == null">
${_conditionType_} a.createTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('createTimeStart') and conditionParamRef.createTimeStart != null and conditionParamRef.createTimeStart!=''">
${_conditionType_} a.createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('createTimeEnd') and conditionParamRef.createTimeEnd != null and conditionParamRef.createTimeEnd!=''">
${_conditionType_} a.createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('updateUserId')">
<if test="conditionParamRef.updateUserId != null ">
${_conditionType_} a.updateUserId = #{${_conditionParam_}.updateUserId}
</if>
<if test="conditionParamRef.updateUserId == null">
${_conditionType_} a.updateUserId is null
</if>
</if>
<if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
${_conditionType_} a.updateUserId in
<foreach collection="conditionParamRef.updateUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('updateUserIdNotList') and conditionParamRef.updateUserIdNotList.size() > 0">
${_conditionType_} a.updateUserId not in
<foreach collection="conditionParamRef.updateUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('updateUserIdStart') and conditionParamRef.updateUserIdStart != null">
${_conditionType_} a.updateUserId <![CDATA[ >= ]]> #{${_conditionParam_}.updateUserIdStart}
</if>
<if test="conditionParamRef.containsKey('updateUserIdEnd') and conditionParamRef.updateUserIdEnd != null">
${_conditionType_} a.updateUserId <![CDATA[ <= ]]> #{${_conditionParam_}.updateUserIdEnd}
</if>
<if test="conditionParamRef.containsKey('updateTime')">
<if test="conditionParamRef.updateTime != null ">
${_conditionType_} a.updateTime = #{${_conditionParam_}.updateTime}
</if>
<if test="conditionParamRef.updateTime == null">
${_conditionType_} a.updateTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('updateTimeStart') and conditionParamRef.updateTimeStart != null and conditionParamRef.updateTimeStart!=''">
${_conditionType_} a.updateTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
order by
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
field(a.id,
<foreach collection="conditionParamRef.idList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('newsIdList') and conditionParamRef.newsIdList.size() > 0">
field(a.newsId,
<foreach collection="conditionParamRef.newsIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('upIdList') and conditionParamRef.upIdList.size() > 0">
field(a.upId,
<foreach collection="conditionParamRef.upIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('sumUpList') and conditionParamRef.sumUpList.size() > 0">
field(a.sumUp,
<foreach collection="conditionParamRef.sumUpList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
field(a.createUserId,
<foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
field(a.updateUserId,
<foreach collection="conditionParamRef.updateUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix="">
<foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
a.${item.colName} ${item.sortKind}
</foreach>
</trim>
</if>
<if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()">
order by
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
field(a.id,
<foreach collection="conditionParamRef.idList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('newsIdList') and conditionParamRef.newsIdList.size() > 0">
field(a.newsId,
<foreach collection="conditionParamRef.newsIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('upIdList') and conditionParamRef.upIdList.size() > 0">
field(a.upId,
<foreach collection="conditionParamRef.upIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('sumUpList') and conditionParamRef.sumUpList.size() > 0">
field(a.sumUp,
<foreach collection="conditionParamRef.sumUpList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
field(a.createUserId,
<foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
field(a.updateUserId,
<foreach collection="conditionParamRef.updateUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix="">
<if test="orderCol.containsKey('id')">
a.id
<if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('newsId')">
a.newsId
<if test='orderCol.newsId != null and "DESC".equalsIgnoreCase(orderCol.newsId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('upId')">
a.upId
<if test='orderCol.upId != null and "DESC".equalsIgnoreCase(orderCol.upId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('upName')">
a.upName
<if test='orderCol.upName != null and "DESC".equalsIgnoreCase(orderCol.upName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('sumUp')">
a.sumUp
<if test='orderCol.sumUp != null and "DESC".equalsIgnoreCase(orderCol.sumUp)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('remark')">
a.remark
<if test='orderCol.remark != null and "DESC".equalsIgnoreCase(orderCol.remark)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('upTime')">
a.upTime
<if test='orderCol.upTime != null and "DESC".equalsIgnoreCase(orderCol.upTime)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createUserId')">
a.createUserId
<if test='orderCol.createUserId != null and "DESC".equalsIgnoreCase(orderCol.createUserId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createTime')">
a.createTime
<if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('updateUserId')">
a.updateUserId
<if test='orderCol.updateUserId != null and "DESC".equalsIgnoreCase(orderCol.updateUserId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('updateTime')">
a.updateTime
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
<sql id="_group_by_">
<if test="groupList != null and !groupList.isEmpty()">
GROUP BY
<trim suffixOverrides="," suffix="">
<foreach collection="groupList" open="" close="" index="index" item="item" separator=",">
${item}
</foreach>
</trim>
</if>
</sql>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment