新增通知
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
package com.vetti.hotake.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.vetti.common.annotation.Excel;
|
||||
import com.vetti.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 通知对象 hotake_sys_notice
|
||||
*
|
||||
* @author ID
|
||||
* @date 2025-11-01
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class HotakeSysNotice extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
/** 通知类型ID */
|
||||
@ApiModelProperty("通知类型ID")
|
||||
@Excel(name = "通知类型ID")
|
||||
private Long noticeTypeId;//数据字典获取数据 hotake_sys_notice_type
|
||||
|
||||
/** 投递简历ID */
|
||||
@ApiModelProperty("投递简历ID")
|
||||
@Excel(name = "投递简历ID")
|
||||
private Long cvId;
|
||||
|
||||
/** 通知标题 */
|
||||
@ApiModelProperty("通知标题")
|
||||
@Excel(name = "通知标题")
|
||||
private String noticeTitle;
|
||||
|
||||
/** 通知内容 */
|
||||
@ApiModelProperty("通知内容")
|
||||
@Excel(name = "通知内容")
|
||||
private String noticeContent;
|
||||
|
||||
/** 发送人ID */
|
||||
@ApiModelProperty("发送人ID")
|
||||
@Excel(name = "发送人ID")
|
||||
private Long sendUserId;
|
||||
|
||||
/** 接收人ID */
|
||||
@ApiModelProperty("接收人ID")
|
||||
@Excel(name = "接收人ID")
|
||||
private Long receiveUserId;
|
||||
|
||||
/** 查看状态(0未看 1已看) */
|
||||
@ApiModelProperty("查看状态(0未看 1已看)")
|
||||
@Excel(name = "查看状态", readConverterExp = "0=未看,1=已看")
|
||||
private String isView;
|
||||
|
||||
@ApiModelProperty("图片")
|
||||
@Excel(name = "图片")
|
||||
private List<String> imagePath;//文件存储桶名 noticetype-fs
|
||||
|
||||
/** 删除状态(0正常 1删除) */
|
||||
@ApiModelProperty("删除状态(0正常 1删除)")
|
||||
@Excel(name = "删除状态", readConverterExp = "0=正常,1=删除")
|
||||
private String isDel;
|
||||
|
||||
}
|
||||
@@ -1,42 +1,42 @@
|
||||
package com.vetti.hotake.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.vetti.common.annotation.Excel;
|
||||
import com.vetti.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 通知类型对象 hotake_sys_notice_type
|
||||
*
|
||||
* @author ID
|
||||
* @date 2025-11-01
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class HotakeSysNoticeType extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
/** 类型名称 */
|
||||
@ApiModelProperty("类型名称")
|
||||
@Excel(name = "类型名称")
|
||||
private String typeName;
|
||||
|
||||
/** 图片 */
|
||||
@ApiModelProperty("图片")
|
||||
@Excel(name = "图片")
|
||||
private List<String> imagePath;
|
||||
|
||||
/** 删除状态(0正常 1删除) */
|
||||
@ApiModelProperty("删除状态(0正常 1删除)")
|
||||
@Excel(name = "删除状态", readConverterExp = "0=正常,1=删除")
|
||||
private String isDel;
|
||||
|
||||
}
|
||||
//package com.vetti.hotake.domain;
|
||||
//
|
||||
//import lombok.Data;
|
||||
//import lombok.experimental.Accessors;
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
||||
//import com.vetti.common.annotation.Excel;
|
||||
//import com.vetti.common.core.domain.BaseEntity;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
// * 通知类型对象 hotake_sys_notice_type
|
||||
// *
|
||||
// * @author ID
|
||||
// * @date 2025-11-01
|
||||
// */
|
||||
//@Data
|
||||
//@Accessors(chain = true)
|
||||
//public class HotakeSysNoticeType extends BaseEntity
|
||||
//{
|
||||
// private static final long serialVersionUID = 1L;
|
||||
//
|
||||
// /** 主键ID */
|
||||
// @ApiModelProperty("主键ID")
|
||||
// private Long id;
|
||||
//
|
||||
// /** 类型名称 */
|
||||
// @ApiModelProperty("类型名称")
|
||||
// @Excel(name = "类型名称")
|
||||
// private String typeName;
|
||||
//
|
||||
// /** 图片 */
|
||||
// @ApiModelProperty("图片")
|
||||
// @Excel(name = "图片")
|
||||
// private List<String> imagePath;
|
||||
//
|
||||
// /** 删除状态(0正常 1删除) */
|
||||
// @ApiModelProperty("删除状态(0正常 1删除)")
|
||||
// @Excel(name = "删除状态", readConverterExp = "0=正常,1=删除")
|
||||
// private String isDel;
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.vetti.hotake.domain.dto;
|
||||
|
||||
import com.vetti.common.annotation.Excel;
|
||||
import com.vetti.common.utils.bean.BeanUtils;
|
||||
import com.vetti.hotake.domain.HotakeSysNotice;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author ID
|
||||
* @date 2025/11/1 16:50
|
||||
*/
|
||||
@Data
|
||||
public class HotakeSysNoticeDto extends HotakeSysNotice {
|
||||
|
||||
@ApiModelProperty("通知类型名称")
|
||||
private String noticeTypeName;
|
||||
|
||||
@ApiModelProperty("图片")
|
||||
private String img;
|
||||
|
||||
@ApiModelProperty("招聘企业的名称")
|
||||
private Long cvCompanyName;
|
||||
|
||||
@ApiModelProperty("招聘企业的岗位")
|
||||
private Long cvPosition;
|
||||
|
||||
|
||||
public static HotakeSysNoticeDto build(HotakeSysNotice data, Map<Long, String> typeNameMap, String url) {
|
||||
HotakeSysNoticeDto dto = new HotakeSysNoticeDto();
|
||||
BeanUtils.copyBeanProp(dto, data);
|
||||
if (typeNameMap != null) {
|
||||
dto.setNoticeTypeName(typeNameMap.get(data.getNoticeTypeId()));
|
||||
}
|
||||
dto.setImg(url);
|
||||
|
||||
|
||||
return dto;
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,26 @@
|
||||
package com.vetti.hotake.domain.dto;
|
||||
|
||||
import com.vetti.common.utils.bean.BeanUtils;
|
||||
import com.vetti.hotake.domain.HotakeSysNoticeType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ID
|
||||
* @date 2025/11/1 11:54
|
||||
*/
|
||||
@Data
|
||||
public class HotakeSysNoticeTypeDto extends HotakeSysNoticeType {
|
||||
|
||||
private List<String> imgs;
|
||||
|
||||
|
||||
public static HotakeSysNoticeTypeDto build(List<String> urls, HotakeSysNoticeType data) {
|
||||
HotakeSysNoticeTypeDto dto = new HotakeSysNoticeTypeDto();
|
||||
BeanUtils.copyBeanProp(dto, data);
|
||||
dto.setImgs(urls);
|
||||
return dto;
|
||||
}
|
||||
|
||||
}
|
||||
//package com.vetti.hotake.domain.dto;
|
||||
//
|
||||
//import com.vetti.common.utils.bean.BeanUtils;
|
||||
//import com.vetti.hotake.domain.HotakeSysNoticeType;
|
||||
//import lombok.Data;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
// * @author ID
|
||||
// * @date 2025/11/1 11:54
|
||||
// */
|
||||
//@Data
|
||||
//public class HotakeSysNoticeTypeDto extends HotakeSysNoticeType {
|
||||
//
|
||||
// private List<String> imgs;
|
||||
//
|
||||
//
|
||||
// public static HotakeSysNoticeTypeDto build(List<String> urls, HotakeSysNoticeType data) {
|
||||
// HotakeSysNoticeTypeDto dto = new HotakeSysNoticeTypeDto();
|
||||
// BeanUtils.copyBeanProp(dto, data);
|
||||
// dto.setImgs(urls);
|
||||
// return dto;
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.vetti.hotake.domain.dto;
|
||||
|
||||
import com.vetti.hotake.domain.HotakeSysNotice;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ID
|
||||
* @date 2025/11/1 16:50
|
||||
*/
|
||||
@Data
|
||||
public class HotakeSysNoticeViewDto {
|
||||
|
||||
@ApiModelProperty("未查看")
|
||||
private List<HotakeSysNoticeDto> unreadList;
|
||||
|
||||
@ApiModelProperty("归档")
|
||||
private List<HotakeSysNoticeDto> archiveList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.vetti.hotake.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.vetti.hotake.domain.HotakeSysNotice;
|
||||
|
||||
/**
|
||||
* 通知Mapper接口
|
||||
*
|
||||
* @author ID
|
||||
* @date 2025-11-01
|
||||
*/
|
||||
public interface HotakeSysNoticeMapper
|
||||
{
|
||||
/**
|
||||
* 查询通知
|
||||
*
|
||||
* @param id 通知主键
|
||||
* @return 通知
|
||||
*/
|
||||
public HotakeSysNotice selectHotakeSysNoticeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询通知列表
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 通知集合
|
||||
*/
|
||||
public List<HotakeSysNotice> selectHotakeSysNoticeList(HotakeSysNotice hotakeSysNotice);
|
||||
|
||||
/**
|
||||
* 新增通知
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHotakeSysNotice(HotakeSysNotice hotakeSysNotice);
|
||||
|
||||
/**
|
||||
* 修改通知
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHotakeSysNotice(HotakeSysNotice hotakeSysNotice);
|
||||
|
||||
/**
|
||||
* 删除通知
|
||||
*
|
||||
* @param id 通知主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHotakeSysNoticeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除通知
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHotakeSysNoticeByIds(Long[] ids);
|
||||
/**
|
||||
* 批量新增通知
|
||||
*
|
||||
* @param hotakeSysNoticeList 通知列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchInsertHotakeSysNotice(List<HotakeSysNotice> hotakeSysNoticeList);
|
||||
|
||||
}
|
||||
@@ -1,69 +1,69 @@
|
||||
package com.vetti.hotake.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.vetti.hotake.domain.HotakeSysNoticeType;
|
||||
|
||||
/**
|
||||
* 通知类型Mapper接口
|
||||
*
|
||||
* @author ID
|
||||
* @date 2025-11-01
|
||||
*/
|
||||
public interface HotakeSysNoticeTypeMapper
|
||||
{
|
||||
/**
|
||||
* 查询通知类型
|
||||
*
|
||||
* @param id 通知类型主键
|
||||
* @return 通知类型
|
||||
*/
|
||||
public HotakeSysNoticeType selectHotakeSysNoticeTypeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询通知类型列表
|
||||
*
|
||||
* @param hotakeSysNoticeType 通知类型
|
||||
* @return 通知类型集合
|
||||
*/
|
||||
public List<HotakeSysNoticeType> selectHotakeSysNoticeTypeList(HotakeSysNoticeType hotakeSysNoticeType);
|
||||
|
||||
/**
|
||||
* 新增通知类型
|
||||
*
|
||||
* @param hotakeSysNoticeType 通知类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHotakeSysNoticeType(HotakeSysNoticeType hotakeSysNoticeType);
|
||||
|
||||
/**
|
||||
* 修改通知类型
|
||||
*
|
||||
* @param hotakeSysNoticeType 通知类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHotakeSysNoticeType(HotakeSysNoticeType hotakeSysNoticeType);
|
||||
|
||||
/**
|
||||
* 删除通知类型
|
||||
*
|
||||
* @param id 通知类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHotakeSysNoticeTypeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除通知类型
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHotakeSysNoticeTypeByIds(Long[] ids);
|
||||
/**
|
||||
* 批量新增通知类型
|
||||
*
|
||||
* @param hotakeSysNoticeTypeList 通知类型列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchInsertHotakeSysNoticeType(List<HotakeSysNoticeType> hotakeSysNoticeTypeList);
|
||||
|
||||
}
|
||||
//package com.vetti.hotake.mapper;
|
||||
//
|
||||
//import java.util.List;
|
||||
//import com.vetti.hotake.domain.HotakeSysNoticeType;
|
||||
//
|
||||
///**
|
||||
// * 通知类型Mapper接口
|
||||
// *
|
||||
// * @author ID
|
||||
// * @date 2025-11-01
|
||||
// */
|
||||
//public interface HotakeSysNoticeTypeMapper
|
||||
//{
|
||||
// /**
|
||||
// * 查询通知类型
|
||||
// *
|
||||
// * @param id 通知类型主键
|
||||
// * @return 通知类型
|
||||
// */
|
||||
// public HotakeSysNoticeType selectHotakeSysNoticeTypeById(Long id);
|
||||
//
|
||||
// /**
|
||||
// * 查询通知类型列表
|
||||
// *
|
||||
// * @param hotakeSysNoticeType 通知类型
|
||||
// * @return 通知类型集合
|
||||
// */
|
||||
// public List<HotakeSysNoticeType> selectHotakeSysNoticeTypeList(HotakeSysNoticeType hotakeSysNoticeType);
|
||||
//
|
||||
// /**
|
||||
// * 新增通知类型
|
||||
// *
|
||||
// * @param hotakeSysNoticeType 通知类型
|
||||
// * @return 结果
|
||||
// */
|
||||
// public int insertHotakeSysNoticeType(HotakeSysNoticeType hotakeSysNoticeType);
|
||||
//
|
||||
// /**
|
||||
// * 修改通知类型
|
||||
// *
|
||||
// * @param hotakeSysNoticeType 通知类型
|
||||
// * @return 结果
|
||||
// */
|
||||
// public int updateHotakeSysNoticeType(HotakeSysNoticeType hotakeSysNoticeType);
|
||||
//
|
||||
// /**
|
||||
// * 删除通知类型
|
||||
// *
|
||||
// * @param id 通知类型主键
|
||||
// * @return 结果
|
||||
// */
|
||||
// public int deleteHotakeSysNoticeTypeById(Long id);
|
||||
//
|
||||
// /**
|
||||
// * 批量删除通知类型
|
||||
// *
|
||||
// * @param ids 需要删除的数据主键集合
|
||||
// * @return 结果
|
||||
// */
|
||||
// public int deleteHotakeSysNoticeTypeByIds(Long[] ids);
|
||||
// /**
|
||||
// * 批量新增通知类型
|
||||
// *
|
||||
// * @param hotakeSysNoticeTypeList 通知类型列表
|
||||
// * @return 结果
|
||||
// */
|
||||
// public int batchInsertHotakeSysNoticeType(List<HotakeSysNoticeType> hotakeSysNoticeTypeList);
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.vetti.hotake.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.vetti.hotake.domain.HotakeSysNotice;
|
||||
import com.vetti.hotake.domain.dto.HotakeSysNoticeDto;
|
||||
import com.vetti.hotake.domain.dto.HotakeSysNoticeViewDto;
|
||||
|
||||
/**
|
||||
* 通知Service接口
|
||||
*
|
||||
* @author ID
|
||||
* @date 2025-11-01
|
||||
*/
|
||||
public interface IHotakeSysNoticeService
|
||||
{
|
||||
/**
|
||||
* 查询通知
|
||||
*
|
||||
* @param id 通知主键
|
||||
* @return 通知
|
||||
*/
|
||||
public HotakeSysNotice selectHotakeSysNoticeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询通知列表
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 通知集合
|
||||
*/
|
||||
public List<HotakeSysNotice> selectHotakeSysNoticeList(HotakeSysNotice hotakeSysNotice);
|
||||
|
||||
/**
|
||||
* 新增通知
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHotakeSysNotice(HotakeSysNotice hotakeSysNotice);
|
||||
|
||||
/**
|
||||
* 修改通知
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHotakeSysNotice(HotakeSysNotice hotakeSysNotice);
|
||||
|
||||
/**
|
||||
* 批量删除通知
|
||||
*
|
||||
* @param ids 需要删除的通知主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHotakeSysNoticeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除通知信息
|
||||
*
|
||||
* @param id 通知主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHotakeSysNoticeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量新增通知
|
||||
*
|
||||
* @param hotakeSysNoticeList 通知列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchInsertHotakeSysNotice(List<HotakeSysNotice> hotakeSysNoticeList);
|
||||
|
||||
HotakeSysNoticeViewDto selectHotakeSysNoticeViewList(HotakeSysNotice hotakeSysNotice);
|
||||
|
||||
HotakeSysNoticeDto selectHotakeSysNoticeViewById(Long id);
|
||||
|
||||
int allRead();
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package com.vetti.hotake.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.vetti.hotake.domain.HotakeSysNoticeType;
|
||||
import com.vetti.hotake.domain.dto.HotakeSysNoticeTypeDto;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 通知类型Service接口
|
||||
*
|
||||
* @author ID
|
||||
* @date 2025-11-01
|
||||
*/
|
||||
public interface IHotakeSysNoticeTypeService {
|
||||
/**
|
||||
* 查询通知类型
|
||||
*
|
||||
* @param id 通知类型主键
|
||||
* @return 通知类型
|
||||
*/
|
||||
public HotakeSysNoticeTypeDto selectHotakeSysNoticeTypeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询通知类型列表
|
||||
*
|
||||
* @param hotakeSysNoticeType 通知类型
|
||||
* @return 通知类型集合
|
||||
*/
|
||||
public List<HotakeSysNoticeTypeDto> selectHotakeSysNoticeTypeList(HotakeSysNoticeType hotakeSysNoticeType);
|
||||
|
||||
/**
|
||||
* 新增通知类型
|
||||
*
|
||||
* @param hotakeSysNoticeType 通知类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHotakeSysNoticeType(List<MultipartFile> files, HotakeSysNoticeType hotakeSysNoticeType);
|
||||
|
||||
/**
|
||||
* 修改通知类型
|
||||
*
|
||||
* @param hotakeSysNoticeType 通知类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHotakeSysNoticeType(List<MultipartFile> files,HotakeSysNoticeType hotakeSysNoticeType);
|
||||
|
||||
/**
|
||||
* 批量删除通知类型
|
||||
*
|
||||
* @param ids 需要删除的通知类型主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHotakeSysNoticeTypeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除通知类型信息
|
||||
*
|
||||
* @param id 通知类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHotakeSysNoticeTypeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量新增通知类型
|
||||
*
|
||||
* @param hotakeSysNoticeTypeList 通知类型列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchInsertHotakeSysNoticeType(List<HotakeSysNoticeType> hotakeSysNoticeTypeList);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
package com.vetti.hotake.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.vetti.common.core.domain.entity.SysDictData;
|
||||
import com.vetti.common.core.service.BaseServiceImpl;
|
||||
import com.vetti.common.enums.FillTypeEnum;
|
||||
import com.vetti.common.utils.DateUtils;
|
||||
import com.vetti.hotake.domain.dto.HotakeSysNoticeDto;
|
||||
import com.vetti.hotake.domain.dto.HotakeSysNoticeViewDto;
|
||||
import com.vetti.hotake.service.IHotakeSysFileService;
|
||||
import com.vetti.system.service.ISysDictDataService;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.vetti.hotake.mapper.HotakeSysNoticeMapper;
|
||||
import com.vetti.hotake.domain.HotakeSysNotice;
|
||||
import com.vetti.hotake.service.IHotakeSysNoticeService;
|
||||
|
||||
import static com.vetti.common.utils.SecurityUtils.getLoginUser;
|
||||
|
||||
/**
|
||||
* 通知Service业务层处理
|
||||
*
|
||||
* @author ID
|
||||
* @date 2025-11-01
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
@Service
|
||||
public class HotakeSysNoticeServiceImpl extends BaseServiceImpl implements IHotakeSysNoticeService {
|
||||
@Autowired
|
||||
private HotakeSysNoticeMapper hotakeSysNoticeMapper;
|
||||
@Autowired
|
||||
IHotakeSysFileService hotakeSysFileService;
|
||||
@Autowired
|
||||
ISysDictDataService sysDictDataService;
|
||||
|
||||
private final String DICT_DATA_TYPE_KEY = "hotake_sys_notice_type";
|
||||
|
||||
/**
|
||||
* 查询通知
|
||||
*
|
||||
* @param id 通知主键
|
||||
* @return 通知
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
@Override
|
||||
public HotakeSysNotice selectHotakeSysNoticeById(Long id) {
|
||||
return hotakeSysNoticeMapper.selectHotakeSysNoticeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询通知列表
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 通知
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
@Override
|
||||
public List<HotakeSysNotice> selectHotakeSysNoticeList(HotakeSysNotice hotakeSysNotice) {
|
||||
return hotakeSysNoticeMapper.selectHotakeSysNoticeList(hotakeSysNotice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增通知
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int insertHotakeSysNotice(HotakeSysNotice hotakeSysNotice) {
|
||||
fill(FillTypeEnum.INSERT.getCode(), hotakeSysNotice);
|
||||
return hotakeSysNoticeMapper.insertHotakeSysNotice(hotakeSysNotice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改通知
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int updateHotakeSysNotice(HotakeSysNotice hotakeSysNotice) {
|
||||
fill(FillTypeEnum.UPDATE.getCode(), hotakeSysNotice);
|
||||
return hotakeSysNoticeMapper.updateHotakeSysNotice(hotakeSysNotice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除通知
|
||||
*
|
||||
* @param ids 需要删除的通知主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int deleteHotakeSysNoticeByIds(Long[] ids) {
|
||||
return hotakeSysNoticeMapper.deleteHotakeSysNoticeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除通知信息
|
||||
*
|
||||
* @param id 通知主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int deleteHotakeSysNoticeById(Long id) {
|
||||
return hotakeSysNoticeMapper.deleteHotakeSysNoticeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增通知
|
||||
*
|
||||
* @param hotakeSysNoticeList 通知列表
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int batchInsertHotakeSysNotice(List<HotakeSysNotice> hotakeSysNoticeList) {
|
||||
return hotakeSysNoticeMapper.batchInsertHotakeSysNotice(hotakeSysNoticeList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HotakeSysNoticeViewDto selectHotakeSysNoticeViewList(HotakeSysNotice hotakeSysNotice) {
|
||||
HotakeSysNotice query = new HotakeSysNoticeDto();
|
||||
query.setIsDel("0");
|
||||
query.setReceiveUserId(getLoginUser().getUserId());
|
||||
List<HotakeSysNotice> list = hotakeSysNoticeMapper.selectHotakeSysNoticeList(query);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return new HotakeSysNoticeViewDto();
|
||||
}
|
||||
HotakeSysNoticeViewDto data = new HotakeSysNoticeViewDto();
|
||||
List<HotakeSysNoticeDto> unreadList = new ArrayList<>();
|
||||
List<HotakeSysNoticeDto> archiveList = new ArrayList<>();
|
||||
Map<Long, String> typeNameMap = typeName();
|
||||
list.forEach(e -> {
|
||||
if ("0".equals(e.getIsView())) {
|
||||
unreadList.add(HotakeSysNoticeDto.build(e, typeNameMap, url(e)));
|
||||
} else if ("1".equals(e.getIsView())) {
|
||||
archiveList.add(HotakeSysNoticeDto.build(e, typeNameMap, url(e)));
|
||||
}
|
||||
});
|
||||
data.setUnreadList(unreadList);
|
||||
data.setArchiveList(archiveList);
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HotakeSysNoticeDto selectHotakeSysNoticeViewById(Long id) {
|
||||
HotakeSysNotice data = hotakeSysNoticeMapper.selectHotakeSysNoticeById(id);
|
||||
data.setIsView("1");
|
||||
fill(FillTypeEnum.UPDATE.getCode(), data);
|
||||
hotakeSysNoticeMapper.updateHotakeSysNotice(data);
|
||||
return HotakeSysNoticeDto.build(data, typeName(), url(data));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int allRead() {
|
||||
HotakeSysNotice query = new HotakeSysNoticeDto();
|
||||
query.setIsDel("0");
|
||||
query.setReceiveUserId(getLoginUser().getUserId());
|
||||
List<HotakeSysNotice> list = hotakeSysNoticeMapper.selectHotakeSysNoticeList(query);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
list.forEach(e -> {
|
||||
e.setIsView("1");
|
||||
fill(FillTypeEnum.UPDATE.getCode(), e);
|
||||
hotakeSysNoticeMapper.updateHotakeSysNotice(e);
|
||||
});
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
private String url(HotakeSysNotice d) {
|
||||
if (CollectionUtils.isNotEmpty(d.getImagePath())) {
|
||||
return hotakeSysFileService.url(Long.parseLong(d.getImagePath().get(0)));
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
private Map<Long, String> typeName() {
|
||||
SysDictData query = new SysDictData();
|
||||
query.setDictType(DICT_DATA_TYPE_KEY);
|
||||
List<SysDictData> list = sysDictDataService.selectDictDataList(query);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return null;
|
||||
}
|
||||
Map<Long, String> map = new HashMap<>();
|
||||
list.forEach(e -> map.put(e.getDictCode(), e.getDictLabel()));
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,192 +0,0 @@
|
||||
package com.vetti.hotake.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.vetti.common.constant.SysDictDataConstants;
|
||||
import com.vetti.common.core.service.BaseServiceImpl;
|
||||
import com.vetti.common.enums.FillTypeEnum;
|
||||
import com.vetti.common.utils.DateUtils;
|
||||
import com.vetti.hotake.domain.HotakeSysFile;
|
||||
import com.vetti.hotake.domain.dto.HotakeSysNoticeTypeDto;
|
||||
import com.vetti.hotake.service.IHotakeSysFileService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.vetti.hotake.mapper.HotakeSysNoticeTypeMapper;
|
||||
import com.vetti.hotake.domain.HotakeSysNoticeType;
|
||||
import com.vetti.hotake.service.IHotakeSysNoticeTypeService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 通知类型Service业务层处理
|
||||
*
|
||||
* @author ID
|
||||
* @date 2025-11-01
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
@Service
|
||||
public class HotakeSysNoticeTypeServiceImpl extends BaseServiceImpl implements IHotakeSysNoticeTypeService {
|
||||
@Autowired
|
||||
private HotakeSysNoticeTypeMapper hotakeSysNoticeTypeMapper;
|
||||
@Autowired
|
||||
IHotakeSysFileService hotakeSysFileService;
|
||||
|
||||
private final String MINIO_BUCKET_NAME = "noticetype-fs";
|
||||
|
||||
/**
|
||||
* 查询通知类型
|
||||
*
|
||||
* @param id 通知类型主键
|
||||
* @return 通知类型
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
@Override
|
||||
public HotakeSysNoticeTypeDto selectHotakeSysNoticeTypeById(Long id) {
|
||||
HotakeSysNoticeType data = hotakeSysNoticeTypeMapper.selectHotakeSysNoticeTypeById(id);
|
||||
List<String> urls = new ArrayList<>();
|
||||
if (data != null) {
|
||||
if (CollectionUtil.isNotEmpty(data.getImagePath())) {
|
||||
Map<Long, String> m = hotakeSysFileService.url(
|
||||
data.getImagePath().stream().map(s -> Long.parseLong(s)).toArray(Long[]::new)
|
||||
);
|
||||
if (CollectionUtil.isNotEmpty(m)) {
|
||||
m.forEach((k, v) -> urls.add(v));
|
||||
}
|
||||
}
|
||||
}
|
||||
return HotakeSysNoticeTypeDto.build(urls, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询通知类型列表
|
||||
*
|
||||
* @param hotakeSysNoticeType 通知类型
|
||||
* @return 通知类型
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
@Override
|
||||
public List<HotakeSysNoticeTypeDto> selectHotakeSysNoticeTypeList(HotakeSysNoticeType hotakeSysNoticeType) {
|
||||
List<HotakeSysNoticeTypeDto> reList = new ArrayList<>();
|
||||
hotakeSysNoticeType.setIsDel("0");
|
||||
List<HotakeSysNoticeType> list = hotakeSysNoticeTypeMapper.selectHotakeSysNoticeTypeList(hotakeSysNoticeType);
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
list.forEach(e -> {
|
||||
List<String> urls = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(e.getImagePath())) {
|
||||
Map<Long, String> m = hotakeSysFileService.url(
|
||||
e.getImagePath().stream().map(s -> Long.parseLong(s)).toArray(Long[]::new)
|
||||
);
|
||||
if (CollectionUtil.isNotEmpty(m)) {
|
||||
m.forEach((k, v) -> urls.add(v));
|
||||
}
|
||||
}
|
||||
reList.add(HotakeSysNoticeTypeDto.build(urls, e));
|
||||
});
|
||||
}
|
||||
return reList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增通知类型
|
||||
*
|
||||
* @param hotakeSysNoticeType 通知类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int insertHotakeSysNoticeType(List<MultipartFile> files, HotakeSysNoticeType hotakeSysNoticeType) {
|
||||
fill(FillTypeEnum.INSERT.getCode(), hotakeSysNoticeType);
|
||||
if (CollectionUtil.isNotEmpty(files)) {
|
||||
List<String> l = new ArrayList();
|
||||
for (MultipartFile file : files) {
|
||||
HotakeSysFile sf = uploadFile(file);
|
||||
l.add(sf.getId() + "");
|
||||
}
|
||||
hotakeSysNoticeType.setImagePath(l);
|
||||
}
|
||||
return hotakeSysNoticeTypeMapper.insertHotakeSysNoticeType(hotakeSysNoticeType);
|
||||
}
|
||||
|
||||
private HotakeSysFile uploadFile(MultipartFile file) {
|
||||
HotakeSysFile commandSysFile = new HotakeSysFile();
|
||||
commandSysFile.setCode(System.currentTimeMillis() + "");
|
||||
commandSysFile.setMinioBucketName(MINIO_BUCKET_NAME);
|
||||
return hotakeSysFileService.insertHotakeSysFile(file, commandSysFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改通知类型
|
||||
*
|
||||
* @param hotakeSysNoticeType 通知类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int updateHotakeSysNoticeType(List<MultipartFile> files, HotakeSysNoticeType hotakeSysNoticeType) {
|
||||
fill(FillTypeEnum.UPDATE.getCode(), hotakeSysNoticeType);
|
||||
if (CollectionUtils.isNotEmpty(files)) {
|
||||
List<String> l = new ArrayList();
|
||||
for (MultipartFile file : files) {
|
||||
HotakeSysFile sf = uploadFile(file);
|
||||
l.add(sf.getId() + "");
|
||||
}
|
||||
hotakeSysNoticeType.setImagePath(l);
|
||||
}
|
||||
return hotakeSysNoticeTypeMapper.updateHotakeSysNoticeType(hotakeSysNoticeType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除通知类型
|
||||
*
|
||||
* @param ids 需要删除的通知类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int deleteHotakeSysNoticeTypeByIds(Long[] ids) {
|
||||
if (ids != null && ids.length > 0) {
|
||||
for (Long id : ids) {
|
||||
HotakeSysNoticeType hotakeSysNoticeType = selectHotakeSysNoticeTypeById(id);
|
||||
hotakeSysNoticeType.setIsDel("1");
|
||||
fill(FillTypeEnum.UPDATE.getCode(), hotakeSysNoticeType);
|
||||
hotakeSysNoticeTypeMapper.updateHotakeSysNoticeType(hotakeSysNoticeType);
|
||||
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除通知类型信息
|
||||
*
|
||||
* @param id 通知类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int deleteHotakeSysNoticeTypeById(Long id) {
|
||||
HotakeSysNoticeType hotakeSysNoticeType = selectHotakeSysNoticeTypeById(id);
|
||||
hotakeSysNoticeType.setIsDel("1");
|
||||
fill(FillTypeEnum.UPDATE.getCode(), hotakeSysNoticeType);
|
||||
return hotakeSysNoticeTypeMapper.updateHotakeSysNoticeType(hotakeSysNoticeType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增通知类型
|
||||
*
|
||||
* @param hotakeSysNoticeTypeList 通知类型列表
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int batchInsertHotakeSysNoticeType(List<HotakeSysNoticeType> hotakeSysNoticeTypeList) {
|
||||
return hotakeSysNoticeTypeMapper.batchInsertHotakeSysNoticeType(hotakeSysNoticeTypeList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
<?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.vetti.hotake.mapper.HotakeSysFileMapper">
|
||||
|
||||
<resultMap type="HotakeSysFile" id="HotakeSysFileResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="minioBucketName" column="minio_bucket_name" />
|
||||
<result property="code" column="code" />
|
||||
<result property="fileName" column="file_name" />
|
||||
<result property="fileType" column="file_type" />
|
||||
<result property="fileSize" column="file_size" />
|
||||
<result property="storagePath" column="storage_path" />
|
||||
<result property="fileMd5" column="file_md5" />
|
||||
<result property="uploadPlatform" column="upload_platform" />
|
||||
<result property="available" column="available" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHotakeSysFileVo">
|
||||
select id, minio_bucket_name, code, file_name, file_type, file_size, storage_path, file_md5, upload_platform, available, create_by, create_time, update_by, update_time, remark from hotake_sys_file
|
||||
</sql>
|
||||
|
||||
<select id="selectHotakeSysFileList" parameterType="HotakeSysFile" resultMap="HotakeSysFileResult">
|
||||
<include refid="selectHotakeSysFileVo"/>
|
||||
<where>
|
||||
<if test="minioBucketName != null and minioBucketName != ''"> and minio_bucket_name = #{minioBucketName}</if>
|
||||
<if test="code != null and code != ''"> and code = #{code}</if>
|
||||
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
||||
<if test="fileType != null and fileType != ''"> and file_type = #{fileType}</if>
|
||||
<if test="fileSize != null "> and file_size = #{fileSize}</if>
|
||||
<if test="storagePath != null and storagePath != ''"> and storage_path = #{storagePath}</if>
|
||||
<if test="fileMd5 != null and fileMd5 != ''"> and file_md5 = #{fileMd5}</if>
|
||||
<if test="uploadPlatform != null "> and upload_platform = #{uploadPlatform}</if>
|
||||
<if test="available != null "> and available = #{available}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHotakeSysFileById" parameterType="Long" resultMap="HotakeSysFileResult">
|
||||
<include refid="selectHotakeSysFileVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertHotakeSysFile" parameterType="HotakeSysFile" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into Hotake_sys_file
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="minioBucketName != null and minioBucketName != ''">minio_bucket_name,</if>
|
||||
<if test="code != null and code != ''">code,</if>
|
||||
<if test="fileName != null and fileName != ''">file_name,</if>
|
||||
<if test="fileType != null and fileType != ''">file_type,</if>
|
||||
<if test="fileSize != null">file_size,</if>
|
||||
<if test="storagePath != null and storagePath != ''">storage_path,</if>
|
||||
<if test="fileMd5 != null">file_md5,</if>
|
||||
<if test="uploadPlatform != null">upload_platform,</if>
|
||||
<if test="available != null">available,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="minioBucketName != null and minioBucketName != ''">#{minioBucketName},</if>
|
||||
<if test="code != null and code != ''">#{code},</if>
|
||||
<if test="fileName != null and fileName != ''">#{fileName},</if>
|
||||
<if test="fileType != null and fileType != ''">#{fileType},</if>
|
||||
<if test="fileSize != null">#{fileSize},</if>
|
||||
<if test="storagePath != null and storagePath != ''">#{storagePath},</if>
|
||||
<if test="fileMd5 != null">#{fileMd5},</if>
|
||||
<if test="uploadPlatform != null">#{uploadPlatform},</if>
|
||||
<if test="available != null">#{available},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHotakeSysFile" parameterType="HotakeSysFile">
|
||||
update Hotake_sys_file
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="minioBucketName != null and minioBucketName != ''">minio_bucket_name = #{minioBucketName},</if>
|
||||
<if test="code != null and code != ''">code = #{code},</if>
|
||||
<if test="fileName != null and fileName != ''">file_name = #{fileName},</if>
|
||||
<if test="fileType != null and fileType != ''">file_type = #{fileType},</if>
|
||||
<if test="fileSize != null">file_size = #{fileSize},</if>
|
||||
<if test="storagePath != null and storagePath != ''">storage_path = #{storagePath},</if>
|
||||
<if test="fileMd5 != null">file_md5 = #{fileMd5},</if>
|
||||
<if test="uploadPlatform != null">upload_platform = #{uploadPlatform},</if>
|
||||
<if test="available != null">available = #{available},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHotakeSysFileById" parameterType="Long">
|
||||
delete from Hotake_sys_file where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHotakeSysFileByIds" parameterType="String">
|
||||
delete from Hotake_sys_file where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsertHotakeSysFile">
|
||||
insert into Hotake_sys_file( id, minio_bucket_name, code, file_name, file_type, file_size, storage_path, file_md5, upload_platform, available, create_by, create_time, update_by, update_time, remark,) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.minioBucketName}, #{item.code}, #{item.fileName}, #{item.fileType}, #{item.fileSize}, #{item.storagePath}, #{item.fileMd5}, #{item.uploadPlatform}, #{item.available}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark},)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectHotakeSysFileByIds" parameterType="String" resultMap="HotakeSysFileResult">
|
||||
<include refid="selectHotakeSysFileVo"/> where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,145 @@
|
||||
<?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.vetti.hotake.mapper.HotakeSysNoticeMapper">
|
||||
|
||||
<resultMap type="HotakeSysNotice" id="HotakeSysNoticeResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="noticeTypeId" column="notice_type_id"/>
|
||||
<result property="cvId" column="cv_id"/>
|
||||
<result property="noticeTitle" column="notice_title"/>
|
||||
<result property="noticeContent" column="notice_content"/>
|
||||
<result property="sendUserId" column="send_user_id"/>
|
||||
<result property="receiveUserId" column="receive_user_id"/>
|
||||
<result property="isView" column="is_view"/>
|
||||
<result property="imagePath" column="image_path" typeHandler="com.vetti.common.handle.JsonTypeHandler"/>
|
||||
<result property="isDel" column="is_del"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHotakeSysNoticeVo">
|
||||
select id,
|
||||
notice_type_id,
|
||||
cv_id,
|
||||
notice_title,
|
||||
notice_content,
|
||||
send_user_id,
|
||||
receive_user_id,
|
||||
is_view,
|
||||
is_del,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark
|
||||
from hotake_sys_notice
|
||||
</sql>
|
||||
|
||||
<select id="selectHotakeSysNoticeList" parameterType="HotakeSysNotice" resultMap="HotakeSysNoticeResult">
|
||||
<include refid="selectHotakeSysNoticeVo"/>
|
||||
<where>
|
||||
<if test="noticeTypeId != null ">and notice_type_id = #{noticeTypeId}</if>
|
||||
<if test="cvId != null ">and cv_id = #{cvId}</if>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">and notice_title = #{noticeTitle}</if>
|
||||
<if test="noticeContent != null and noticeContent != ''">and notice_content = #{noticeContent}</if>
|
||||
<if test="sendUserId != null ">and send_user_id = #{sendUserId}</if>
|
||||
<if test="receiveUserId != null ">and receive_user_id = #{receiveUserId}</if>
|
||||
<if test="isView != null and isView != ''">and is_view = #{isView}</if>
|
||||
<if test="isDel != null and isDel != ''">and is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHotakeSysNoticeById" parameterType="Long" resultMap="HotakeSysNoticeResult">
|
||||
<include refid="selectHotakeSysNoticeVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertHotakeSysNotice" parameterType="HotakeSysNotice" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into hotake_sys_notice
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="noticeTypeId != null">notice_type_id,</if>
|
||||
<if test="cvId != null">cv_id,</if>
|
||||
<if test="noticeTitle != null">notice_title,</if>
|
||||
<if test="noticeContent != null">notice_content,</if>
|
||||
<if test="sendUserId != null">send_user_id,</if>
|
||||
<if test="receiveUserId != null">receive_user_id,</if>
|
||||
<if test="isView != null">is_view,</if>
|
||||
<if test="imagePath != null">image_path,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="noticeTypeId != null">#{noticeTypeId},</if>
|
||||
<if test="cvId != null">#{cvId},</if>
|
||||
<if test="noticeTitle != null">#{noticeTitle},</if>
|
||||
<if test="noticeContent != null">#{noticeContent},</if>
|
||||
<if test="sendUserId != null">#{sendUserId},</if>
|
||||
<if test="receiveUserId != null">#{receiveUserId},</if>
|
||||
<if test="isView != null">#{isView},</if>
|
||||
<if test="imagePath != null">#{imagePath, typeHandler=com.vetti.common.handle.JsonTypeHandler},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHotakeSysNotice" parameterType="HotakeSysNotice">
|
||||
update hotake_sys_notice
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="noticeTypeId != null">notice_type_id = #{noticeTypeId},</if>
|
||||
<if test="cvId != null">cv_id = #{cvId},</if>
|
||||
<if test="noticeTitle != null">notice_title = #{noticeTitle},</if>
|
||||
<if test="noticeContent != null">notice_content = #{noticeContent},</if>
|
||||
<if test="sendUserId != null">send_user_id = #{sendUserId},</if>
|
||||
<if test="receiveUserId != null">receive_user_id = #{receiveUserId},</if>
|
||||
<if test="isView != null">is_view = #{isView},</if>
|
||||
<if test="imagePath != null">image_path =
|
||||
#{imagePath, typeHandler=com.vetti.common.handle.JsonTypeHandler},
|
||||
</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHotakeSysNoticeById" parameterType="Long">
|
||||
delete
|
||||
from hotake_sys_notice
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHotakeSysNoticeByIds" parameterType="String">
|
||||
delete from hotake_sys_notice where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsertHotakeSysNotice">
|
||||
insert into hotake_sys_notice( id, notice_type_id, cv_id, notice_title, notice_content, send_user_id,
|
||||
receive_user_id, is_view,image_path, is_del, create_by, create_time, update_by, update_time, remark,) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.noticeTypeId}, #{item.cvId}, #{item.noticeTitle}, #{item.noticeContent},
|
||||
#{item.sendUserId}, #{item.receiveUserId},
|
||||
#{item.isView},#{item.imagePath, typeHandler=com.vetti.common.handle.JsonTypeHandler}, #{item.isDel},
|
||||
#{item.createBy},
|
||||
#{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark},)
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -1,109 +0,0 @@
|
||||
<?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.vetti.hotake.mapper.HotakeSysNoticeTypeMapper">
|
||||
|
||||
<resultMap type="HotakeSysNoticeType" id="HotakeSysNoticeTypeResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="typeName" column="type_name"/>
|
||||
<result property="imagePath" column="image_path" typeHandler="com.vetti.common.handle.JsonTypeHandler"/>
|
||||
<result property="isDel" column="is_del"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHotakeSysNoticeTypeVo">
|
||||
select id,
|
||||
type_name,
|
||||
image_path,
|
||||
is_del,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark
|
||||
from hotake_sys_notice_type
|
||||
</sql>
|
||||
|
||||
<select id="selectHotakeSysNoticeTypeList" parameterType="HotakeSysNoticeType"
|
||||
resultMap="HotakeSysNoticeTypeResult">
|
||||
<include refid="selectHotakeSysNoticeTypeVo"/>
|
||||
<where>
|
||||
<if test="typeName != null and typeName != ''">and type_name like concat('%', #{typeName}, '%')</if>
|
||||
<if test="imagePath != null and imagePath != ''">and image_path = #{imagePath}</if>
|
||||
<if test="isDel != null and isDel != ''">and is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHotakeSysNoticeTypeById" parameterType="Long" resultMap="HotakeSysNoticeTypeResult">
|
||||
<include refid="selectHotakeSysNoticeTypeVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertHotakeSysNoticeType" parameterType="HotakeSysNoticeType" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into hotake_sys_notice_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="typeName != null">type_name,</if>
|
||||
<if test="imagePath != null">image_path,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="typeName != null">#{typeName},</if>
|
||||
<if test="imagePath != null">#{imagePath, typeHandler=com.vetti.common.handle.JsonTypeHandler},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHotakeSysNoticeType" parameterType="HotakeSysNoticeType">
|
||||
update hotake_sys_notice_type
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="typeName != null">type_name = #{typeName},</if>
|
||||
<if test="imagePath != null">image_path =
|
||||
#{imagePath, typeHandler=com.vetti.common.handle.JsonTypeHandler},
|
||||
</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHotakeSysNoticeTypeById" parameterType="Long">
|
||||
delete
|
||||
from hotake_sys_notice_type
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHotakeSysNoticeTypeByIds" parameterType="String">
|
||||
delete from hotake_sys_notice_type where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsertHotakeSysNoticeType">
|
||||
insert into hotake_sys_notice_type( id, type_name, image_path, is_del, create_by, create_time, update_by,
|
||||
update_time, remark,) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.typeName}, #{item.imagePath, typeHandler=com.vetti.common.handle.JsonTypeHandler},
|
||||
#{item.isDel}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark},)
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user