|
@@ -54,18 +54,6 @@ public class PostNoticeServiceImpl implements IPostNoticeService
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-// /**
|
|
|
|
-// * 搜素
|
|
|
|
-// * @param title
|
|
|
|
-// * @param noticeTimeLeft
|
|
|
|
-// * @param noticeTimeRight
|
|
|
|
-// * @return
|
|
|
|
-// */
|
|
|
|
-// @Override
|
|
|
|
-// public List<PostNotice> selectPostNoticeListByTitleOrNoticeTime(String title, Date noticeTimeLeft, Date noticeTimeRight) {
|
|
|
|
-// return postNoticeMapper.selectPostNoticeListByTitleOrNoticeTime(title,noticeTimeLeft,noticeTimeRight);
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 搜索公告列表
|
|
* 搜索公告列表
|
|
* @param title
|
|
* @param title
|
|
@@ -79,6 +67,10 @@ public class PostNoticeServiceImpl implements IPostNoticeService
|
|
//标题不为空则判断时间
|
|
//标题不为空则判断时间
|
|
if (noticeTimeLeft != null && noticeTimeRight != null) {
|
|
if (noticeTimeLeft != null && noticeTimeRight != null) {
|
|
//时间不为空 ,且左时间在右时间之前
|
|
//时间不为空 ,且左时间在右时间之前
|
|
|
|
+ //确保查询到的公告为已发布的公告
|
|
|
|
+ if (DateUtils.getNowDate().before(noticeTimeRight)){
|
|
|
|
+ noticeTimeRight = DateUtils.getNowDate();
|
|
|
|
+ }
|
|
if( noticeTimeLeft.before(noticeTimeRight)) {
|
|
if( noticeTimeLeft.before(noticeTimeRight)) {
|
|
return postNoticeMapper.selectPostNoticeListByTitleOrNoticeTime(title, noticeTimeLeft, noticeTimeRight);
|
|
return postNoticeMapper.selectPostNoticeListByTitleOrNoticeTime(title, noticeTimeLeft, noticeTimeRight);
|
|
}else {
|
|
}else {
|
|
@@ -91,6 +83,10 @@ public class PostNoticeServiceImpl implements IPostNoticeService
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
//标题为空
|
|
//标题为空
|
|
|
|
+ //确保查询到的公告为已发布的公告
|
|
|
|
+ if (DateUtils.getNowDate().before(noticeTimeRight)){
|
|
|
|
+ noticeTimeRight = DateUtils.getNowDate();
|
|
|
|
+ }
|
|
if (noticeTimeLeft != null && noticeTimeRight != null) {
|
|
if (noticeTimeLeft != null && noticeTimeRight != null) {
|
|
//时间不为空 ,且左时间在右时间之前
|
|
//时间不为空 ,且左时间在右时间之前
|
|
if( noticeTimeLeft.before(noticeTimeRight)) {
|
|
if( noticeTimeLeft.before(noticeTimeRight)) {
|