| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.api.CommonResult; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | |
| | | /** |
| | |
| | | return CommonResult.success(iDataDictionaryService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * @Description batch delete illegal building |
| | | * @Param [ids] |
| | | * @return com.ycl.api.CommonResult |
| | | **/ |
| | | @ApiOperation(value = "批量删除违规类型") |
| | | @DeleteMapping("/batch_delete") |
| | | public CommonResult removeIllegalBuildings(@RequestParam String[] ids){ |
| | | return CommonResult.success(iDataDictionaryService.removeBatchByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * @Description search illegal building type first |
| | | * @Param [] |
| | | * @return com.ycl.api.CommonResult |
| | | **/ |
| | | @ApiOperation(value = "查询所属类型") |
| | | @GetMapping("/query/type_first") |
| | | public CommonResult searchIllegalBuildingTypeFirst(){ |
| | | String typeLevel="1"; |
| | | String typeCode="06"; |
| | | return CommonResult.success(iDataDictionaryService |
| | | .list(new LambdaQueryWrapper<DataDictionary>() |
| | | .eq(DataDictionary::getLevel,typeLevel) |
| | | .eq(DataDictionary::getTypeCode,typeCode))); |
| | | } |
| | | |
| | | /** |
| | | * @Description search illegal building type second |
| | | * @Param [] |
| | | * @return com.ycl.api.CommonResult |
| | | **/ |
| | | @ApiOperation(value = "查询所属类别") |
| | | @GetMapping("/query/type_second") |
| | | public CommonResult searchIllegalBuildingTypeSecond(){ |
| | | String typeLevel="2"; |
| | | String typeCode="06"; |
| | | return CommonResult.success(iDataDictionaryService |
| | | .list(new LambdaQueryWrapper<DataDictionary>() |
| | | .eq(DataDictionary::getLevel,typeLevel) |
| | | .eq(DataDictionary::getTypeCode,typeCode))); |
| | | } |
| | | |
| | | /** |
| | | * @Description modify illegal building type |
| | | * @Param [typeFirst, id] |
| | | * @return com.ycl.api.CommonResult |
| | | **/ |
| | | @ApiOperation(value = "修改所属类型/类别") |
| | | @PutMapping("/modification/type") |
| | | public CommonResult modifyIllegalBuildingType(@RequestParam String type,@RequestParam Integer id){ |
| | | return CommonResult.success(iDataDictionaryService |
| | | .update(new LambdaUpdateWrapper<DataDictionary>() |
| | | .eq(DataDictionary::getId,id) |
| | | .set(StringUtils.isNotBlank(type),DataDictionary::getName,type))); |
| | | } |
| | | |
| | | /** |
| | | * @Description addition illegal building type |
| | | * @Param [dataDictionary] |
| | | * @return com.ycl.api.CommonResult |
| | | **/ |
| | | @ApiOperation(value = "添加所属类型/类别") |
| | | @PostMapping("/addition/type") |
| | | public CommonResult addIllegalBuildingTypeFirst(@RequestBody @Validated DataDictionary dataDictionary){ |
| | | return CommonResult.success(iDataDictionaryService.save(dataDictionary)); |
| | | } |
| | | |
| | | } |