Commit 0073cb7c by 梅存智

我的信箱问题修复

parent 02eb2a54
...@@ -15,8 +15,8 @@ import java.util.List; ...@@ -15,8 +15,8 @@ import java.util.List;
*/ */
public interface SystemMailboxMapper extends BaseMapper<SystemMailbox> { public interface SystemMailboxMapper extends BaseMapper<SystemMailbox> {
List<SystemMailboxParamVo> selectMyPage(@Param("accountId") Long accountId, @Param("pageNo") Integer pageNo,@Param("pageSize") Integer pageSize); List<SystemMailboxParamVo> selectMyPage(@Param("accountId") Long accountId, @Param("type") Integer type, @Param("pageNo") Integer pageNo,@Param("pageSize") Integer pageSize);
int selectMyCount(@Param("accountId") Long accountId); int selectMyCount(@Param("accountId") Long accountId, @Param("type") Integer type);
} }
...@@ -150,9 +150,20 @@ public class SystemMailboxServiceImpl extends ServiceImpl<SystemMailboxMapper,Sy ...@@ -150,9 +150,20 @@ public class SystemMailboxServiceImpl extends ServiceImpl<SystemMailboxMapper,Sy
public Page<SystemMailboxParamVo> selectMyPage(Integer pageNo,Integer pageSize){ public Page<SystemMailboxParamVo> selectMyPage(Integer pageNo,Integer pageSize){
pageNo = pageSize * (pageNo - 1); pageNo = pageSize * (pageNo - 1);
Long accountId = ContextHolder.get().getAccountId(); Long accountId = ContextHolder.get().getAccountId();
List<Long> roleIds = myItemConfigmapper.getJjXxRoleCount(accountId);
Integer type = null;//信箱类型 1: 纪检 2: 书记,null没权限看 纪检和书记,只能看自己的
if(CollectionUtil.isNotEmpty(roleIds)){
if(roleIds.contains(1877604582759526400L)&&!roleIds.contains(1877605828904022016L)){
type = 2;
}
if(!roleIds.contains(1877604582759526400L)&&roleIds.contains(1877605828904022016L)){
type = 1;
}
}
Page<SystemMailboxParamVo> page = new Page<>(pageNo,pageSize); Page<SystemMailboxParamVo> page = new Page<>(pageNo,pageSize);
page.setTotal(this.baseMapper.selectMyCount(accountId)); page.setTotal(this.baseMapper.selectMyCount(accountId, type));
page.setRecords(this.baseMapper.selectMyPage(accountId,pageNo,pageSize)); page.setRecords(this.baseMapper.selectMyPage(accountId, type, pageNo, pageSize));
return page; return page;
} }
} }
...@@ -18,7 +18,12 @@ ...@@ -18,7 +18,12 @@
system_mailbox system_mailbox
where where
deleted = 0 deleted = 0
<if test="type != null">
and type=#{type}
</if>
<if test="type == null">
and create_by_id = #{accountId} and create_by_id = #{accountId}
</if>
union all union all
select select
id, id,
...@@ -47,7 +52,12 @@ ...@@ -47,7 +52,12 @@
system_mailbox system_mailbox
where where
deleted = 0 deleted = 0
<if test="type != null">
and type=#{type}
</if>
<if test="type == null">
and create_by_id = #{accountId} and create_by_id = #{accountId}
</if>
union all union all
select select
id, id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment