| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.se.nsl.domain.po.Region; |
| | | import com.se.nsl.domain.vo.R; |
| | | import com.se.nsl.domain.vo.RegionVo; |
| | | import com.se.nsl.service.RegionService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | */ |
| | | @ApiOperation(value = "selectPage") |
| | | @GetMapping("/selectPage") |
| | | public R<Object> selectPage(Region region, Integer pageNum, Integer pageSize) { |
| | | public R<Object> selectPage(RegionVo vo, Integer pageNum, Integer pageSize) { |
| | | try { |
| | | if (null == pageNum || pageNum < 1) pageNum = 1; |
| | | if (null == pageSize || pageSize < 1) pageSize = 10; |
| | | if (pageSize > 1000) pageSize = 1000; |
| | | |
| | | IPage<Region> paged = regionService.selectPage(region, pageNum, pageSize); |
| | | IPage<Region> paged = regionService.selectPage(vo, pageNum, pageSize); |
| | | if (null == paged) { |
| | | return success(null, 0); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.se.nsl.domain.po.Simu; |
| | | import com.se.nsl.domain.vo.R; |
| | | import com.se.nsl.domain.vo.SimuVo; |
| | | import com.se.nsl.service.SimuService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | */ |
| | | @ApiOperation(value = "selectPage") |
| | | @GetMapping("/selectPage") |
| | | public R<Object> selectPage(Simu simu, Integer pageNum, Integer pageSize) { |
| | | public R<Object> selectPage(SimuVo vo, Integer pageNum, Integer pageSize) { |
| | | try { |
| | | if (null == pageNum || pageNum < 1) pageNum = 1; |
| | | if (null == pageSize || pageSize < 1) pageSize = 10; |
| | | if (pageSize > 1000) pageSize = 1000; |
| | | |
| | | IPage<Simu> paged = simuService.selectPage(simu, pageNum, pageSize); |
| | | IPage<Simu> paged = simuService.selectPage(vo, pageNum, pageSize); |
| | | if (null == paged) { |
| | | return success(null, 0); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.se.nsl.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | @SuppressWarnings("ALL") |
| | | public class RegionVo { |
| | | @ApiModelProperty("主é®ID") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("åç§°") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("ç±»å«ï¼1-è¡æ¿åºåï¼2-éç¹åºåï¼3-éç¹æ²") |
| | | private Short type; |
| | | |
| | | public RegionVo() { |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Short getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Short type) { |
| | | this.type = type; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.se.nsl.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | @SuppressWarnings("ALL") |
| | | public class SimuVo { |
| | | @ApiModelProperty("ID") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("åç§°") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("æå¡åç§°") |
| | | private String serviceName; |
| | | |
| | | @ApiModelProperty("ç±»å«ï¼1-颿µæ¨¡æï¼2-宿¶æ¨¡æï¼3-å岿¨¡æ") |
| | | private Short type; |
| | | |
| | | @ApiModelProperty("åºåç±»å«ï¼0-èªå®ä¹ï¼1-è¡æ¿åºåï¼2-éç¹åºåï¼3-éç¹æ²") |
| | | private Short areaType; |
| | | |
| | | @ApiModelProperty("ç¶æï¼0-å建仿çï¼1-é¢å¤çï¼2-åæä¸ï¼10-宿ï¼20-åºé") |
| | | private Integer status; |
| | | |
| | | public SimuVo() { |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getServiceName() { |
| | | return serviceName; |
| | | } |
| | | |
| | | public void setServiceName(String serviceName) { |
| | | this.serviceName = serviceName; |
| | | } |
| | | |
| | | public Short getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Short type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Short getAreaType() { |
| | | return areaType; |
| | | } |
| | | |
| | | public void setAreaType(Short areaType) { |
| | | this.areaType = areaType; |
| | | } |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.se.nsl.domain.po.Region; |
| | | import com.se.nsl.domain.vo.RegionVo; |
| | | import com.se.nsl.helper.StringHelper; |
| | | import com.se.nsl.mapper.RegionMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | * @param pageSize æ¯é¡µæ°é |
| | | * @return å页åçæ¨æ¼åºå |
| | | */ |
| | | public IPage<Region> selectPage(Region vo, int pageNum, int pageSize) { |
| | | public IPage<Region> selectPage(RegionVo vo, int pageNum, int pageSize) { |
| | | QueryWrapper<Region> wrapper = getPageWrapper(vo, pageNum, pageSize); |
| | | |
| | | Page<Region> page = new Page<>(pageNum, pageSize); |
| | |
| | | return paged; |
| | | } |
| | | |
| | | private QueryWrapper<Region> getPageWrapper(Region vo, int pageNum, int pageSize) { |
| | | private QueryWrapper<Region> getPageWrapper(RegionVo vo, int pageNum, int pageSize) { |
| | | QueryWrapper<Region> wrapper = new QueryWrapper<>(); |
| | | if (null != vo.getId()) { |
| | | wrapper.eq("id", vo.getId()); |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.se.nsl.domain.po.Simu; |
| | | import com.se.nsl.domain.vo.SimuVo; |
| | | import com.se.nsl.helper.StringHelper; |
| | | import com.se.nsl.mapper.SimuMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | * @param pageSize æ¯é¡µæ°é |
| | | * @return å页åçæ¨æ¼æ¨¡æ |
| | | */ |
| | | public IPage<Simu> selectPage(Simu vo, int pageNum, int pageSize) { |
| | | public IPage<Simu> selectPage(SimuVo vo, int pageNum, int pageSize) { |
| | | QueryWrapper<Simu> wrapper = getPageWrapper(vo, pageNum, pageSize); |
| | | |
| | | Page<Simu> page = new Page<>(pageNum, pageSize); |
| | |
| | | return paged; |
| | | } |
| | | |
| | | private QueryWrapper<Simu> getPageWrapper(Simu vo, int pageNum, int pageSize) { |
| | | private QueryWrapper<Simu> getPageWrapper(SimuVo vo, int pageNum, int pageSize) { |
| | | QueryWrapper<Simu> wrapper = new QueryWrapper<>(); |
| | | if (null != vo.getId()) { |
| | | wrapper.eq("id", vo.getId()); |