| | |
| | | package com.ruoyi.project.system.controller;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.metadata.IPage;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.ruoyi.framework.web.domain.R;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | |
| | | /**
|
| | | * 获取通知公告列表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:notice:list')")
|
| | | @GetMapping("/list")
|
| | | public TableDataInfo list(SysNotice notice)
|
| | | public R<IPage<SysNotice>> list(SysNotice notice, Page page)
|
| | | {
|
| | | startPage();
|
| | | List<SysNotice> list = noticeService.selectNoticeList(notice);
|
| | | return getDataTable(list);
|
| | | IPage<SysNotice> list = noticeService.selectNoticeList(notice, page);
|
| | | return R.ok(list);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取未读数量
|
| | | */
|
| | | @GetMapping("/getCount")
|
| | | public R getCount(Long consigneeId)
|
| | | {
|
| | | return R.ok(noticeService.getCount(consigneeId));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 根据通知公告编号获取详细信息
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:notice:query')")
|
| | | @GetMapping(value = "/{noticeId}")
|
| | | public AjaxResult getInfo(@PathVariable Long 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));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 一键已读
|
| | | */
|
| | | @PostMapping("/readAll")
|
| | | public AjaxResult readAll()
|
| | | {
|
| | | return toAjax(noticeService.readAll());
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | import javax.validation.constraints.NotBlank;
|
| | | import javax.validation.constraints.Size;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.FieldFill;
|
| | | import com.baomidou.mybatisplus.annotation.TableField;
|
| | | import com.fasterxml.jackson.annotation.JsonFormat;
|
| | | import lombok.Data;
|
| | | import org.apache.commons.lang3.builder.ToStringBuilder;
|
| | | import org.apache.commons.lang3.builder.ToStringStyle;
|
| | | import com.ruoyi.common.xss.Xss;
|
| | | import com.ruoyi.framework.web.domain.BaseEntity;
|
| | |
|
| | | import java.time.LocalDateTime;
|
| | |
|
| | | /**
|
| | | * 通知公告表 sys_notice
|
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | public class SysNotice extends BaseEntity
|
| | | @Data
|
| | | public class SysNotice
|
| | | {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | |
| | | /** 公告状态(0正常 1关闭) */
|
| | | private String status;
|
| | |
|
| | | public Long getNoticeId()
|
| | | {
|
| | | return noticeId;
|
| | | }
|
| | | /** 发送人id */
|
| | | private Long senderId;
|
| | |
|
| | | public void setNoticeId(Long noticeId)
|
| | | {
|
| | | this.noticeId = noticeId;
|
| | | }
|
| | | /** 收件人id */
|
| | | private Long consigneeId;
|
| | |
|
| | | public void setNoticeTitle(String noticeTitle)
|
| | | {
|
| | | this.noticeTitle = noticeTitle;
|
| | | }
|
| | | /** 跳转路径 */
|
| | | private String jumpPath;
|
| | |
|
| | | @Xss(message = "公告标题不能包含脚本字符")
|
| | | @NotBlank(message = "公告标题不能为空")
|
| | | @Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
|
| | | public String getNoticeTitle()
|
| | | {
|
| | | return noticeTitle;
|
| | | }
|
| | | /** 创建者 */
|
| | | @TableField(fill = FieldFill.INSERT)
|
| | | private String createBy;
|
| | |
|
| | | public void setNoticeType(String noticeType)
|
| | | {
|
| | | this.noticeType = noticeType;
|
| | | }
|
| | | /** 创建时间 */
|
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
| | | @TableField(fill = FieldFill.INSERT)
|
| | | private LocalDateTime createTime;
|
| | |
|
| | | public String getNoticeType()
|
| | | {
|
| | | return noticeType;
|
| | | }
|
| | | /** 更新者 */
|
| | | @TableField(fill = FieldFill.INSERT_UPDATE)
|
| | | private String updateBy;
|
| | |
|
| | | public void setNoticeContent(String noticeContent)
|
| | | {
|
| | | this.noticeContent = noticeContent;
|
| | | }
|
| | | /** 更新时间 */
|
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
| | | @TableField(fill = FieldFill.INSERT_UPDATE)
|
| | | private LocalDateTime updateTime;
|
| | |
|
| | | public String getNoticeContent()
|
| | | {
|
| | | return noticeContent;
|
| | | }
|
| | | /** 备注 */
|
| | | private String remark;
|
| | |
|
| | | public void setStatus(String status)
|
| | | {
|
| | | this.status = status;
|
| | | }
|
| | | /**
|
| | | * 租户id
|
| | | */
|
| | | private Long tenantId;
|
| | |
|
| | | public String getStatus()
|
| | | {
|
| | | return status;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String toString() {
|
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
| | | .append("noticeId", getNoticeId())
|
| | | .append("noticeTitle", getNoticeTitle())
|
| | | .append("noticeType", getNoticeType())
|
| | | .append("noticeContent", getNoticeContent())
|
| | | .append("status", getStatus())
|
| | | .append("createBy", getCreateBy())
|
| | | .append("createTime", getCreateTime())
|
| | | .append("updateBy", getUpdateBy())
|
| | | .append("updateTime", getUpdateTime())
|
| | | .append("remark", getRemark())
|
| | | .toString();
|
| | | }
|
| | | }
|
| | |
| | | package com.ruoyi.project.system.mapper;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | 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
|
| | | */
|
| | | public interface SysNoticeMapper
|
| | | @Mapper
|
| | | public interface SysNoticeMapper extends BaseMapper<SysNotice>
|
| | | {
|
| | | /**
|
| | | * 查询公告信息
|
| | |
| | | * @param notice 公告信息
|
| | | * @return 公告集合
|
| | | */
|
| | | public List<SysNotice> selectNoticeList(SysNotice notice);
|
| | | public IPage<SysNotice> selectNoticeList(@Param("c") SysNotice notice, Page page);
|
| | |
|
| | | /**
|
| | | * 新增公告
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import org.apache.ibatis.annotations.Mapper;
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.ruoyi.project.system.domain.SysUser;
|
| | |
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | @Mapper
|
| | | public interface SysUserMapper
|
| | | {
|
| | | /**
|
| | |
| | | List<SysUser> selectList(List<Long> registrantIds);
|
| | |
|
| | | List<SysUser> selectUsersByIds(@Param("userIds") List<Long> userIds);
|
| | |
|
| | | List<Long> getUserByRole(@Param("role") String role);
|
| | |
|
| | | List<Long> getUserByPerms(@Param("perms") List<String> perms);
|
| | | }
|
| | |
| | | package com.ruoyi.project.system.service;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | 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;
|
| | |
|
| | | /**
|
| | |
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | public interface ISysNoticeService
|
| | | public interface ISysNoticeService extends IService<SysNotice>
|
| | | {
|
| | | /**
|
| | | * 查询公告信息
|
| | |
| | | * @param notice 公告信息
|
| | | * @return 公告集合
|
| | | */
|
| | | public List<SysNotice> selectNoticeList(SysNotice notice);
|
| | | public IPage<SysNotice> selectNoticeList(SysNotice notice, Page page);
|
| | |
|
| | | /**
|
| | | * 新增公告
|
| | |
| | | * @return 结果
|
| | | */
|
| | | public int deleteNoticeByIds(Long[] noticeIds);
|
| | |
|
| | | Long getCount(Long consigneeId);
|
| | |
|
| | | int readAll();
|
| | |
|
| | | /**
|
| | | * 通过角色 发送提醒
|
| | | * @param title 标题
|
| | | * @param message 内容
|
| | | * @param needPushRoles 发送的角色
|
| | | * @param jumpPath 跳转地址
|
| | | */
|
| | | void simpleNoticeByRoles(final String title, final String message, final List<String> needPushRoles,
|
| | | final String jumpPath);
|
| | |
|
| | | /**
|
| | | * 通过权限 发送提醒
|
| | | * @param title 标题
|
| | | * @param message 消息
|
| | | * @param needPerms 发送的权限者 已包含上级
|
| | | * @param jumpPath 跳转地址
|
| | | */
|
| | | void simpleNoticeByPerms(final String title, final String message, final List<String> needPerms,
|
| | | final String jumpPath);
|
| | |
|
| | | /**
|
| | | * 通过指定人发送提醒
|
| | | * @param title 标题
|
| | | * @param message 消息
|
| | | * @param jumpPath 跳转地址
|
| | | */
|
| | | void simpleNoticeByUser(final String title, final String message, Long consigneeId,
|
| | | final String jumpPath);
|
| | |
|
| | | /**
|
| | | * 通过所有人 发送提醒
|
| | | * @param title 标题
|
| | | * @param message 消息
|
| | | * @param jumpPath 跳转地址
|
| | | */
|
| | | void simpleNoticeAll(final String title, final String message, final String jumpPath);
|
| | |
|
| | | void insertBatch(final List<SysNotice> notices);
|
| | | }
|
| | |
| | | package com.ruoyi.project.system.service.impl;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Objects;
|
| | | import java.util.stream.Collectors;
|
| | | import com.baomidou.mybatisplus.core.metadata.IPage;
|
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
| | | 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.github.xiaoymin.knife4j.core.util.StrUtil;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.project.system.mapper.SysUserMapper;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.context.annotation.Lazy;
|
| | | import org.springframework.stereotype.Service;
|
| | | import com.ruoyi.project.system.domain.SysNotice;
|
| | | import com.ruoyi.project.system.mapper.SysNoticeMapper;
|
| | |
| | | * @author ruoyi
|
| | | */
|
| | | @Service
|
| | | public class SysNoticeServiceImpl implements ISysNoticeService
|
| | | {
|
| | | public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements ISysNoticeService {
|
| | |
|
| | | @Autowired
|
| | | private SysNoticeMapper noticeMapper;
|
| | |
|
| | | @Autowired
|
| | | private SysUserMapper userMapper;
|
| | |
|
| | | @Autowired
|
| | | @Lazy
|
| | | private ISysNoticeService sysNoticeService;
|
| | |
|
| | | /**
|
| | | * 查询公告信息
|
| | |
| | | * @return 公告集合
|
| | | */
|
| | | @Override
|
| | | public List<SysNotice> selectNoticeList(SysNotice notice)
|
| | | {
|
| | | return noticeMapper.selectNoticeList(notice);
|
| | | public IPage<SysNotice> selectNoticeList(SysNotice notice, Page page) {
|
| | | return noticeMapper.selectNoticeList(notice, page);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | {
|
| | | 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 simpleNoticeByRoles(final String title, String message, List<String> needPushRoles,
|
| | | final String jumpPath) {
|
| | | Long userId = SecurityUtils.getUserId();
|
| | | if (StrUtil.isBlank(message) || CollectionUtils.isEmpty(needPushRoles)) {
|
| | | return;
|
| | | }
|
| | | List<String> rolesWithAdmin = new ArrayList<>(needPushRoles);
|
| | | rolesWithAdmin.add("管理员");
|
| | | List<SysNotice> collect = rolesWithAdmin.stream()
|
| | | .flatMap(it -> userMapper.getUserByRole(it).stream())
|
| | | .map(it -> convertSysNotice(title, message, it, jumpPath, userId))
|
| | | .collect(Collectors.toList());
|
| | | sysNoticeService.insertBatch(collect);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void simpleNoticeByPerms(String title, String message, List<String> needPerms,
|
| | | String jumpPath) {
|
| | | Long userId = SecurityUtils.getLoginUser().getUserId();
|
| | | if (StrUtil.isBlank(message) || CollectionUtils.isEmpty(needPerms)) {
|
| | | return;
|
| | | }
|
| | | List<SysNotice> collect = userMapper.getUserByPerms(needPerms).stream().map(it -> convertSysNotice(title, message, it, jumpPath, userId)).collect(Collectors.toList());
|
| | | sysNoticeService.insertBatch(collect);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void simpleNoticeByUser(String title, String message, Long consigneeId,
|
| | | String jumpPath) {
|
| | | Long userId = SecurityUtils.getLoginUser().getUserId();
|
| | | SysNotice sysNotice = convertSysNotice(title, message, consigneeId, jumpPath, userId);
|
| | | sysNoticeService.save(sysNotice);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void simpleNoticeAll(String title, String message, String jumpPath) {
|
| | | Long userId = SecurityUtils.getLoginUser().getUserId();
|
| | | List<SysNotice> collect = userMapper.selectList(null).stream().map(it -> convertSysNotice(title, message, it.getUserId(), jumpPath, userId)).collect(Collectors.toList());
|
| | | sysNoticeService.saveBatch(collect);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void insertBatch(List<SysNotice> noticesList) {
|
| | | if(CollectionUtils.isEmpty(noticesList)){
|
| | | return;
|
| | | }
|
| | | // 排除掉自己
|
| | | Long userId = SecurityUtils.getUserId();
|
| | | List<SysNotice> noticesListNew = noticesList.stream().filter(Objects::nonNull).filter(it -> !Objects.equals(it.getConsigneeId(), userId)).collect(Collectors.toList());
|
| | | sysNoticeService.saveBatch(noticesListNew);
|
| | |
|
| | | }
|
| | |
|
| | | private SysNotice convertSysNotice(String title,String message,Long consigneeId,String jumpPath,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);
|
| | | return sysNotice;
|
| | | }
|
| | | }
|
| | |
| | | </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 |
| | | 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, |
| | | tenant_id |
| | | from sys_notice |
| | | </sql> |
| | | |
| | |
| | | <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 test="c.noticeTitle != null and c.noticeTitle != ''"> |
| | | AND notice_title like concat('%', #{c.noticeTitle}, '%') |
| | | </if> |
| | | <if test="noticeType != null and noticeType != ''"> |
| | | AND notice_type = #{noticeType} |
| | | <if test="c.noticeType != null and c.noticeType != ''"> |
| | | AND notice_type = #{c.noticeType} |
| | | </if> |
| | | <if test="createBy != null and createBy != ''"> |
| | | AND create_by like concat('%', #{createBy}, '%') |
| | | <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"> |
| | |
| | | <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="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="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="pathParms != null and pathParms != ''">#{queryParms},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="tenantId != null and tenantId != ''">#{tenantId},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="getUserByRole" resultType="java.lang.Long"> |
| | | select distinct su.user_id |
| | | from sys_user su |
| | | left join sys_user_role sur on su.user_id = sur.user_id |
| | | left join sys_role sr on sur.role_id = sr.role_id |
| | | where role_name like concat('%', #{role}, '%') |
| | | and sr.del_flag = '0' |
| | | and sr.status = '0' |
| | | and su.status = '0' |
| | | and su.del_flag = '0' |
| | | </select> |
| | | <select id="getUserByPerms" resultType="java.lang.Long"> |
| | | select distinct t5.user_id |
| | | from sys_role_menu t1 |
| | | left join sys_menu t2 on t1.menu_id = t2.menu_id |
| | | left join sys_role t3 on t1.role_id = t3.role_id |
| | | inner join sys_user_role t4 on t4.role_id = t3.role_id |
| | | inner join sys_user t5 on t5.user_id = t4.user_id |
| | | where t3.del_flag = '0' |
| | | and t2.perms is not null |
| | | and t2.perms <> '' |
| | | and t5.del_flag = '0' |
| | | and t5.status = '0' |
| | | and t3.status = '0' |
| | | <if test="perms != null and perms.size() > 0"> |
| | | AND ( |
| | | <foreach collection="perms" item="p" separator=" OR "> |
| | | t2.perms = #{p} |
| | | OR t2.perms = (split_part(#{p}, ':', 1) || ':' || split_part(#{p}, ':', 2) || ':*') |
| | | OR t2.perms = (split_part(#{p}, ':', 1) || ':*:*') |
| | | </foreach> |
| | | OR t2.perms = '*:*:*' |
| | | ) |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |