|
@ -73,6 +73,24 @@ public class UserNoticeService extends BaseJpaService<UserNoticeDO, UserNoticeDa
|
|
|
return PageEnvelop.getSuccessListWithPage("查找成功",list, page, size,count);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查找该用户是否存在未读公告
|
|
|
* @param userId
|
|
|
* @return
|
|
|
*/
|
|
|
public Long countUnReadNotice(String userId){
|
|
|
StringBuffer sqlCount = new StringBuffer("SELECT COUNT(*) count from base_notice n , base_user_notice u WHERE n.del = '1' ");
|
|
|
List<Object> args = new ArrayList<>();
|
|
|
if(StringUtils.isNotBlank(userId)){
|
|
|
sqlCount.append(" and u.user_id='").append(userId).append("' ");
|
|
|
args.add(userId);
|
|
|
}
|
|
|
sqlCount.append(" and u.notice_id = n.id and u.del = '1'");
|
|
|
List<Map<String,Object>> countList = jdbcTempalte.queryForList(sqlCount.toString());
|
|
|
long count = Long.valueOf(countList.get(0).get("count").toString());
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|