课程太湖云医关联
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
package com.peanut.modules.common.dao;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.peanut.modules.common.entity.CourseToTalent;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface CourseToTalentDao extends MPJBaseMapper<CourseToTalent> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.peanut.modules.common.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("course_to_talent")
|
||||||
|
public class CourseToTalent {
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private Integer courseId;
|
||||||
|
|
||||||
|
private Integer talentId;
|
||||||
|
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private CourseEntity courseEntity;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private TaihuTalent taihuTalent;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -45,6 +45,9 @@ public class TaihuTalent implements Serializable {
|
|||||||
//预约
|
//预约
|
||||||
private String reservation;
|
private String reservation;
|
||||||
|
|
||||||
|
//0太湖云医1名医
|
||||||
|
private int type;
|
||||||
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
@TableLogic
|
@TableLogic
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.peanut.modules.common.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.modules.common.entity.CourseToTalent;
|
||||||
|
|
||||||
|
public interface CourseToTalentService extends IService<CourseToTalent> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.peanut.modules.common.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.peanut.modules.common.dao.CourseToTalentDao;
|
||||||
|
import com.peanut.modules.common.entity.CourseToTalent;
|
||||||
|
import com.peanut.modules.common.service.CourseToTalentService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service("commonCourseToTalentService")
|
||||||
|
public class CourseToTalentServiceImpl extends ServiceImpl<CourseToTalentDao, CourseToTalent> implements CourseToTalentService {
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.peanut.modules.taihumed.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
|
import com.peanut.common.utils.R;
|
||||||
|
import com.peanut.modules.common.entity.CourseEntity;
|
||||||
|
import com.peanut.modules.common.entity.CourseToTalent;
|
||||||
|
import com.peanut.modules.common.entity.TaihuTalent;
|
||||||
|
import com.peanut.modules.common.service.CourseToTalentService;
|
||||||
|
import com.peanut.modules.common.service.TaihuTalentService;
|
||||||
|
import com.peanut.modules.master.service.CourseService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RestController("taihumedCourse")
|
||||||
|
@RequestMapping("taihumed/course")
|
||||||
|
public class CourseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CourseToTalentService courseToTalentService;
|
||||||
|
@Autowired
|
||||||
|
private TaihuTalentService taihuTalentService;
|
||||||
|
@Autowired
|
||||||
|
private CourseService courseService;
|
||||||
|
|
||||||
|
//名医精彩列表
|
||||||
|
@RequestMapping("/getCourseToTalentList")
|
||||||
|
public R getCourseToTalentList(@RequestBody Map<String,Object> params){
|
||||||
|
List res = new ArrayList();
|
||||||
|
MPJLambdaWrapper<CourseToTalent> wrapper = new MPJLambdaWrapper();
|
||||||
|
wrapper.leftJoin(CourseEntity.class,CourseEntity::getId,CourseToTalent::getCourseId);
|
||||||
|
wrapper.leftJoin(TaihuTalent.class,TaihuTalent::getId,CourseToTalent::getTalentId);
|
||||||
|
wrapper.selectAll(CourseToTalent.class);
|
||||||
|
wrapper.like(StringUtils.isNotEmpty(params.get("userName").toString()),TaihuTalent::getName,params.get("userName"));
|
||||||
|
wrapper.like(StringUtils.isNotEmpty(params.get("courseName").toString()),CourseEntity::getTitle,params.get("courseName"));
|
||||||
|
wrapper.orderByAsc(CourseToTalent::getSort);
|
||||||
|
Page<CourseToTalent> pageRes = courseToTalentService.page(new Page<>(Long.parseLong(params.get("current").toString())
|
||||||
|
, Long.parseLong(params.get("limit").toString())),wrapper);
|
||||||
|
for (CourseToTalent courseToTalent:pageRes.getRecords()){
|
||||||
|
courseToTalent.setCourseEntity(courseService.getById(courseToTalent.getCourseId()));
|
||||||
|
courseToTalent.setTaihuTalent(taihuTalentService.getById(courseToTalent.getTalentId()));
|
||||||
|
}
|
||||||
|
return R.ok().put("pageRes",pageRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user