| | |
| | | package com.lf.server.controller.data; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 项ç®ç®¡ç |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææç®å½æ°æ®") |
| | | @GetMapping(value = "/selectDirAll") |
| | | public ResponseMsg<List<DirEntity>> selectDirAll() { |
| | | @ApiOperation(value = "æ¥è¯¢æ ¹ç®å½") |
| | | @GetMapping(value = "/selectDirRoot") |
| | | public ResponseMsg<List<DirEntity>> selectDirRoot() { |
| | | try { |
| | | List<DirEntity> list = dirService.selectDirAll(); |
| | | List<DirEntity> list = dirService.selectDirRoot(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®ç®å½IDæ¥è¯¢") |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dirid", value = "ç®å½ID", dataType = "int", paramType = "query", example = "0") |
| | | @ApiImplicitParam(name = "dirid", value = "ç®å½ID", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByDirid") |
| | | public ResponseMsg<BsprojectEntity> selectByDirid(int dirid) { |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<Object> selectByPageAndCount(Integer dirid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | Map<String, Object> map = new HashMap<>(1); |
| | | map.put("dirid", dirid); |
| | | |
| | | List<BsprojectEntity> list = bsprojectMapper.selectByMap(map); |
| | | if (null == list || list.isEmpty()) { |
| | | return success(null); |
| | | QueryWrapper<BsprojectEntity> wrapper = null; |
| | | if (null != dirid) { |
| | | wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("dirid", dirid); |
| | | } |
| | | |
| | | return success(list.get(0)); |
| | | Page<BsprojectEntity> page = new Page<>(pageIndex, pageSize); |
| | | page.addOrder(OrderItem.asc("gid")); |
| | | Page paged = bsprojectMapper.selectPage(page, wrapper); |
| | | |
| | | return success(paged.getTotal(), paged.getRecords()); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |