|
@@ -10,14 +10,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
@@ -53,42 +46,16 @@ public class PostNoticeController extends BaseController
|
|
|
List<PostNotice> list = postNoticeService.selectPostNoticeList(postNotice);
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
- /*@ApiOperation("搜索公告")
|
|
|
- @PreAuthorize("@ss.hasPermi('system:notice:queryNotice')")
|
|
|
- @GetMapping("/queryNotice")
|
|
|
- public AjaxResult queryByTitleOrTime(String noticeTitle, Date noticeTimeLeft,Date noticeTimeRight){
|
|
|
- if(noticeTitle!=null){
|
|
|
- if(noticeTimeLeft!=null&¬iceTimeRight!=null) {
|
|
|
- List<PostNotice> list = postNoticeService.selectPostNoticeListByTitleOrNoticeTime(noticeTitle, noticeTimeLeft,noticeTimeRight);
|
|
|
- return success(list);
|
|
|
- }
|
|
|
- return error("请输入完整时间范围");
|
|
|
- }
|
|
|
- return error("未找到相应数据");
|
|
|
- }*/
|
|
|
|
|
|
@ApiOperation("搜索公告列表")
|
|
|
@PreAuthorize("@ss.hasPermi('system:notice:queryNotice')")
|
|
|
@GetMapping("/queryNotice")
|
|
|
- public TableDataInfo list(PostNotice postNotice, String title, Date noticeTimeLeft, Date noticeTimeRight)
|
|
|
+ public TableDataInfo list(@RequestParam(value="title",required = false)String title,
|
|
|
+ @RequestParam(value="noticeTimeLeft",required = false) Date noticeTimeLeft,
|
|
|
+ @RequestParam(value="noticeTimeRight",required = false) Date noticeTimeRight)
|
|
|
{
|
|
|
startPage();
|
|
|
- List<PostNotice> list=null;
|
|
|
- if(title!=null){
|
|
|
- //标题不为空则判断时间
|
|
|
- if(noticeTimeLeft!=null&¬iceTimeRight!=null&¬iceTimeLeft.before(noticeTimeRight)) {
|
|
|
- //时间不为空
|
|
|
- list = postNoticeService.selectPostNoticeListByTitleOrNoticeTime(title, noticeTimeLeft,noticeTimeRight);
|
|
|
- }
|
|
|
- }else{
|
|
|
- //标题为空
|
|
|
- if(noticeTimeLeft!=null&¬iceTimeRight!=null&¬iceTimeLeft.before(noticeTimeRight)) {
|
|
|
- //时间不为空
|
|
|
- //list = postNoticeService.selectPostNoticeListOnlyByTitleOrNoticeTime(noticeTimeLeft,noticeTimeRight);
|
|
|
- }else {
|
|
|
- list = postNoticeService.selectPostNoticeList(postNotice);
|
|
|
- }
|
|
|
- }
|
|
|
+ List<PostNotice> list= postNoticeService.selectList(title,noticeTimeLeft,noticeTimeRight);
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
@@ -163,4 +130,6 @@ public class PostNoticeController extends BaseController
|
|
|
{
|
|
|
return toAjax(postNoticeService.deletePostNoticeByNoticeIds(noticeIds));
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|