| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- package com.poteviohealth.ym.ipos.controller;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.poteviohealth.cgp.common.controller.BaseWebController;
- import com.poteviohealth.cgp.common.integrated.IntegerParams;
- import com.poteviohealth.cgp.common.model.VaultsResponse;
- import com.poteviohealth.ym.ipos.model.Area;
- import com.poteviohealth.ym.ipos.service.IAreaService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import org.springframework.http.MediaType;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import javax.annotation.Resource;
- import java.util.List;
- /**
- * 区域
- * @author Qin
- */
- @RestController
- @RequestMapping("/ipos/web/area")
- @Api(value = "AreaController", tags = "地理区域", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
- public class AreaController extends BaseWebController {
- @Resource
- private IAreaService areaService;
- @PostMapping("/listArea")
- @ApiOperation(httpMethod = "POST", value = "查询列表")
- public VaultsResponse<List<Area>> listArea(@RequestBody IntegerParams params) {
- QueryWrapper<Area> queryWrapper = new QueryWrapper<>();
- if(params.getId() == null){
- queryWrapper.isNull("parent_id");
- }else{
- queryWrapper.eq("parent_id",params.getId());
- }
- return VaultsResponse.success(areaService.list(queryWrapper));
- }
- }
|