huwhois 4 jaren geleden
bovenliggende
commit
dc6b87cc7e

+ 3 - 3
src/main/java/io/renren/modules/admin/controller/ReportController.java

@ -159,10 +159,10 @@ public class ReportController {
159 159
    /**
160 160
     * listbybranch
161 161
     */
162
    @GetMapping("/listbranch/{mid}/{bid}")
162
    @GetMapping("/listbranch/{mid}/{bid}/{sort}")
163 163
    @RequiresPermissions("admin:report:list")
164
    public R listByBranch(@PathVariable("mid") Long mid, @PathVariable("bid") Long bid){
165
        List<ReportEntity> list = reportService.listByBranch(mid, bid);
164
    public R listByBranch(@PathVariable("mid") Long mid, @PathVariable("bid") Long bid, @PathVariable("sort") String sort){
165
        List<ReportEntity> list = reportService.listByBranch(mid, bid, sort);
166 166
167 167
        return R.ok().put("list", list);
168 168
    }

+ 1 - 1
src/main/java/io/renren/modules/admin/service/ReportService.java

@ -18,7 +18,7 @@ public interface ReportService extends IService<ReportEntity> {
18 18
19 19
    PageUtils queryPage(Map<String, Object> params);
20 20
21
	List<ReportEntity> listByBranch(Long mid, Long bid);
21
	List<ReportEntity> listByBranch(Long mid, Long bid, String order);
22 22
23 23
	List<ReportEntity> listByBranch(Long mid);
24 24
}

+ 3 - 3
src/main/java/io/renren/modules/admin/service/impl/ReportServiceImpl.java

@ -32,13 +32,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity> impl
32 32
    }
33 33
34 34
    @Override
35
    public List<ReportEntity> listByBranch(Long mid, Long bid) {
36
        return this.list(new QueryWrapper<ReportEntity>().eq(bid == 0, "meeting_id", mid).eq("branch_id", bid).orderByAsc("sort"));
35
    public List<ReportEntity> listByBranch(Long mid, Long bid, String order) {
36
        return this.list(new QueryWrapper<ReportEntity>().eq(bid == 0, "meeting_id", mid).eq("branch_id", bid).orderByAsc(StringUtils.isNotBlank(order), order));
37 37
    }
38 38
39 39
    @Override
40 40
    public List<ReportEntity> listByBranch(Long mid) {
41
        return this.list(new QueryWrapper<ReportEntity>().eq("meeting_id", mid).orderByAsc("sort"));
41
        return this.list(new QueryWrapper<ReportEntity>().eq("meeting_id", mid));
42 42
    }
43 43
44 44
}