新增:课程培训模块
This commit is contained in:
@@ -0,0 +1,110 @@
|
|||||||
|
package com.gxwebsoft.booking.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.booking.service.CourseCategoryService;
|
||||||
|
import com.gxwebsoft.booking.entity.CourseCategory;
|
||||||
|
import com.gxwebsoft.booking.param.CourseCategoryParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程分类控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-06-08 15:00:52
|
||||||
|
*/
|
||||||
|
@Api(tags = "课程分类管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/booking/course-category")
|
||||||
|
public class CourseCategoryController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CourseCategoryService courseCategoryService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询课程分类")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CourseCategory>> page(CourseCategoryParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(courseCategoryService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部课程分类")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CourseCategory>> list(CourseCategoryParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(courseCategoryService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('booking:courseCategory:list')")
|
||||||
|
@ApiOperation("根据id查询课程分类")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CourseCategory> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(courseCategoryService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加课程分类")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CourseCategory courseCategory) {
|
||||||
|
if (courseCategoryService.save(courseCategory)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改课程分类")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CourseCategory courseCategory) {
|
||||||
|
if (courseCategoryService.updateById(courseCategory)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除课程分类")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (courseCategoryService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加课程分类")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CourseCategory> list) {
|
||||||
|
if (courseCategoryService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改课程分类")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CourseCategory> batchParam) {
|
||||||
|
if (batchParam.update(courseCategoryService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除课程分类")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (courseCategoryService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+29
-30
@@ -1,9 +1,9 @@
|
|||||||
package com.gxwebsoft.booking.controller;
|
package com.gxwebsoft.booking.controller;
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
import com.gxwebsoft.booking.service.LessonService;
|
import com.gxwebsoft.booking.service.CourseService;
|
||||||
import com.gxwebsoft.booking.entity.Lesson;
|
import com.gxwebsoft.booking.entity.Course;
|
||||||
import com.gxwebsoft.booking.param.LessonParam;
|
import com.gxwebsoft.booking.param.CourseParam;
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
@@ -22,91 +22,90 @@ import java.util.List;
|
|||||||
* 课程管理控制器
|
* 课程管理控制器
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-04-21 14:31:15
|
* @since 2024-06-08 15:00:52
|
||||||
*/
|
*/
|
||||||
@Api(tags = "课程管理管理")
|
@Api(tags = "课程管理管理")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/booking/lesson")
|
@RequestMapping("/api/booking/course")
|
||||||
public class LessonController extends BaseController {
|
public class CourseController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private LessonService lessonService;
|
private CourseService courseService;
|
||||||
|
|
||||||
@ApiOperation("分页查询课程管理")
|
@ApiOperation("分页查询课程管理")
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public ApiResult<PageResult<Lesson>> page(LessonParam param) {
|
public ApiResult<PageResult<Course>> page(CourseParam param) {
|
||||||
// 使用关联查询
|
// 使用关联查询
|
||||||
return success(lessonService.pageRel(param));
|
return success(courseService.pageRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("查询全部课程管理")
|
@ApiOperation("查询全部课程管理")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public ApiResult<List<Lesson>> list(LessonParam param) {
|
public ApiResult<List<Course>> list(CourseParam param) {
|
||||||
// 使用关联查询
|
// 使用关联查询
|
||||||
return success(lessonService.listRel(param));
|
return success(courseService.listRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('booking:lesson:list')")
|
|
||||||
@ApiOperation("根据id查询课程管理")
|
@ApiOperation("根据id查询课程管理")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public ApiResult<Lesson> get(@PathVariable("id") Integer id) {
|
public ApiResult<Course> get(@PathVariable("id") Integer id) {
|
||||||
// 使用关联查询
|
// 使用关联查询
|
||||||
return success(lessonService.getByIdRel(id));
|
return success(courseService.getByIdRel(id));
|
||||||
}
|
}
|
||||||
|
@PreAuthorize("hasAuthority('booking:course:save')")
|
||||||
@ApiOperation("添加课程管理")
|
@ApiOperation("添加课程管理")
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public ApiResult<?> save(@RequestBody Lesson lesson) {
|
public ApiResult<?> save(@RequestBody Course course) {
|
||||||
// 记录当前登录用户id
|
if (courseService.save(course)) {
|
||||||
// User loginUser = getLoginUser();
|
|
||||||
// if (loginUser != null) {
|
|
||||||
// lesson.setUserId(loginUser.getUserId());
|
|
||||||
// }
|
|
||||||
if (lessonService.save(lesson)) {
|
|
||||||
return success("添加成功");
|
return success("添加成功");
|
||||||
}
|
}
|
||||||
return fail("添加失败");
|
return fail("添加失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('booking:course:update')")
|
||||||
@ApiOperation("修改课程管理")
|
@ApiOperation("修改课程管理")
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
public ApiResult<?> update(@RequestBody Lesson lesson) {
|
public ApiResult<?> update(@RequestBody Course course) {
|
||||||
if (lessonService.updateById(lesson)) {
|
if (courseService.updateById(course)) {
|
||||||
return success("修改成功");
|
return success("修改成功");
|
||||||
}
|
}
|
||||||
return fail("修改失败");
|
return fail("修改失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('booking:course:remove')")
|
||||||
@ApiOperation("删除课程管理")
|
@ApiOperation("删除课程管理")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (lessonService.removeById(id)) {
|
if (courseService.removeById(id)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('booking:course:save')")
|
||||||
@ApiOperation("批量添加课程管理")
|
@ApiOperation("批量添加课程管理")
|
||||||
@PostMapping("/batch")
|
@PostMapping("/batch")
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<Lesson> list) {
|
public ApiResult<?> saveBatch(@RequestBody List<Course> list) {
|
||||||
if (lessonService.saveBatch(list)) {
|
if (courseService.saveBatch(list)) {
|
||||||
return success("添加成功");
|
return success("添加成功");
|
||||||
}
|
}
|
||||||
return fail("添加失败");
|
return fail("添加失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('booking:course:update')")
|
||||||
@ApiOperation("批量修改课程管理")
|
@ApiOperation("批量修改课程管理")
|
||||||
@PutMapping("/batch")
|
@PutMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Lesson> batchParam) {
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Course> batchParam) {
|
||||||
if (batchParam.update(lessonService, "lesson_id")) {
|
if (batchParam.update(courseService, "course_id")) {
|
||||||
return success("修改成功");
|
return success("修改成功");
|
||||||
}
|
}
|
||||||
return fail("修改失败");
|
return fail("修改失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('booking:course:remove')")
|
||||||
@ApiOperation("批量删除课程管理")
|
@ApiOperation("批量删除课程管理")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (lessonService.removeByIds(ids)) {
|
if (courseService.removeByIds(ids)) {
|
||||||
return success("删除成功");
|
return success("删除成功");
|
||||||
}
|
}
|
||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
+43
-13
@@ -1,10 +1,15 @@
|
|||||||
package com.gxwebsoft.booking.entity;
|
package com.gxwebsoft.booking.entity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -14,36 +19,42 @@ import lombok.EqualsAndHashCode;
|
|||||||
* 课程管理
|
* 课程管理
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-04-21 14:31:15
|
* @since 2024-06-08 15:00:52
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@ApiModel(value = "Lesson对象", description = "课程管理")
|
@ApiModel(value = "Course对象", description = "课程管理")
|
||||||
@TableName("booking_lesson")
|
@TableName("booking_course")
|
||||||
public class Lesson implements Serializable {
|
public class Course implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ApiModelProperty(value = "ID")
|
@ApiModelProperty(value = "ID")
|
||||||
@TableId(value = "lesson_id", type = IdType.AUTO)
|
@TableId(value = "course_id", type = IdType.AUTO)
|
||||||
private Integer lessonId;
|
private Integer courseId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "课程名称")
|
@ApiModelProperty(value = "课程名称")
|
||||||
private String lessonName;
|
private String courseName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "图标")
|
@ApiModelProperty(value = "封面图")
|
||||||
private String image;
|
private String image;
|
||||||
|
|
||||||
@ApiModelProperty(value = "分类ID")
|
@ApiModelProperty(value = "分类ID")
|
||||||
private Integer categoryId;
|
private Integer categoryId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课程价格")
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "咨询电话")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
@ApiModelProperty(value = "老师ID")
|
@ApiModelProperty(value = "老师ID")
|
||||||
private Integer teacherId;
|
private Integer teacherId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "商户ID")
|
|
||||||
private Integer merchantId;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "上课时间")
|
@ApiModelProperty(value = "上课时间")
|
||||||
private LocalDateTime startTime;
|
private Date startTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课时")
|
||||||
|
private Integer classPeriod;
|
||||||
|
|
||||||
@ApiModelProperty(value = "报名人数上限")
|
@ApiModelProperty(value = "报名人数上限")
|
||||||
private Integer maxNumber;
|
private Integer maxNumber;
|
||||||
@@ -51,9 +62,24 @@ public class Lesson implements Serializable {
|
|||||||
@ApiModelProperty(value = "上课地点")
|
@ApiModelProperty(value = "上课地点")
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "详细介绍")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课程相册")
|
||||||
|
private String files;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年龄限制")
|
||||||
|
private String ageLimit;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "报名时间")
|
||||||
|
private String bmTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "备注")
|
@ApiModelProperty(value = "备注")
|
||||||
private String comments;
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户ID")
|
||||||
|
private Integer merchantId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "状态")
|
@ApiModelProperty(value = "状态")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
@@ -64,6 +90,10 @@ public class Lesson implements Serializable {
|
|||||||
private Integer tenantId;
|
private Integer tenantId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
private LocalDateTime createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String merchantName;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package com.gxwebsoft.booking.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程分类
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-06-08 15:00:52
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "CourseCategory对象", description = "课程分类")
|
||||||
|
@TableName("booking_course_category")
|
||||||
|
public class CourseCategory implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品分类ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分类名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分类标识")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分类图片")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上级分类ID")
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否推荐")
|
||||||
|
private Integer recommend;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1禁用")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.booking.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.booking.entity.CourseCategory;
|
||||||
|
import com.gxwebsoft.booking.param.CourseCategoryParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程分类Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-06-08 15:00:52
|
||||||
|
*/
|
||||||
|
public interface CourseCategoryMapper extends BaseMapper<CourseCategory> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CourseCategory>
|
||||||
|
*/
|
||||||
|
List<CourseCategory> selectPageRel(@Param("page") IPage<CourseCategory> page,
|
||||||
|
@Param("param") CourseCategoryParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CourseCategory> selectListRel(@Param("param") CourseCategoryParam param);
|
||||||
|
|
||||||
|
}
|
||||||
+8
-8
@@ -2,8 +2,8 @@ package com.gxwebsoft.booking.mapper;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.gxwebsoft.booking.entity.Lesson;
|
import com.gxwebsoft.booking.entity.Course;
|
||||||
import com.gxwebsoft.booking.param.LessonParam;
|
import com.gxwebsoft.booking.param.CourseParam;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -12,19 +12,19 @@ import java.util.List;
|
|||||||
* 课程管理Mapper
|
* 课程管理Mapper
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-04-21 14:31:15
|
* @since 2024-06-08 15:00:52
|
||||||
*/
|
*/
|
||||||
public interface LessonMapper extends BaseMapper<Lesson> {
|
public interface CourseMapper extends BaseMapper<Course> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*
|
*
|
||||||
* @param page 分页对象
|
* @param page 分页对象
|
||||||
* @param param 查询参数
|
* @param param 查询参数
|
||||||
* @return List<Lesson>
|
* @return List<Course>
|
||||||
*/
|
*/
|
||||||
List<Lesson> selectPageRel(@Param("page") IPage<Lesson> page,
|
List<Course> selectPageRel(@Param("page") IPage<Course> page,
|
||||||
@Param("param") LessonParam param);
|
@Param("param") CourseParam param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询全部
|
* 查询全部
|
||||||
@@ -32,6 +32,6 @@ public interface LessonMapper extends BaseMapper<Lesson> {
|
|||||||
* @param param 查询参数
|
* @param param 查询参数
|
||||||
* @return List<User>
|
* @return List<User>
|
||||||
*/
|
*/
|
||||||
List<Lesson> selectListRel(@Param("param") LessonParam param);
|
List<Course> selectListRel(@Param("param") CourseParam param);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<?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.gxwebsoft.booking.mapper.CourseCategoryMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM booking_course_category a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.code != null">
|
||||||
|
AND a.code LIKE CONCAT('%', #{param.code}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.image != null">
|
||||||
|
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.parentId != null">
|
||||||
|
AND a.parent_id = #{param.parentId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.recommend != null">
|
||||||
|
AND a.recommend = #{param.recommend}
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.booking.entity.CourseCategory">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.booking.entity.CourseCategory">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
+29
-10
@@ -1,14 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.gxwebsoft.booking.mapper.LessonMapper">
|
<mapper namespace="com.gxwebsoft.booking.mapper.CourseMapper">
|
||||||
|
|
||||||
<!-- 关联查询sql -->
|
<!-- 关联查询sql -->
|
||||||
<sql id="selectSql">
|
<sql id="selectSql">
|
||||||
SELECT a.*
|
SELECT a.*,b.merchant_name
|
||||||
FROM booking_lesson a
|
FROM booking_course a
|
||||||
|
LEFT JOIN shop_merchant b ON a.merchant_id = b.merchant_id
|
||||||
<where>
|
<where>
|
||||||
<if test="param.lessonId != null">
|
<if test="param.courseId != null">
|
||||||
AND a.lesson_id = #{param.lessonId}
|
AND a.course_id = #{param.courseId}
|
||||||
</if>
|
</if>
|
||||||
<if test="param.lessonName != null">
|
<if test="param.lessonName != null">
|
||||||
AND a.lesson_name LIKE CONCAT('%', #{param.lessonName}, '%')
|
AND a.lesson_name LIKE CONCAT('%', #{param.lessonName}, '%')
|
||||||
@@ -19,24 +20,42 @@
|
|||||||
<if test="param.categoryId != null">
|
<if test="param.categoryId != null">
|
||||||
AND a.category_id = #{param.categoryId}
|
AND a.category_id = #{param.categoryId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.price != null">
|
||||||
|
AND a.price = #{param.price}
|
||||||
|
</if>
|
||||||
<if test="param.teacherId != null">
|
<if test="param.teacherId != null">
|
||||||
AND a.teacher_id = #{param.teacherId}
|
AND a.teacher_id = #{param.teacherId}
|
||||||
</if>
|
</if>
|
||||||
<if test="param.merchantId != null">
|
|
||||||
AND a.merchant_id = #{param.merchantId}
|
|
||||||
</if>
|
|
||||||
<if test="param.startTime != null">
|
<if test="param.startTime != null">
|
||||||
AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%')
|
AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.classPeriod != null">
|
||||||
|
AND a.class_period = #{param.classPeriod}
|
||||||
|
</if>
|
||||||
<if test="param.maxNumber != null">
|
<if test="param.maxNumber != null">
|
||||||
AND a.max_number = #{param.maxNumber}
|
AND a.max_number = #{param.maxNumber}
|
||||||
</if>
|
</if>
|
||||||
<if test="param.address != null">
|
<if test="param.address != null">
|
||||||
AND a.address LIKE CONCAT('%', #{param.address}, '%')
|
AND a.address LIKE CONCAT('%', #{param.address}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.content != null">
|
||||||
|
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.files != null">
|
||||||
|
AND a.files LIKE CONCAT('%', #{param.files}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.ageLimit != null">
|
||||||
|
AND a.age_limit LIKE CONCAT('%', #{param.ageLimit}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.bmTime != null">
|
||||||
|
AND a.bm_time LIKE CONCAT('%', #{param.bmTime}, '%')
|
||||||
|
</if>
|
||||||
<if test="param.comments != null">
|
<if test="param.comments != null">
|
||||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.merchantId != null">
|
||||||
|
AND a.merchant_id = #{param.merchantId}
|
||||||
|
</if>
|
||||||
<if test="param.status != null">
|
<if test="param.status != null">
|
||||||
AND a.status = #{param.status}
|
AND a.status = #{param.status}
|
||||||
</if>
|
</if>
|
||||||
@@ -57,12 +76,12 @@
|
|||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
<!-- 分页查询 -->
|
||||||
<select id="selectPageRel" resultType="com.gxwebsoft.booking.entity.Lesson">
|
<select id="selectPageRel" resultType="com.gxwebsoft.booking.entity.Course">
|
||||||
<include refid="selectSql"></include>
|
<include refid="selectSql"></include>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询全部 -->
|
<!-- 查询全部 -->
|
||||||
<select id="selectListRel" resultType="com.gxwebsoft.booking.entity.Lesson">
|
<select id="selectListRel" resultType="com.gxwebsoft.booking.entity.Course">
|
||||||
<include refid="selectSql"></include>
|
<include refid="selectSql"></include>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.gxwebsoft.booking.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程分类查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-06-08 15:00:52
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "CourseCategoryParam对象", description = "课程分类查询参数")
|
||||||
|
public class CourseCategoryParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品分类ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分类名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分类标识")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分类图片")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上级分类ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否推荐")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer recommend;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1禁用")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
}
|
||||||
+29
-9
@@ -14,40 +14,44 @@ import lombok.EqualsAndHashCode;
|
|||||||
* 课程管理查询参数
|
* 课程管理查询参数
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-04-21 14:31:15
|
* @since 2024-06-08 15:00:52
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
@ApiModel(value = "LessonParam对象", description = "课程管理查询参数")
|
@ApiModel(value = "CourseParam对象", description = "课程管理查询参数")
|
||||||
public class LessonParam extends BaseParam {
|
public class CourseParam extends BaseParam {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ApiModelProperty(value = "ID")
|
@ApiModelProperty(value = "ID")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer lessonId;
|
private Integer courseId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "课程名称")
|
@ApiModelProperty(value = "课程名称")
|
||||||
private String lessonName;
|
private String lessonName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "图标")
|
@ApiModelProperty(value = "封面图")
|
||||||
private String image;
|
private String image;
|
||||||
|
|
||||||
@ApiModelProperty(value = "分类ID")
|
@ApiModelProperty(value = "分类ID")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer categoryId;
|
private Integer categoryId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课程价格")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
@ApiModelProperty(value = "老师ID")
|
@ApiModelProperty(value = "老师ID")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer teacherId;
|
private Integer teacherId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "商户ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer merchantId;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "上课时间")
|
@ApiModelProperty(value = "上课时间")
|
||||||
private String startTime;
|
private String startTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课时")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer classPeriod;
|
||||||
|
|
||||||
@ApiModelProperty(value = "报名人数上限")
|
@ApiModelProperty(value = "报名人数上限")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer maxNumber;
|
private Integer maxNumber;
|
||||||
@@ -55,9 +59,25 @@ public class LessonParam extends BaseParam {
|
|||||||
@ApiModelProperty(value = "上课地点")
|
@ApiModelProperty(value = "上课地点")
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "详细介绍")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课程相册")
|
||||||
|
private String files;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年龄限制")
|
||||||
|
private String ageLimit;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "报名时间")
|
||||||
|
private String bmTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "备注")
|
@ApiModelProperty(value = "备注")
|
||||||
private String comments;
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer merchantId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "状态")
|
@ApiModelProperty(value = "状态")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer status;
|
private Integer status;
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.booking.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.booking.entity.CourseCategory;
|
||||||
|
import com.gxwebsoft.booking.param.CourseCategoryParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程分类Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-06-08 15:00:52
|
||||||
|
*/
|
||||||
|
public interface CourseCategoryService extends IService<CourseCategory> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<CourseCategory>
|
||||||
|
*/
|
||||||
|
PageResult<CourseCategory> pageRel(CourseCategoryParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CourseCategory>
|
||||||
|
*/
|
||||||
|
List<CourseCategory> listRel(CourseCategoryParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id 商品分类ID
|
||||||
|
* @return CourseCategory
|
||||||
|
*/
|
||||||
|
CourseCategory getByIdRel(Integer id);
|
||||||
|
|
||||||
|
}
|
||||||
+11
-11
@@ -2,8 +2,8 @@ package com.gxwebsoft.booking.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
import com.gxwebsoft.booking.entity.Lesson;
|
import com.gxwebsoft.booking.entity.Course;
|
||||||
import com.gxwebsoft.booking.param.LessonParam;
|
import com.gxwebsoft.booking.param.CourseParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -11,32 +11,32 @@ import java.util.List;
|
|||||||
* 课程管理Service
|
* 课程管理Service
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-04-21 14:31:15
|
* @since 2024-06-08 15:00:52
|
||||||
*/
|
*/
|
||||||
public interface LessonService extends IService<Lesson> {
|
public interface CourseService extends IService<Course> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页关联查询
|
* 分页关联查询
|
||||||
*
|
*
|
||||||
* @param param 查询参数
|
* @param param 查询参数
|
||||||
* @return PageResult<Lesson>
|
* @return PageResult<Course>
|
||||||
*/
|
*/
|
||||||
PageResult<Lesson> pageRel(LessonParam param);
|
PageResult<Course> pageRel(CourseParam param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联查询全部
|
* 关联查询全部
|
||||||
*
|
*
|
||||||
* @param param 查询参数
|
* @param param 查询参数
|
||||||
* @return List<Lesson>
|
* @return List<Course>
|
||||||
*/
|
*/
|
||||||
List<Lesson> listRel(LessonParam param);
|
List<Course> listRel(CourseParam param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询
|
* 根据id查询
|
||||||
*
|
*
|
||||||
* @param lessonId ID
|
* @param courseId ID
|
||||||
* @return Lesson
|
* @return Course
|
||||||
*/
|
*/
|
||||||
Lesson getByIdRel(Integer lessonId);
|
Course getByIdRel(Integer courseId);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.booking.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.booking.mapper.CourseCategoryMapper;
|
||||||
|
import com.gxwebsoft.booking.service.CourseCategoryService;
|
||||||
|
import com.gxwebsoft.booking.entity.CourseCategory;
|
||||||
|
import com.gxwebsoft.booking.param.CourseCategoryParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程分类Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-06-08 15:00:52
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CourseCategoryServiceImpl extends ServiceImpl<CourseCategoryMapper, CourseCategory> implements CourseCategoryService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<CourseCategory> pageRel(CourseCategoryParam param) {
|
||||||
|
PageParam<CourseCategory, CourseCategoryParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<CourseCategory> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CourseCategory> listRel(CourseCategoryParam param) {
|
||||||
|
List<CourseCategory> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<CourseCategory, CourseCategoryParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CourseCategory getByIdRel(Integer id) {
|
||||||
|
CourseCategoryParam param = new CourseCategoryParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.booking.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.booking.mapper.CourseMapper;
|
||||||
|
import com.gxwebsoft.booking.service.CourseService;
|
||||||
|
import com.gxwebsoft.booking.entity.Course;
|
||||||
|
import com.gxwebsoft.booking.param.CourseParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程管理Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-06-08 15:00:52
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> implements CourseService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<Course> pageRel(CourseParam param) {
|
||||||
|
PageParam<Course, CourseParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<Course> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Course> listRel(CourseParam param) {
|
||||||
|
List<Course> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<Course, CourseParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Course getByIdRel(Integer courseId) {
|
||||||
|
CourseParam param = new CourseParam();
|
||||||
|
param.setCourseId(courseId);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package com.gxwebsoft.booking.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.booking.mapper.LessonMapper;
|
|
||||||
import com.gxwebsoft.booking.service.LessonService;
|
|
||||||
import com.gxwebsoft.booking.entity.Lesson;
|
|
||||||
import com.gxwebsoft.booking.param.LessonParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 课程管理Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-04-21 14:31:15
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class LessonServiceImpl extends ServiceImpl<LessonMapper, Lesson> implements LessonService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<Lesson> pageRel(LessonParam param) {
|
|
||||||
PageParam<Lesson, LessonParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
List<Lesson> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Lesson> listRel(LessonParam param) {
|
|
||||||
List<Lesson> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<Lesson, LessonParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Lesson getByIdRel(Integer lessonId) {
|
|
||||||
LessonParam param = new LessonParam();
|
|
||||||
param.setLessonId(lessonId);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -25,6 +25,9 @@
|
|||||||
<if test="param.categoryId != null">
|
<if test="param.categoryId != null">
|
||||||
AND a.category_id = #{param.categoryId}
|
AND a.category_id = #{param.categoryId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.parentId != null">
|
||||||
|
AND a.category_id IN (SELECT category_id FROM shop_goods_category WHERE parent_id=#{param.parentId})
|
||||||
|
</if>
|
||||||
<if test="param.categoryParent != null">
|
<if test="param.categoryParent != null">
|
||||||
AND a.category_parent LIKE CONCAT('%', #{param.categoryParent}, '%')
|
AND a.category_parent LIKE CONCAT('%', #{param.categoryParent}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.gxwebsoft.shop.param;
|
package com.gxwebsoft.shop.param;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
import com.gxwebsoft.common.core.web.BaseParam;
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
@@ -87,4 +89,9 @@ public class GoodsParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer deleted;
|
private Integer deleted;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父级分类ID")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,9 @@ public class BookingGenerator {
|
|||||||
// "booking_user_invoice",
|
// "booking_user_invoice",
|
||||||
// "booking_user_card",
|
// "booking_user_card",
|
||||||
// "booking_user_card_log",
|
// "booking_user_card_log",
|
||||||
"booking_item"
|
// "booking_item",
|
||||||
|
"booking_course",
|
||||||
|
"booking_course_category"
|
||||||
};
|
};
|
||||||
// 需要去除的表前缀
|
// 需要去除的表前缀
|
||||||
private static final String[] TABLE_PREFIX = new String[]{
|
private static final String[] TABLE_PREFIX = new String[]{
|
||||||
|
|||||||
Reference in New Issue
Block a user