征求意见排序!!
This commit is contained in:
+2
-2
@@ -39,7 +39,7 @@ public class SarPublicIdeaController extends BaseController<SarPublicIdea> {
|
|||||||
@ApiOperation(value = "分页查询")
|
@ApiOperation(value = "分页查询")
|
||||||
@GetMapping("/SelectAllPage")
|
@GetMapping("/SelectAllPage")
|
||||||
public ResponseMessage selectAllPage(@RequestParam(defaultValue="1")Integer page,@RequestParam(defaultValue="10")Integer size,String categorg, String cname,
|
public ResponseMessage selectAllPage(@RequestParam(defaultValue="1")Integer page,@RequestParam(defaultValue="10")Integer size,String categorg, String cname,
|
||||||
String start, String end){
|
String start, String end,String type){
|
||||||
Date startdate = null;
|
Date startdate = null;
|
||||||
Date enddate = null;
|
Date enddate = null;
|
||||||
SimpleDateFormat formater = new SimpleDateFormat();
|
SimpleDateFormat formater = new SimpleDateFormat();
|
||||||
@@ -54,7 +54,7 @@ public class SarPublicIdeaController extends BaseController<SarPublicIdea> {
|
|||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
IPage<SarPublicIdea> Publiclist =sarPublicIdeaService.selectAllP(page,size,categorg,cname,startdate,enddate);
|
IPage<SarPublicIdea> Publiclist =sarPublicIdeaService.selectAllP(page,size,categorg,cname,startdate,enddate,type);
|
||||||
return Result.success(Publiclist);
|
return Result.success(Publiclist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -20,6 +20,6 @@ import java.util.Date;
|
|||||||
public interface ISarPublicIdeaService extends IService<SarPublicIdea> {
|
public interface ISarPublicIdeaService extends IService<SarPublicIdea> {
|
||||||
|
|
||||||
String add(SarPublicIdea sarPublicIdea);
|
String add(SarPublicIdea sarPublicIdea);
|
||||||
IPage<SarPublicIdea> selectAllP(Integer page, Integer size, String categorg, String cname, Date startdate, Date enddate);
|
IPage<SarPublicIdea> selectAllP(Integer page, Integer size, String categorg, String cname, Date startdate, Date enddate, String type);
|
||||||
IPage<SarPublicIdea> selectAllDynamic(SeByoDto seByoDto);
|
IPage<SarPublicIdea> selectAllDynamic(SeByoDto seByoDto);
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-3
@@ -1,7 +1,6 @@
|
|||||||
package com.adc.da.slrs.sarStandIdea.service.Impl;
|
package com.adc.da.slrs.sarStandIdea.service.Impl;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import com.adc.da.slrs.sarStandIdea.dao.SarPublicIdeaDao;
|
import com.adc.da.slrs.sarStandIdea.dao.SarPublicIdeaDao;
|
||||||
|
|
||||||
import com.adc.da.slrs.sarStandIdea.entity.SarPublicIdea;
|
import com.adc.da.slrs.sarStandIdea.entity.SarPublicIdea;
|
||||||
@@ -45,13 +44,21 @@ public class SarPublicIdeaServiceImpl extends ServiceImpl<SarPublicIdeaDao, SarP
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<SarPublicIdea> selectAllP(Integer p, Integer size, String category, String cname, Date start, Date end) {
|
public IPage<SarPublicIdea> selectAllP(Integer p, Integer size, String category, String cname, Date start, Date end, String type) {
|
||||||
QueryWrapper<SarPublicIdea> list = new QueryWrapper<>();
|
QueryWrapper<SarPublicIdea> list = new QueryWrapper<>();
|
||||||
|
if ("1".equals(type)) {
|
||||||
|
list.like(StringUtils.isNotEmpty(category), "category", category)
|
||||||
|
.like(StringUtils.isNotEmpty(cname), "cname", cname)
|
||||||
|
.ge(start != null, "start_time", start)
|
||||||
|
.le(end != null, "end_time", end)
|
||||||
|
.orderByDesc("start_time");
|
||||||
|
} else {
|
||||||
list.like(StringUtils.isNotEmpty(category), "category", category)
|
list.like(StringUtils.isNotEmpty(category), "category", category)
|
||||||
.like(StringUtils.isNotEmpty(cname), "cname", cname)
|
.like(StringUtils.isNotEmpty(cname), "cname", cname)
|
||||||
.ge(start != null, "start_time", start)
|
.ge(start != null, "start_time", start)
|
||||||
.le(end != null, "end_time", end)
|
.le(end != null, "end_time", end)
|
||||||
.orderByAsc("end_time");
|
.orderByAsc("end_time");
|
||||||
|
}
|
||||||
Page<SarPublicIdea> page = new Page<>(p, size);
|
Page<SarPublicIdea> page = new Page<>(p, size);
|
||||||
IPage<SarPublicIdea> userIPage = sarPublicIdeaDao.selectPage(page, list);
|
IPage<SarPublicIdea> userIPage = sarPublicIdeaDao.selectPage(page, list);
|
||||||
System.out.println("总条数" + userIPage.getTotal());
|
System.out.println("总条数" + userIPage.getTotal());
|
||||||
@@ -60,7 +67,6 @@ public class SarPublicIdeaServiceImpl extends ServiceImpl<SarPublicIdeaDao, SarP
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param seByoDto
|
* @param seByoDto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user