feat(foundations):增加区域服务分页查询的功能
This commit is contained in:
parent
5fff3f51ad
commit
0f34ac1ed3
45
yunlan-backend/.gitignore
vendored
45
yunlan-backend/.gitignore
vendored
@ -1,8 +1,41 @@
|
||||
**/target/
|
||||
.idea
|
||||
*.iml
|
||||
*.class
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
*Test.java
|
||||
**/test/
|
||||
# JRebal热更插件文件
|
||||
rebel.xml
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
.idea/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
||||
@ -0,0 +1,31 @@
|
||||
package com.jzo2o.foundations.controller.operation;
|
||||
|
||||
import com.jzo2o.common.model.PageResult;
|
||||
import com.jzo2o.foundations.model.dto.request.ServePageQueryReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.ServeResDTO;
|
||||
import com.jzo2o.foundations.service.IServeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 区域服务相关接口
|
||||
* @author JIAN
|
||||
*/
|
||||
@Validated
|
||||
@RestController("operationServeController")
|
||||
@RequestMapping("/operation/serve")
|
||||
@Api(tags = "运营端 - 区域服务相关接口")
|
||||
public class ServeController {
|
||||
@Resource
|
||||
private IServeService serveService;
|
||||
|
||||
@GetMapping("/page")
|
||||
public PageResult<ServeResDTO> page(ServePageQueryReqDTO servePageQueryReqDTO) {
|
||||
return serveService.page(servePageQueryReqDTO);
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,7 @@
|
||||
package com.jzo2o.foundations.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jzo2o.api.foundations.dto.response.ServeAggregationResDTO;
|
||||
import com.jzo2o.foundations.model.domain.Serve;
|
||||
import com.jzo2o.foundations.model.dto.response.ServeAggregationSimpleResDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.ServeAggregationTypeSimpleResDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.ServeCategoryResDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.ServeResDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -15,9 +11,13 @@ import java.util.List;
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
public interface ServeMapper extends BaseMapper<Serve> {
|
||||
}
|
||||
/**
|
||||
* 区域服务查询
|
||||
* @param regionId 区域id
|
||||
*/
|
||||
List<ServeResDTO> queryServeListByRegionId(@Param("regionId") Long regionId);
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.jzo2o.foundations.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jzo2o.common.model.PageResult;
|
||||
import com.jzo2o.foundations.model.domain.Serve;
|
||||
import com.jzo2o.foundations.model.dto.request.ServePageQueryReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.ServeResDTO;
|
||||
|
||||
/**
|
||||
* 区域服务接口
|
||||
* @author JIAN
|
||||
*/
|
||||
public interface IServeService extends IService<Serve> {
|
||||
/**
|
||||
* 区域服务分页查询
|
||||
* @param servePageQueryReqDTO 分页参数
|
||||
*/
|
||||
PageResult<ServeResDTO> page(ServePageQueryReqDTO servePageQueryReqDTO);
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.jzo2o.foundations.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jzo2o.common.model.PageResult;
|
||||
import com.jzo2o.foundations.mapper.ServeMapper;
|
||||
import com.jzo2o.foundations.model.domain.Serve;
|
||||
import com.jzo2o.foundations.model.dto.request.ServePageQueryReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.ServeResDTO;
|
||||
import com.jzo2o.foundations.service.IServeService;
|
||||
import com.jzo2o.mysql.utils.PageHelperUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 区域服务实现类
|
||||
* @author JIAN
|
||||
*/
|
||||
@Service
|
||||
public class ServeServiceImpl extends ServiceImpl<ServeMapper, Serve> implements IServeService {
|
||||
@Override
|
||||
public PageResult<ServeResDTO> page(ServePageQueryReqDTO servePageQueryReqDTO) {
|
||||
return PageHelperUtils.selectPage(servePageQueryReqDTO,
|
||||
() -> baseMapper.queryServeListByRegionId(servePageQueryReqDTO.getRegionId()));
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jzo2o.foundations.mapper.ServeMapper">
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
<select id="queryServeListByRegionId" resultType="com.jzo2o.foundations.model.dto.response.ServeResDTO">
|
||||
SELECT si.name serve_item_name,
|
||||
si.reference_price,
|
||||
si.serve_type_id,
|
||||
st.id,
|
||||
st.name serve_type_name,
|
||||
s.id,
|
||||
s.serve_item_id,
|
||||
s.sale_status,
|
||||
s.region_id,
|
||||
s.price,
|
||||
s.is_hot,
|
||||
s.create_time,
|
||||
s.update_time
|
||||
FROM serve s
|
||||
JOIN serve_item si ON s.serve_item_id = si.id
|
||||
JOIN serve_type st ON si.serve_type_id = st.id
|
||||
WHERE s.region_id = #{regionId}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user