Commit add09e17 by hewei

Merge branch 'future/strokeList' into 'master'

app系统通知列表 .   系统通知已读 未读

See merge request hewei/Jumeirah!77
parents d672ee33 190df6ba
package com.jumeirah.api.app.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jumeirah.common.entity.SysNotice;
import com.jumeirah.common.entity.SysNoticeRead;
import com.jumeirah.common.param.SysNoticeQueryVo;
import com.jumeirah.common.service.SysNoticeReadService;
import com.jumeirah.common.service.SysNoticeService;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.geekidea.springbootplus.framework.shiro.jwt.JwtToken;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
* 系统通知表 控制器
*
* @author xxx
* @since 2020-11-06
*/
@Slf4j
@RestController
@RequestMapping("/app/sysNotice")
@Api(value = "系统通知表API", tags = {"系统通知表"})
public class SysNoticeController extends BaseController {
@Autowired
private SysNoticeService sysNoticeService;
@Autowired
private SysNoticeReadService sysNoticeReadService;
@PostMapping("/getList")
@OperationLog(name = "系统通知表列表", type = OperationLogType.PAGE)
@ApiOperation(value = "系统通知表列表")
public ApiResult<List<SysNoticeQueryVo>> list() throws Exception {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
List<SysNotice> list = sysNoticeService.list();
List<SysNoticeQueryVo> sysNoticeQueryVoList = new ArrayList<>();
for (SysNotice sysNotice : list) {
SysNoticeQueryVo sysNoticeQueryVo = new SysNoticeQueryVo();
sysNoticeQueryVo.setId(sysNotice.getId());
sysNoticeQueryVo.setTheme(sysNotice.getTheme());
sysNoticeQueryVo.setMsgInfo(sysNotice.getContent());
sysNoticeQueryVo.setSendTime(sysNotice.getCreateTime());
}
// 修改为已读
SysNoticeRead sysNoticeRead = sysNoticeReadService.getOne(new QueryWrapper<SysNoticeRead>().lambda()
.eq(SysNoticeRead::getUserId, jwtToken.getUserId()));
if (sysNoticeRead != null) {
sysNoticeRead.setReadStatus(1);
sysNoticeReadService.updateById(sysNoticeRead);
}
return ApiResult.ok(sysNoticeQueryVoList);
}
//
// /**
// * 添加系统通知表
// */
// @PostMapping("/add")
// @OperationLog(name = "添加系统通知表", type = OperationLogType.ADD)
// @ApiOperation(value = "添加系统通知表")
// public ApiResult<Boolean> addSysNotice(@Validated(Add.class) @RequestBody SysNotice sysNotice) throws Exception {
// boolean flag = sysNoticeService.saveSysNotice(sysNotice);
// return ApiResult.result(flag);
// }
//
// /**
// * 修改系统通知表
// */
// @PostMapping("/update")
// @OperationLog(name = "修改系统通知表", type = OperationLogType.UPDATE)
// @ApiOperation(value = "修改系统通知表")
// public ApiResult<Boolean> updateSysNotice(@Validated(Update.class) @RequestBody SysNotice sysNotice) throws Exception {
// boolean flag = sysNoticeService.updateSysNotice(sysNotice);
// return ApiResult.result(flag);
// }
//
// /**
// * 删除系统通知表
// */
// @PostMapping("/delete/{id}")
// @OperationLog(name = "删除系统通知表", type = OperationLogType.DELETE)
// @ApiOperation(value = "删除系统通知表")
// public ApiResult<Boolean> deleteSysNotice(@PathVariable("id") Long id) throws Exception {
// boolean flag = sysNoticeService.deleteSysNotice(id);
// return ApiResult.result(flag);
// }
//
// /**
// * 获取系统通知表详情
// */
// @GetMapping("/info/{id}")
// @OperationLog(name = "系统通知表详情", type = OperationLogType.INFO)
// @ApiOperation(value = "系统通知表详情")
// public ApiResult<SysNoticeQueryVo> getSysNotice(@PathVariable("id") Long id) throws Exception {
// SysNoticeQueryVo sysNoticeQueryVo = sysNoticeService.getSysNoticeById(id);
// return ApiResult.ok(sysNoticeQueryVo);
// }
/**
* 系统通知表分页列表
*/
// @PostMapping("/getPageList")
// @OperationLog(name = "系统通知表分页列表", type = OperationLogType.PAGE)
// @ApiOperation(value = "系统通知表分页列表")
// public ApiResult<Paging<SysNoticeQueryVo>> getSysNoticePageList(@Validated @RequestBody SysNoticePageParam sysNoticePageParam) throws Exception {
// Paging<SysNoticeQueryVo> paging = sysNoticeService.getSysNoticePageList(sysNoticePageParam);
// return ApiResult.ok(paging);
// }
}
package com.jumeirah.api.app.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jumeirah.common.entity.SysNoticeRead;
import com.jumeirah.common.param.SysNoticeReadQueryVo;
import com.jumeirah.common.service.SysNoticeReadService;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.geekidea.springbootplus.framework.shiro.jwt.JwtToken;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 系统通知已读 未读 控制器
*
* @author xxx
* @since 2020-11-06
*/
@Slf4j
@RestController
@RequestMapping("/app/sysNoticeRead")
@Api(value = "系统通知已读 未读API", tags = {"系统通知已读 未读"})
public class SysNoticeReadController extends BaseController {
@Autowired
private SysNoticeReadService sysNoticeReadService;
/**
* 获取系统通知已读 未读详情
*/
@GetMapping("/getNoticeReadByUser")
@OperationLog(name = "用户是否已读系统通知", type = OperationLogType.INFO)
@ApiOperation(value = "用户是否已读系统通知")
public ApiResult<SysNoticeReadQueryVo> getSysNoticeReadByUser() throws Exception {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
SysNoticeRead one = sysNoticeReadService.getOne(
new QueryWrapper<SysNoticeRead>().lambda().eq(SysNoticeRead::getUserId, jwtToken.getUserId()));
SysNoticeReadQueryVo sysNoticeReadQueryVo = new SysNoticeReadQueryVo();
if (null == one) {
SysNoticeRead sysNoticeRead = new SysNoticeRead();
sysNoticeRead.setUserId(jwtToken.getUserId());
sysNoticeRead.setReadStatus(0);
sysNoticeReadService.save(sysNoticeRead);
sysNoticeReadQueryVo.setRead(0);
} else {
sysNoticeReadQueryVo.setRead(one.getReadStatus());
}
return ApiResult.ok(sysNoticeReadQueryVo);
}
// /**
// * 添加系统通知已读 未读
// */
// @PostMapping("/add")
// @OperationLog(name = "添加系统通知已读 未读", type = OperationLogType.ADD)
// @ApiOperation(value = "添加系统通知已读 未读")
// public ApiResult<Boolean> addSysNoticeRead(@Validated(Add.class) @RequestBody SysNoticeRead sysNoticeRead)throws Exception{
// boolean flag= sysNoticeReadService.saveSysNoticeRead(sysNoticeRead);
// return ApiResult.result(flag);
// }
//
// /**
// * 修改系统通知已读 未读
// */
// @PostMapping("/update")
// @OperationLog(name = "修改系统通知已读 未读", type = OperationLogType.UPDATE)
// @ApiOperation(value = "修改系统通知已读 未读")
// public ApiResult<Boolean> updateSysNoticeRead(@Validated(Update.class) @RequestBody SysNoticeRead sysNoticeRead)throws Exception{
// boolean flag= sysNoticeReadService.updateSysNoticeRead(sysNoticeRead);
// return ApiResult.result(flag);
// }
//
// /**
// * 删除系统通知已读 未读
// */
// @PostMapping("/delete/{id}")
// @OperationLog(name = "删除系统通知已读 未读", type = OperationLogType.DELETE)
// @ApiOperation(value = "删除系统通知已读 未读")
// public ApiResult<Boolean> deleteSysNoticeRead(@PathVariable("id") Long id)throws Exception{
// boolean flag= sysNoticeReadService.deleteSysNoticeRead(id);
// return ApiResult.result(flag);
// }
//
// /**
// * 获取系统通知已读 未读详情
// */
// @GetMapping("/info/{id}")
// @OperationLog(name = "系统通知已读 未读详情", type = OperationLogType.INFO)
// @ApiOperation(value = "系统通知已读 未读详情")
// public ApiResult<SysNoticeReadQueryVo> getSysNoticeRead(@PathVariable("id") Long id)throws Exception{
// SysNoticeReadQueryVo sysNoticeReadQueryVo = sysNoticeReadService.getSysNoticeReadById(id);
// return ApiResult.ok(sysNoticeReadQueryVo);
// }
// /**
// * 系统通知已读 未读分页列表
// */
// @PostMapping("/getPageList")
// @OperationLog(name = "系统通知已读 未读分页列表", type = OperationLogType.PAGE)
// @ApiOperation(value = "系统通知已读 未读分页列表")
// public ApiResult<Paging<SysNoticeReadQueryVo>>getSysNoticeReadPageList(@Validated @RequestBody SysNoticeReadPageParam sysNoticeReadPageParam)throws Exception{
// Paging<SysNoticeReadQueryVo> paging = sysNoticeReadService.getSysNoticeReadPageList(sysNoticeReadPageParam);
// return ApiResult.ok(paging);
// }
}
package com.jumeirah.common.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* 系统通知表
*
* @author xxx
* @since 2020-11-06
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "SysNotice对象")
public class SysNotice extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "id不能为空")
@ApiModelProperty("id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty("主题")
private String theme;
@ApiModelProperty("内容")
private String content;
@ApiModelProperty("创建时间(时间戳)")
private Date createTime;
@ApiModelProperty("更新时间(时间戳)")
private Date updateTime;
@ApiModelProperty("状态,0-正常,1-禁用,99-删除")
private Integer status;
}
package com.jumeirah.common.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
/**
* 系统通知已读 未读
*
* @author xxx
* @since 2020-11-06
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "SysNoticeRead对象")
public class SysNoticeRead extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "不能为空")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@NotNull(message = "用户ID不能为空")
@ApiModelProperty("用户ID")
private Long userId;
@ApiModelProperty("0未读 1已读")
private Integer readStatus;
}
package com.jumeirah.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumeirah.common.entity.SysNotice;
import com.jumeirah.common.param.SysNoticePageParam;
import com.jumeirah.common.param.SysNoticeQueryVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.io.Serializable;
/**
* 系统通知表 Mapper 接口
*
* @author xxx
* @since 2020-11-06
*/
@Repository
public interface SysNoticeMapper extends BaseMapper<SysNotice> {
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
SysNoticeQueryVo getSysNoticeById(Serializable id);
/**
* 获取分页对象
*
* @param page
* @param sysNoticePageParam
* @return
*/
IPage<SysNoticeQueryVo> getSysNoticePageList(@Param("page") Page page, @Param("param") SysNoticePageParam sysNoticePageParam);
}
package com.jumeirah.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jumeirah.common.entity.SysNoticeRead;
import com.jumeirah.common.param.SysNoticeReadPageParam;
import com.jumeirah.common.param.SysNoticeReadQueryVo;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.io.Serializable;
/**
* 系统通知已读 未读 Mapper 接口
*
* @author xxx
* @since 2020-11-06
*/
@Repository
public interface SysNoticeReadMapper extends BaseMapper<SysNoticeRead> {
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
SysNoticeReadQueryVo getSysNoticeReadById(Serializable id);
/**
* 获取分页对象
*
* @param page
* @param sysNoticeReadPageParam
* @return
*/
IPage<SysNoticeReadQueryVo> getSysNoticeReadPageList(@Param("page") Page page,@Param("param") SysNoticeReadPageParam sysNoticeReadPageParam);
}
package com.jumeirah.common.param;
import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <pre>
* 系统通知表 分页参数对象
* </pre>
*
* @author xxx
* @date 2020-11-06
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "系统通知表分页参数")
public class SysNoticePageParam extends BasePageOrderParam {
private static final long serialVersionUID = 1L;
}
package com.jumeirah.common.param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <pre>
* 系统通知表 查询结果对象
* </pre>
*
* @author xxx
* @date 2020-11-06
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "SysNoticeQueryVo对象")
public class SysNoticeQueryVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("主题")
private String theme;
@ApiModelProperty("内容")
private String msgInfo;
@ApiModelProperty("创建时间(时间戳)")
private Date sendTime;
private Long sendReceive = 1L;//0:用户 1:客服
private Long msgType = 0L;//0、聊天信息,1、图片,2、视频,4、文件,5、订单
private Long merchantId = 0L;//商户ID 给个0
}
\ No newline at end of file
package com.jumeirah.common.param;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
/**
* <pre>
* 系统通知已读 未读 分页参数对象
* </pre>
*
* @author xxx
* @date 2020-11-06
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "系统通知已读 未读分页参数")
public class SysNoticeReadPageParam extends BasePageOrderParam{
private static final long serialVersionUID=1L;
}
package com.jumeirah.common.param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <pre>
* 系统通知已读 未读 查询结果对象
* </pre>
*
* @author xxx
* @date 2020-11-06
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "SysNoticeReadQueryVo对象")
public class SysNoticeReadQueryVo implements Serializable {
private static final long serialVersionUID = 1L;
// private Long id;
//
// @ApiModelProperty("用户ID")
// private Long userId;
@ApiModelProperty("0未读 1已读")
private Integer read;
}
\ No newline at end of file
package com.jumeirah.common.service;
import com.jumeirah.common.entity.SysNoticeRead;
import com.jumeirah.common.param.SysNoticeReadPageParam;
import io.geekidea.springbootplus.framework.common.service.BaseService;
import com.jumeirah.common.param.SysNoticeReadQueryVo;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
/**
* 系统通知已读 未读 服务类
*
* @author xxx
* @since 2020-11-06
*/
public interface SysNoticeReadService extends BaseService<SysNoticeRead> {
/**
* 保存
*
* @param sysNoticeRead
* @return
* @throws Exception
*/
boolean saveSysNoticeRead(SysNoticeRead sysNoticeRead)throws Exception;
/**
* 修改
*
* @param sysNoticeRead
* @return
* @throws Exception
*/
boolean updateSysNoticeRead(SysNoticeRead sysNoticeRead)throws Exception;
/**
* 删除
*
* @param id
* @return
* @throws Exception
*/
boolean deleteSysNoticeRead(Long id)throws Exception;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
SysNoticeReadQueryVo getSysNoticeReadById(Long id)throws Exception;
/**
* 获取分页对象
*
* @param sysNoticeReadPageParam
* @return
* @throws Exception
*/
Paging<SysNoticeReadQueryVo> getSysNoticeReadPageList(SysNoticeReadPageParam sysNoticeReadPageParam) throws Exception;
}
package com.jumeirah.common.service;
import com.jumeirah.common.entity.SysNotice;
import com.jumeirah.common.param.SysNoticePageParam;
import com.jumeirah.common.param.SysNoticeQueryVo;
import io.geekidea.springbootplus.framework.common.service.BaseService;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
/**
* 系统通知表 服务类
*
* @author xxx
* @since 2020-11-06
*/
public interface SysNoticeService extends BaseService<SysNotice> {
/**
* 保存
*
* @param sysNotice
* @return
* @throws Exception
*/
boolean saveSysNotice(SysNotice sysNotice) throws Exception;
/**
* 修改
*
* @param sysNotice
* @return
* @throws Exception
*/
boolean updateSysNotice(SysNotice sysNotice) throws Exception;
/**
* 删除
*
* @param id
* @return
* @throws Exception
*/
boolean deleteSysNotice(Long id) throws Exception;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
SysNoticeQueryVo getSysNoticeById(Long id) throws Exception;
/**
* 获取分页对象
*
* @param sysNoticePageParam
* @return
* @throws Exception
*/
Paging<SysNoticeQueryVo> getSysNoticePageList(SysNoticePageParam sysNoticePageParam) throws Exception;
}
package com.jumeirah.common.service.impl;
import com.jumeirah.common.entity.SysNoticeRead;
import com.jumeirah.common.mapper.SysNoticeReadMapper;
import com.jumeirah.common.param.SysNoticeReadPageParam;
import com.jumeirah.common.param.SysNoticeReadQueryVo;
import com.jumeirah.common.service.SysNoticeReadService;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 系统通知已读 未读 服务实现类
*
* @author xxx
* @since 2020-11-06
*/
@Slf4j
@Service
public class SysNoticeReadServiceImpl extends BaseServiceImpl<SysNoticeReadMapper, SysNoticeRead> implements SysNoticeReadService {
@Autowired
private SysNoticeReadMapper sysNoticeReadMapper;
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveSysNoticeRead(SysNoticeRead sysNoticeRead)throws Exception{
return super.save(sysNoticeRead);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateSysNoticeRead(SysNoticeRead sysNoticeRead)throws Exception{
return super.updateById(sysNoticeRead);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteSysNoticeRead(Long id)throws Exception{
return super.removeById(id);
}
@Override
public SysNoticeReadQueryVo getSysNoticeReadById(Long id)throws Exception{
return sysNoticeReadMapper.getSysNoticeReadById(id);
}
@Override
public Paging<SysNoticeReadQueryVo> getSysNoticeReadPageList(SysNoticeReadPageParam sysNoticeReadPageParam)throws Exception{
// Page<SysNoticeReadQueryVo> page=new PageInfo<>(sysNoticeReadPageParam,OrderItem.desc(getLambdaColumn(SysNoticeRead::getCreateTime)));
// IPage<SysNoticeReadQueryVo> iPage= sysNoticeReadMapper.getSysNoticeReadPageList(page, sysNoticeReadPageParam);
// return new Paging<SysNoticeReadQueryVo>(iPage);
return null;
}
}
package com.jumeirah.common.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumeirah.common.entity.SysNotice;
import com.jumeirah.common.mapper.SysNoticeMapper;
import com.jumeirah.common.param.SysNoticePageParam;
import com.jumeirah.common.param.SysNoticeQueryVo;
import com.jumeirah.common.service.SysNoticeService;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.framework.core.pagination.PageInfo;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 系统通知表 服务实现类
*
* @author xxx
* @since 2020-11-06
*/
@Slf4j
@Service
public class SysNoticeServiceImpl extends BaseServiceImpl<SysNoticeMapper, SysNotice> implements SysNoticeService {
@Autowired
private SysNoticeMapper sysNoticeMapper;
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveSysNotice(SysNotice sysNotice) throws Exception {
return super.save(sysNotice);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateSysNotice(SysNotice sysNotice) throws Exception {
return super.updateById(sysNotice);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteSysNotice(Long id) throws Exception {
return super.removeById(id);
}
@Override
public SysNoticeQueryVo getSysNoticeById(Long id) throws Exception {
return sysNoticeMapper.getSysNoticeById(id);
}
@Override
public Paging<SysNoticeQueryVo> getSysNoticePageList(SysNoticePageParam sysNoticePageParam) throws Exception {
Page<SysNoticeQueryVo> page = new PageInfo<>(sysNoticePageParam, OrderItem.desc(getLambdaColumn(SysNotice::getCreateTime)));
IPage<SysNoticeQueryVo> iPage = sysNoticeMapper.getSysNoticePageList(page, sysNoticePageParam);
return new Paging<SysNoticeQueryVo>(iPage);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jumeirah.common.mapper.SysNoticeMapper">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, theme, content, create_time, update_time, status
</sql>
<select id="getSysNoticeById" resultType="com.jumeirah.common.param.SysNoticeQueryVo">
select
<include refid="Base_Column_List"/>
from sys_notice where id = #{id}
</select>
<select id="getSysNoticePageList" parameterType="com.jumeirah.common.param.SysNoticePageParam"
resultType="com.jumeirah.common.param.SysNoticeQueryVo">
select
<include refid="Base_Column_List"/>
from sys_notice
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jumeirah.common.mapper.SysNoticeReadMapper">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, user_id, read
</sql>
<select id="getSysNoticeReadById" resultType="com.jumeirah.common.param.SysNoticeReadQueryVo">
select
<include refid="Base_Column_List"/>
from sys_notice_read where id = #{id}
</select>
<select id="getSysNoticeReadPageList" parameterType="com.jumeirah.common.param.SysNoticeReadPageParam" resultType="com.jumeirah.common.param.SysNoticeReadQueryVo">
select
<include refid="Base_Column_List"/>
from sys_notice_read
</select>
</mapper>
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