Commit 81994787 by wangxin

小e信箱

parent c27f1db2
......@@ -45,4 +45,8 @@ public interface SystemMailboxClients {
*/
@GetMapping("/systemMailbox/selectMailboxManagementForScroll")
List<SystemMailboxParamVo> selectMailboxManagementForScroll();
@GetMapping("/systemMailbox/selectMyPageNoView")
Page<SystemMailboxParamVo> selectMyPageNoView(@RequestParam("pageNo")Integer pageNo, @RequestParam("pageSize")Integer pageSize, @RequestParam("type")Integer type);
}
\ No newline at end of file
......@@ -48,6 +48,10 @@ public class SystemMailboxController {
public Page<SystemMailboxParamVo> selectMyPage(@RequestParam("pageNo")Integer pageNo, @RequestParam("pageSize")Integer pageSize, @RequestParam("type")Integer type){
return systemMailboxService.selectMyPage(pageNo,pageSize, type);
}
@GetMapping("selectMyPageNoView")
public Page<SystemMailboxParamVo> selectMyPageNoView(@RequestParam("pageNo")Integer pageNo, @RequestParam("pageSize")Integer pageSize, @RequestParam("type")Integer type){
return systemMailboxService.selectMyPageNoView(pageNo,pageSize, type);
}
@GetMapping("hasPermission")
public Boolean hasPermission(){
......
......@@ -25,4 +25,9 @@ public interface SystemMailboxMapper extends BaseMapper<SystemMailbox> {
* @return
*/
List<SystemMailboxParamVo> selectMailboxManagementForScroll(@Param("accountId") Long accountId, @Param("roleType") Integer roleType);
List<SystemMailboxParamVo> selectMyPageNoView(@Param("accountId") Long accountId, @Param("roleType") Integer roleType, @Param("type") Integer type, @Param("pageNo") Integer pageNo,@Param("pageSize") Integer pageSize);
int selectMyCountNoView(@Param("accountId") Long accountId, @Param("roleType") Integer roleType, @Param("type") Integer type);
}
......@@ -34,4 +34,6 @@ public interface SystemMailboxService extends IService<SystemMailbox> {
* @return
*/
List<SystemMailboxParamVo> selectMailboxManagementForScroll();
Page<SystemMailboxParamVo> selectMyPageNoView(Integer pageNo, Integer pageSize, Integer type);
}
\ No newline at end of file
......@@ -177,6 +177,26 @@ public class SystemMailboxServiceImpl extends ServiceImpl<SystemMailboxMapper,Sy
page.setRecords(this.baseMapper.selectMyPage(accountId, roleType, type, pageNo, pageSize));
return page;
}
@Override
public Page<SystemMailboxParamVo> selectMyPageNoView(Integer pageNo,Integer pageSize, Integer type){
pageNo = pageSize * (pageNo - 1);
Long accountId = ContextHolder.get().getAccountId();
List<Long> roleIds = myItemConfigmapper.getJjXxRoleCount(accountId);
Integer roleType = null;//信箱类型 1: 纪检 2: 书记,null没权限看 纪检和书记,只能看自己的
if(CollectionUtil.isNotEmpty(roleIds)){
if(roleIds.contains(1877604582759526400L)&&!roleIds.contains(1877605828904022016L)){
roleType = 2;
}
if(!roleIds.contains(1877604582759526400L)&&roleIds.contains(1877605828904022016L)){
roleType = 1;
}
}
Page<SystemMailboxParamVo> page = new Page<>(pageNo,pageSize);
page.setTotal(this.baseMapper.selectMyCountNoView(accountId, roleType, type));
page.setRecords(this.baseMapper.selectMyPageNoView(accountId, roleType, type, pageNo, pageSize));
return page;
}
@Override
public Boolean hasPermission() {
......
......@@ -85,6 +85,90 @@
</if>
) a
</select>
<select id="selectMyPageNoView" resultType="com.yizhi.site.application.vo.domain.SystemMailboxParamVo">
select
id,
file_name ,
submit_time ,
`type`
from
(
select
id,
file_name,
submit_time ,
`type`
from
system_mailbox
where
deleted = 0 and is_viewed = 0
<if test="type == 2">
<if test="roleType != null">
and type=#{roleType} and create_by_id != #{accountId}
</if>
<if test="roleType == null">
and create_by_id = #{accountId}
</if>
</if>
<if test="type == 1">
and create_by_id = #{accountId}
</if>
<if test="type == 1">
union all
select
id,
name as file_name,
create_time as submit_time,
3 as `type`
from
cloud_trainning_project.leave_word
where
deleted = 0
and create_by_id = #{accountId}
</if>
) a
order by a.submit_time desc
LIMIT #{pageNo}, #{pageSize}
</select>
<select id="selectMyCountNoView" resultType="java.lang.Integer">
select count(1)
from
(
select
id,
file_name,
submit_time ,
`type`
from
system_mailbox
where
deleted = 0 and is_viewed = 0
<if test="type == 2">
<if test="roleType != null">
and type=#{roleType} and create_by_id != #{accountId}
</if>
<if test="roleType == null">
and create_by_id = #{accountId}
</if>
</if>
<if test="type == 1">
and create_by_id = #{accountId}
</if>
<if test="type == 1">
union all
select
id,
name as file_name,
create_time as submit_time,
3 as `type`
from
cloud_trainning_project.leave_word
where
deleted = 0
and create_by_id = #{accountId}
</if>
) a
</select>
<!-- 滚动提示接口:信箱管理(4天内创建且未查看的数据) -->
<select id="selectMailboxManagementForScroll" resultType="com.yizhi.site.application.vo.domain.SystemMailboxParamVo">
......
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