src/main/java/com/ruoyi/common/config/IgnoreTableConfig.java
@@ -34,6 +34,7 @@ IGNORE_TABLES.add("sys_user_dept"); IGNORE_TABLES.add("sys_job_log"); IGNORE_TABLES.add("gen_table"); IGNORE_TABLES.add("sys_user_client"); IGNORE_TABLES.add("gen_table_column"); IGNORE_TABLES.add("area"); } src/main/java/com/ruoyi/inspectiontask/service/impl/InspectionTaskServiceImpl.java
@@ -76,7 +76,7 @@ // 批量查询登记人 Map<Long, SysUser> sysUserMap; if (!registrantIds.isEmpty()) { List<SysUser> sysUsers = sysUserMapper.selectList(registrantIds); List<SysUser> sysUsers = sysUserMapper.selectLists(registrantIds); sysUserMap = sysUsers.stream().collect(Collectors.toMap(SysUser::getUserId, Function.identity())); } else { sysUserMap = new HashMap<>(); src/main/java/com/ruoyi/project/system/controller/SysNoticeController.java
@@ -1,91 +1,97 @@ package com.ruoyi.project.system.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; import com.ruoyi.project.system.domain.SysNotice; import com.ruoyi.project.system.service.ISysNoticeService; /** * 公告 信息操作处理 * * @author ruoyi */ @RestController @RequestMapping("/system/notice") public class SysNoticeController extends BaseController { @Autowired private ISysNoticeService noticeService; /** * 获取通知公告列表 */ @PreAuthorize("@ss.hasPermi('system:notice:list')") @GetMapping("/list") public TableDataInfo list(SysNotice notice) { startPage(); List<SysNotice> list = noticeService.selectNoticeList(notice); return getDataTable(list); } /** * 根据通知公告编号获取详细信息 */ @PreAuthorize("@ss.hasPermi('system:notice:query')") @GetMapping(value = "/{noticeId}") public AjaxResult getInfo(@PathVariable Long noticeId) { return success(noticeService.selectNoticeById(noticeId)); } /** * 新增通知公告 */ @PreAuthorize("@ss.hasPermi('system:notice:add')") @Log(title = "通知公告", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysNotice notice) { notice.setCreateBy(getUsername()); return toAjax(noticeService.insertNotice(notice)); } /** * 修改通知公告 */ @PreAuthorize("@ss.hasPermi('system:notice:edit')") @Log(title = "通知公告", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysNotice notice) { notice.setUpdateBy(getUsername()); return toAjax(noticeService.updateNotice(notice)); } /** * 删除通知公告 */ @PreAuthorize("@ss.hasPermi('system:notice:remove')") @Log(title = "通知公告", businessType = BusinessType.DELETE) @DeleteMapping("/{noticeIds}") public AjaxResult remove(@PathVariable Long[] noticeIds) { return toAjax(noticeService.deleteNoticeByIds(noticeIds)); } } package com.ruoyi.project.system.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.domain.R; import com.ruoyi.project.system.domain.SysNotice; import com.ruoyi.project.system.service.ISysNoticeService; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; /** * 公告 信息操作处理 * * @author ruoyi */ @RestController @RequestMapping("/system/notice") public class SysNoticeController extends BaseController { @Autowired private ISysNoticeService noticeService; /** * 获取通知公告列表 */ @GetMapping("/list") public R<IPage<SysNotice>> list(SysNotice notice, Page page) { IPage<SysNotice> list = noticeService.selectNoticeList(notice, page); return R.ok(list); } /** * 获取未读数量 */ @GetMapping("/getCount") public R getCount(Long consigneeId) { return R.ok(noticeService.getCount(consigneeId)); } /** * 根据通知公告编号获取详细信息 */ @GetMapping(value = "/{noticeId}") public AjaxResult getInfo(@PathVariable Long noticeId) { return success(noticeService.selectNoticeById(noticeId)); } /** * 新增通知公告 */ @PostMapping public AjaxResult add(@Validated @RequestBody SysNotice notice) { return toAjax(noticeService.insertNotice(notice)); } /** * 修改通知公告 */ @PutMapping public AjaxResult edit(@Validated @RequestBody SysNotice notice) { return toAjax(noticeService.updateNotice(notice)); } /** * 删除通知公告 */ @DeleteMapping("/{noticeIds}") public AjaxResult remove(@PathVariable Long[] noticeIds) { return toAjax(noticeService.deleteNoticeByIds(noticeIds)); } /** * 一键已读 */ @PostMapping("/readAll") public AjaxResult readAll() { return toAjax(noticeService.readAll()); } @PostMapping("appReadNotice") @ApiOperation("移动端根据消息ID进行已读") public AjaxResult appReadNotice(@RequestParam("noticeId") Long noticeId) { boolean result = noticeService.appReadNotice(noticeId); return toAjax(result); } } src/main/java/com/ruoyi/project/system/domain/SysNotice.java
@@ -76,6 +76,7 @@ /** * 租户id */ @TableField(fill = FieldFill.INSERT) private Long tenantId; src/main/java/com/ruoyi/project/system/mapper/SysNoticeMapper.java
@@ -1,60 +1,65 @@ package com.ruoyi.project.system.mapper; import java.util.List; import com.ruoyi.project.system.domain.SysNotice; /** * 通知公告表 数据层 * * @author ruoyi */ public interface SysNoticeMapper { /** * 查询公告信息 * * @param noticeId 公告ID * @return 公告信息 */ public SysNotice selectNoticeById(Long noticeId); /** * 查询公告列表 * * @param notice 公告信息 * @return 公告集合 */ public List<SysNotice> selectNoticeList(SysNotice notice); /** * 新增公告 * * @param notice 公告信息 * @return 结果 */ public int insertNotice(SysNotice notice); /** * 修改公告 * * @param notice 公告信息 * @return 结果 */ public int updateNotice(SysNotice notice); /** * 批量删除公告 * * @param noticeId 公告ID * @return 结果 */ public int deleteNoticeById(Long noticeId); /** * 批量删除公告信息 * * @param noticeIds 需要删除的公告ID * @return 结果 */ public int deleteNoticeByIds(Long[] noticeIds); } package com.ruoyi.project.system.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.ruoyi.project.system.domain.SysNotice; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; /** * 通知公告表 数据层 * * @author ruoyi */ @Mapper public interface SysNoticeMapper extends BaseMapper<SysNotice> { /** * 查询公告信息 * * @param noticeId 公告ID * @return 公告信息 */ public SysNotice selectNoticeById(Long noticeId); /** * 查询公告列表 * * @param notice 公告信息 * @return 公告集合 */ public IPage<SysNotice> selectNoticeList(@Param("c") SysNotice notice, Page page); /** * 新增公告 * * @param notice 公告信息 * @return 结果 */ public int insertNotice(SysNotice notice); /** * 修改公告 * * @param notice 公告信息 * @return 结果 */ public int updateNotice(SysNotice notice); /** * 批量删除公告 * * @param noticeId 公告ID * @return 结果 */ public int deleteNoticeById(Long noticeId); /** * 批量删除公告信息 * * @param noticeIds 需要删除的公告ID * @return 结果 */ public int deleteNoticeByIds(Long[] noticeIds); } src/main/java/com/ruoyi/project/system/mapper/SysUserMapper.java
@@ -14,7 +14,7 @@ * * @author ruoyi */ public interface SysUserMapper public interface SysUserMapper extends BaseMapper<SysUser> { /** * 根据条件分页查询用户列表 @@ -138,7 +138,7 @@ */ public SysUser checkEmailUnique(String email); List<SysUser> selectList(List<Long> registrantIds); List<SysUser> selectLists(List<Long> registrantIds); List<SysUser> selectUsersByIds(@Param("userIds") List<Long> userIds); } src/main/java/com/ruoyi/project/system/service/ISysNoticeService.java
@@ -1,60 +1,92 @@ package com.ruoyi.project.system.service; import java.util.List; import com.ruoyi.project.system.domain.SysNotice; /** * 公告 服务层 * * @author ruoyi */ public interface ISysNoticeService { /** * 查询公告信息 * * @param noticeId 公告ID * @return 公告信息 */ public SysNotice selectNoticeById(Long noticeId); /** * 查询公告列表 * * @param notice 公告信息 * @return 公告集合 */ public List<SysNotice> selectNoticeList(SysNotice notice); /** * 新增公告 * * @param notice 公告信息 * @return 结果 */ public int insertNotice(SysNotice notice); /** * 修改公告 * * @param notice 公告信息 * @return 结果 */ public int updateNotice(SysNotice notice); /** * 删除公告信息 * * @param noticeId 公告ID * @return 结果 */ public int deleteNoticeById(Long noticeId); /** * 批量删除公告信息 * * @param noticeIds 需要删除的公告ID * @return 结果 */ public int deleteNoticeByIds(Long[] noticeIds); } package com.ruoyi.project.system.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.project.system.domain.SysNotice; import java.util.List; /** * 公告 服务层 * * @author ruoyi */ public interface ISysNoticeService extends IService<SysNotice> { /** * 查询公告信息 * * @param noticeId 公告ID * @return 公告信息 */ public SysNotice selectNoticeById(Long noticeId); /** * 查询公告列表 * * @param notice 公告信息 * @return 公告集合 */ public IPage<SysNotice> selectNoticeList(SysNotice notice, Page page); /** * 新增公告 * * @param notice 公告信息 * @return 结果 */ public int insertNotice(SysNotice notice); /** * 修改公告 * * @param notice 公告信息 * @return 结果 */ public int updateNotice(SysNotice notice); /** * 删除公告信息 * * @param noticeId 公告ID * @return 结果 */ public int deleteNoticeById(Long noticeId); /** * 批量删除公告信息 * * @param noticeIds 需要删除的公告ID * @return 结果 */ public int deleteNoticeByIds(Long[] noticeIds); Long getCount(Long consigneeId); int readAll(); /** * 通过指定人发送提醒 * @param title 标题 * @param message 消息 * @param jumpPath 跳转地址 */ void simpleNoticeByUser(final String title, final String message, final List<Long> consigneeId, final String jumpPath); /** * 通过所有人 发送提醒 * @param title 标题 * @param message 消息 * @param jumpPath 跳转地址 */ void simpleNoticeAll(final String title, final String message,final String jumpPath); /** * APP点击推送消息更改为已读状态 * * @param noticeId 消息ID * @return 失败/成功 */ boolean appReadNotice(Long noticeId); } src/main/java/com/ruoyi/project/system/service/impl/SysNoticeServiceImpl.java
@@ -1,92 +1,242 @@ package com.ruoyi.project.system.service.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.project.system.domain.SysNotice; import com.ruoyi.project.system.mapper.SysNoticeMapper; import com.ruoyi.project.system.service.ISysNoticeService; /** * 公告 服务层实现 * * @author ruoyi */ @Service public class SysNoticeServiceImpl implements ISysNoticeService { @Autowired private SysNoticeMapper noticeMapper; /** * 查询公告信息 * * @param noticeId 公告ID * @return 公告信息 */ @Override public SysNotice selectNoticeById(Long noticeId) { return noticeMapper.selectNoticeById(noticeId); } /** * 查询公告列表 * * @param notice 公告信息 * @return 公告集合 */ @Override public List<SysNotice> selectNoticeList(SysNotice notice) { return noticeMapper.selectNoticeList(notice); } /** * 新增公告 * * @param notice 公告信息 * @return 结果 */ @Override public int insertNotice(SysNotice notice) { return noticeMapper.insertNotice(notice); } /** * 修改公告 * * @param notice 公告信息 * @return 结果 */ @Override public int updateNotice(SysNotice notice) { return noticeMapper.updateNotice(notice); } /** * 删除公告对象 * * @param noticeId 公告ID * @return 结果 */ @Override public int deleteNoticeById(Long noticeId) { return noticeMapper.deleteNoticeById(noticeId); } /** * 批量删除公告信息 * * @param noticeIds 需要删除的公告ID * @return 结果 */ @Override public int deleteNoticeByIds(Long[] noticeIds) { return noticeMapper.deleteNoticeByIds(noticeIds); } } package com.ruoyi.project.system.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.project.system.domain.SysDept; import com.ruoyi.project.system.domain.SysNotice; import com.ruoyi.project.system.domain.SysUser; import com.ruoyi.project.system.domain.SysUserDept; import com.ruoyi.project.system.mapper.SysDeptMapper; import com.ruoyi.project.system.mapper.SysNoticeMapper; import com.ruoyi.project.system.mapper.SysUserDeptMapper; import com.ruoyi.project.system.mapper.SysUserMapper; import com.ruoyi.project.system.service.ISysNoticeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.stream.Collectors; /** * 公告 服务层实现 * * @author ruoyi */ @Service public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements ISysNoticeService { @Autowired private SysNoticeMapper noticeMapper; @Autowired private SysUserMapper userMapper; @Autowired private SysDeptMapper deptMapper; @Autowired private SysUserDeptMapper userDeptMapper; @Autowired @Lazy private ISysNoticeService sysNoticeService; @Autowired private UnipushService unipushService; /** * 查询公告信息 * * @param noticeId 公告ID * @return 公告信息 */ @Override public SysNotice selectNoticeById(Long noticeId) { return noticeMapper.selectNoticeById(noticeId); } /** * 查询公告列表 * * @param notice 公告信息 * @return 公告集合 */ @Override public IPage<SysNotice> selectNoticeList(SysNotice notice, Page page) { return noticeMapper.selectNoticeList(notice, page); } /** * 新增公告 * * @param notice 公告信息 * @return 结果 */ @Override public int insertNotice(SysNotice notice) { return noticeMapper.insertNotice(notice); } /** * 修改公告 * * @param notice 公告信息 * @return 结果 */ @Override public int updateNotice(SysNotice notice) { return noticeMapper.updateNotice(notice); } /** * 删除公告对象 * * @param noticeId 公告ID * @return 结果 */ @Override public int deleteNoticeById(Long noticeId) { return noticeMapper.deleteNoticeById(noticeId); } /** * 批量删除公告信息 * * @param noticeIds 需要删除的公告ID * @return 结果 */ @Override public int deleteNoticeByIds(Long[] noticeIds) { return noticeMapper.deleteNoticeByIds(noticeIds); } @Override public Long getCount(Long consigneeId) { return noticeMapper.selectCount(Wrappers.<SysNotice>lambdaQuery() .eq(SysNotice::getStatus, "0") .eq(SysNotice::getConsigneeId, consigneeId)); } @Override public int readAll() { Long userId = SecurityUtils.getUserId(); return noticeMapper.update(null, Wrappers.<SysNotice>lambdaUpdate() .eq(SysNotice::getConsigneeId, userId) .eq(SysNotice::getStatus, "0") .set(SysNotice::getStatus, "1")); } @Override public void simpleNoticeByUser(String title, String message, List<Long> consigneeId, String jumpPath) { Long userId = SecurityUtils.getLoginUser().getUserId(); Long tenantId = SecurityUtils.getLoginUser().getTenantId(); List<SysNotice> sysNotices = consigneeId.stream() .map(it -> convertSysNotice(title, message, it, tenantId, jumpPath, unipushService.convertWebPathToAppPath(jumpPath), userId)) .collect(Collectors.toList()); sysNoticeService.saveBatch(sysNotices); try { unipushService.sendClientMessage(sysNotices); } catch (Exception e) { log.error("APP推送通知失败,原因: {}", e); } } @Override public void simpleNoticeAll(String title, String message, String jumpPath) { Long userId = SecurityUtils.getLoginUser().getUserId(); if (userId == null) { return; } Long rootDeptId = SecurityUtils.getLoginUser().getTenantId(); // 查所有子部门 List<SysDept> childrenDepts = deptMapper.selectChildrenDeptById(rootDeptId); // 组装 deptIds List<Long> deptIds = childrenDepts.stream() .map(SysDept::getDeptId) .collect(Collectors.toList()); deptIds.add(rootDeptId); // 查用户ID List<Long> userIds = userDeptMapper.selectList( Wrappers.<SysUserDept>lambdaQuery() .in(SysUserDept::getDeptId, deptIds) ).stream() .map(SysUserDept::getUserId) .distinct() .collect(Collectors.toList()); if (userIds.isEmpty()) { return; } // 查用户 List<SysUser> sysUsers = userMapper.selectList( Wrappers.<SysUser>lambdaQuery() .eq(SysUser::getStatus, "0") .in(SysUser::getUserId, userIds) ); // 发通知 List<SysNotice> collect = sysUsers.stream() .map(it -> convertSysNotice( title, message, it.getUserId(), it.getTenantId(), jumpPath, unipushService.convertWebPathToAppPath(jumpPath), userId )) .collect(Collectors.toList()); sysNoticeService.saveBatch(collect); try { unipushService.sendClientMessage(collect); } catch (Exception e) { log.error("APP推送通知失败,原因: {}", e); } } private SysNotice convertSysNotice(String title,String message,Long consigneeId, Long tenantId,String jumpPath,String appJumpPath,Long currentUserId) { SysNotice sysNotice = new SysNotice(); sysNotice.setNoticeType("1"); sysNotice.setNoticeTitle(title);//标题 sysNotice.setNoticeContent(message); sysNotice.setStatus("0"); sysNotice.setConsigneeId(consigneeId); sysNotice.setSenderId(currentUserId); sysNotice.setJumpPath(jumpPath); sysNotice.setAppJumpPath(appJumpPath); sysNotice.setTenantId(tenantId); return sysNotice; } @Override @Transactional(rollbackFor = Exception.class) public boolean appReadNotice(Long noticeId) { if (noticeId == null) { return false; } SysNotice sysNotice = noticeMapper.selectNoticeById(noticeId); if (sysNotice == null) { return false; } sysNotice.setStatus("1"); return noticeMapper.update(null, Wrappers.<SysNotice>lambdaUpdate() .eq(SysNotice::getNoticeId, noticeId) .eq(SysNotice::getStatus, "0") .set(SysNotice::getStatus, "1")) > 0; } } src/main/java/com/ruoyi/sales/controller/BusinessOpportunityController.java
@@ -9,6 +9,8 @@ import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.project.system.domain.SysNotice; import com.ruoyi.project.system.mapper.SysNoticeMapper; import com.ruoyi.project.system.service.impl.SysNoticeServiceImpl; import com.ruoyi.project.system.service.impl.UnipushService; import com.ruoyi.sales.mapper.BusinessDescriptionMapper; import com.ruoyi.sales.pojo.BusinessDescription; @@ -46,6 +48,9 @@ @Autowired private UnipushService unipushService; @Autowired private SysNoticeMapper sysNoticeMapper; @ApiOperation("获取省级列表") @GetMapping("/getProvinceList") @@ -91,8 +96,10 @@ sysNotice.setNoticeType("1"); sysNotice.setStatus("0"); sysNotice.setSenderId(SecurityUtils.getUserId()); sysNotice.setConsigneeId(SecurityUtils.getUserId()); sysNotice.setConsigneeId(105L); sysNotice.setAppJumpPath("pages/opportunityManagement/index"); sysNoticeMapper.insert(sysNotice); sysNoticeList.add(sysNotice); unipushService.sendClientMessage(sysNoticeList); return businessDescriptionMapper.insert(businessDescription) > 0 ? success() : error(); } @@ -116,8 +123,10 @@ sysNotice.setNoticeType("1"); sysNotice.setStatus("0"); sysNotice.setSenderId(SecurityUtils.getUserId()); sysNotice.setConsigneeId(SecurityUtils.getUserId()); sysNotice.setConsigneeId(105L); sysNotice.setAppJumpPath("pages/opportunityManagement/index"); sysNoticeMapper.insert(sysNotice); sysNoticeList.add(sysNotice); unipushService.sendClientMessage(sysNoticeList); } return businessDescriptionMapper.insert(businessDescription) > 0 ? success() : error(); src/main/resources/application-dev.yml
@@ -16,12 +16,12 @@ # 个推 Unipush 配置 getui: appId: PfjyAAE0FK64FaO1w2CMb1 appKey: zTMb831OEL6J4GK1uE3Ob4 masterSecret: K1GFtsv42v61tXGnF7SGE5 appId: Dtk2FRh0ps6art6PMXgPf2 appKey: tLzzJZ7VRi5S6zP2kQ0aG8 masterSecret: EDt5Px5cbc6QflUdwQbN92 domain: https://restapi.getui.cn/v2/ # 离线推送使用的包名/组件名 intentComponent: uni.app.UNI099A590/io.dcloud.PandoraEntry intentComponent: uni.app.UNI870C454/io.dcloud.PandoraEntry # 开发环境配置 server: src/main/resources/application-prod.yml
@@ -16,12 +16,12 @@ # 个推 Unipush 配置 getui: appId: PfjyAAE0FK64FaO1w2CMb1 appKey: zTMb831OEL6J4GK1uE3Ob4 masterSecret: K1GFtsv42v61tXGnF7SGE5 appId: Dtk2FRh0ps6art6PMXgPf2 appKey: tLzzJZ7VRi5S6zP2kQ0aG8 masterSecret: EDt5Px5cbc6QflUdwQbN92 domain: https://restapi.getui.cn/v2/ # 离线推送使用的包名/组件名 intentComponent: uni.app.UNI099A590/io.dcloud.PandoraEntry intentComponent: uni.app.UNI870C454/io.dcloud.PandoraEntry # 开发环境配置 server: src/main/resources/mapper/system/SysNoticeMapper.xml
@@ -1,9 +1,9 @@ <?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"> PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ruoyi.project.system.mapper.SysNoticeMapper"> <resultMap type="com.ruoyi.project.system.domain.SysNotice" id="SysNoticeResult"> <result property="noticeId" column="notice_id" /> <result property="noticeTitle" column="notice_title" /> @@ -16,74 +16,109 @@ <result property="updateTime" column="update_time" /> <result property="remark" column="remark" /> </resultMap> <sql id="selectNoticeVo"> select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark from sys_notice select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark, sender_id, consignee_id, jump_path, app_jump_path, tenant_id from sys_notice </sql> <select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult"> <include refid="selectNoticeVo"/> where notice_id = #{noticeId} </select> <select id="selectNoticeList" parameterType="com.ruoyi.project.system.domain.SysNotice" resultMap="SysNoticeResult"> <include refid="selectNoticeVo"/> <where> <if test="noticeTitle != null and noticeTitle != ''"> AND notice_title like concat('%', #{noticeTitle}, '%') </if> <if test="noticeType != null and noticeType != ''"> AND notice_type = #{noticeType} </if> <if test="createBy != null and createBy != ''"> AND create_by like concat('%', #{createBy}, '%') </if> </where> <if test="c.noticeTitle != null and c.noticeTitle != ''"> AND notice_title like concat('%', #{c.noticeTitle}, '%') </if> <if test="c.noticeType != null and c.noticeType != ''"> AND notice_type = #{c.noticeType} </if> <if test="c.createBy != null and c.createBy != ''"> AND create_by like concat('%', #{c.createBy}, '%') </if> <if test="c.senderId != null and c.senderId != ''"> AND sender_id = #{c.senderId} </if> <if test="c.consigneeId != null and c.consigneeId != ''"> AND consignee_id = #{c.consigneeId} </if> <if test="c.status != null and c.status != ''"> AND status = #{c.status} </if> </where> order by create_time desc </select> <insert id="insertNotice" parameterType="com.ruoyi.project.system.domain.SysNotice"> insert into sys_notice ( <if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if> <if test="noticeType != null and noticeType != '' ">notice_type, </if> <if test="noticeContent != null and noticeContent != '' ">notice_content, </if> <if test="status != null and status != '' ">status, </if> <if test="remark != null and remark != ''">remark,</if> <if test="createBy != null and createBy != ''">create_by,</if> create_time )values( <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if> <if test="noticeType != null and noticeType != ''">#{noticeType}, </if> <if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if> <if test="status != null and status != ''">#{status}, </if> <if test="remark != null and remark != ''">#{remark},</if> <if test="createBy != null and createBy != ''">#{createBy},</if> sysdate() ) <if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if> <if test="noticeType != null and noticeType != '' ">notice_type, </if> <if test="noticeContent != null and noticeContent != '' ">notice_content, </if> <if test="status != null and status != '' ">status, </if> <if test="remark != null and remark != ''">remark,</if> <if test="senderId != null and senderId != ''">sender_id,</if> <if test="consigneeId != null and consigneeId != ''">consignee_id,</if> <if test="jumpPath != null and jumpPath != ''">jump_path,</if> <if test="appJumpPath != null and appJumpPath != ''">app_jump_path,</if> <if test="createBy != null and createBy != ''">create_by,</if> <if test="tenantId != null and tenantId != ''">tenant_id,</if> create_time )values( <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if> <if test="noticeType != null and noticeType != ''">#{noticeType}, </if> <if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if> <if test="status != null and status != ''">#{status}, </if> <if test="remark != null and remark != ''">#{remark},</if> <if test="senderId != null and senderId != ''">#{senderId},</if> <if test="consigneeId != null and consigneeId != ''">#{consigneeId},</if> <if test="jumpPath != null and jumpPath != ''">#{jumpPath},</if> <if test="appJumpPath != null and appJumpPath != ''">#{appJumpPath},</if> <if test="pathParms != null and pathParms != ''">#{queryParms},</if> <if test="createBy != null and createBy != ''">#{createBy},</if> <if test="tenantId != null and tenantId != ''">#{tenantId},</if> sysdate() ) </insert> <update id="updateNotice" parameterType="com.ruoyi.project.system.domain.SysNotice"> update sys_notice update sys_notice <set> <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if> <if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if> <if test="noticeContent != null">notice_content = #{noticeContent}, </if> <if test="status != null and status != ''">status = #{status}, </if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> update_time = sysdate() update_time = sysdate() </set> where notice_id = #{noticeId} </update> <delete id="deleteNoticeById" parameterType="Long"> delete from sys_notice where notice_id = #{noticeId} </delete> <delete id="deleteNoticeByIds" parameterType="Long"> delete from sys_notice where notice_id in delete from sys_notice where notice_id in <foreach item="noticeId" collection="array" open="(" separator="," close=")"> #{noticeId} </foreach> </delete> </mapper> </mapper> src/main/resources/mapper/system/SysUserMapper.xml
@@ -188,7 +188,7 @@ #{item} </foreach> </select> <select id="selectList" resultType="com.ruoyi.project.system.domain.SysUser"> <select id="selectLists" resultType="com.ruoyi.project.system.domain.SysUser"> SELECT user_id, nick_name FROM sys_user <where> <if test="list != null and list.size() > 0">