Commit a7b3b1af by huluobin

排序

parent fc60ebd3
...@@ -19,4 +19,11 @@ public interface BaseTypeService extends IService<BaseType> { ...@@ -19,4 +19,11 @@ public interface BaseTypeService extends IService<BaseType> {
* @return * @return
*/ */
boolean containFreeServe(List<Integer> serveIdList); boolean containFreeServe(List<Integer> serveIdList);
/**
* 查询服务分类
*
* @return
*/
List<BaseType> queryType();
} }
...@@ -26,4 +26,10 @@ public class BaseTypeServiceImpl extends ServiceImpl<BaseTypeMapper, BaseType> i ...@@ -26,4 +26,10 @@ public class BaseTypeServiceImpl extends ServiceImpl<BaseTypeMapper, BaseType> i
List<BaseType> baseTypeList = baseTypeMapper.selectByServeIds(serveIdList); List<BaseType> baseTypeList = baseTypeMapper.selectByServeIds(serveIdList);
return baseTypeList.stream().map(BaseType::getName).collect(Collectors.toList()).contains("会员福利"); return baseTypeList.stream().map(BaseType::getName).collect(Collectors.toList()).contains("会员福利");
} }
@Override
public List<BaseType> queryType() {
return baseMapper.queryType();
}
} }
...@@ -17,4 +17,11 @@ public interface BaseTypeMapper extends BaseMapper<BaseType> { ...@@ -17,4 +17,11 @@ public interface BaseTypeMapper extends BaseMapper<BaseType> {
* @return * @return
*/ */
List<BaseType> selectByServeIds(@Param("serveIdList") List<Integer> serveIdList); List<BaseType> selectByServeIds(@Param("serveIdList") List<Integer> serveIdList);
/**
* 查询服务分类根据sorts升序
*
* @return
*/
List<BaseType> queryType();
} }
...@@ -25,13 +25,13 @@ public class TypeController { ...@@ -25,13 +25,13 @@ public class TypeController {
@ApiOperation("用户端询服务类型") @ApiOperation("用户端询服务类型")
@GetMapping("/customer/type/queryType") @GetMapping("/customer/type/queryType")
public JsonResult<List<BaseType>> queryType() { public JsonResult<List<BaseType>> queryType() {
return JsonResult.success(baseTypeService.list()); return JsonResult.success(baseTypeService.queryType());
} }
@ApiOperation("美甲师端查询服务类型") @ApiOperation("美甲师端查询服务类型")
@GetMapping("/technician/type/queryType") @GetMapping("/technician/type/queryType")
public JsonResult<List<BaseType>> technicianQueryType() { public JsonResult<List<BaseType>> technicianQueryType() {
return JsonResult.success(baseTypeService.list()); return JsonResult.success(baseTypeService.queryType());
} }
} }
...@@ -11,4 +11,9 @@ ...@@ -11,4 +11,9 @@
#{id} #{id}
</foreach> </foreach>
</select> </select>
<select id="queryType" resultType="com.gogirl.domain.product.serve.BaseType">
select *
from base_type
order by sorts
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment