| | |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询项目") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "西") |
| | | }) |
| | | @GetMapping(value = "/selectProject") |
| | | public ResponseMsg<List<DirEntity>> selectProject(String name) { |
| | | try { |
| | | List<DirEntity> list = dirService.selectProject(name); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "递归查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pid", value = "父ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPid") |
| | | public ResponseMsg<List<DirEntity>> selectByPid(int pid) { |
| | | try { |
| | | List<DirEntity> list = dirService.selectByPid(pid); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
| | |
| | | public List<DirEntity> selectRecursiveById(Integer id); |
| | | |
| | | /** |
| | | * 递归查询 |
| | | * |
| | | * @param pid |
| | | * @return |
| | | */ |
| | | public List<DirEntity> selectByPid(int pid); |
| | | |
| | | /** |
| | | * 查询项目目录树 |
| | | * |
| | | * @return |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<DirEntity> selectByPid(int pid) { |
| | | List<DirEntity> list = dirMapper.selectByPid(pid); |
| | | |
| | | return null == list ? new ArrayList<>() : list; |
| | | } |
| | | |
| | | @Override |
| | | public List<DirEntity> selectDirsForPrj() { |
| | | String key = RedisCacheKey.dataDirKey("selectDirsForPrj"); |
| | | List<DirEntity> list = redisService.getListByKey(key); |
| | |
| | | order by code; |
| | | </select> |
| | | |
| | | <select id="selectByPid" resultType="com.lf.server.entity.data.DirEntity"> |
| | | with recursive rs as( |
| | | select a.* from lf.sys_dir a where id = #{pid} |
| | | union |
| | | select b.* from lf.sys_dir b, rs c where b.pid = c.id) |
| | | select * from rs |
| | | order by code; |
| | | </select> |
| | | |
| | | <select id="selectDirsForPrj" resultType="com.lf.server.entity.data.DirEntity"> |
| | | select a.* from lf.sys_dir a where code not like '00%' order by code; |
| | | </select> |