beetlsql3-dev
xuliangtong 2 years ago
parent aa973dffb5
commit e16f5f1111

@ -24,4 +24,6 @@ public interface HandsOnSimulationTasksDao extends BaseMapper<HandsOnSimulationT
int updateGivenByIds(HandsOnSimulationTasksQuery handsOnSimulationTasksQuery); int updateGivenByIds(HandsOnSimulationTasksQuery handsOnSimulationTasksQuery);
List<HandsOnSimulationTasks> getByIds(String ids); List<HandsOnSimulationTasks> getByIds(String ids);
List<HandsOnSimulationTasks> getValuesByQuery(HandsOnSimulationTasksQuery handsOnSimulationTasksQuery); List<HandsOnSimulationTasks> getValuesByQuery(HandsOnSimulationTasksQuery handsOnSimulationTasksQuery);
List<HandsOnSimulationTasks> queryObjectByHandsOnIds(List<Long> handsOnIds);
} }

@ -42,6 +42,9 @@ public class HandsOn extends BaseEntity{
private String handsOnRecommend ; private String handsOnRecommend ;
//开课ID
private Long teacherOpenCourseId;
private Date addTime; private Date addTime;
private Long orgId; private Long orgId;
@ -149,5 +152,11 @@ public class HandsOn extends BaseEntity{
this.handsOnRecommend = handsOnRecommend; this.handsOnRecommend = handsOnRecommend;
} }
public Long getTeacherOpenCourseId() {
return teacherOpenCourseId;
}
public void setTeacherOpenCourseId(Long teacherOpenCourseId) {
this.teacherOpenCourseId = teacherOpenCourseId;
}
} }

@ -6,6 +6,7 @@ import java.text.DecimalFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.stream.Collectors;
import cn.jlw.util.ToolUtils; import cn.jlw.util.ToolUtils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
@ -16,6 +17,7 @@ import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.admin.core.web.JsonReturnCode; import com.ibeetl.admin.core.web.JsonReturnCode;
import com.ibeetl.jlw.dao.HandsOnDao; import com.ibeetl.jlw.dao.HandsOnDao;
import com.ibeetl.jlw.entity.HandsOn; import com.ibeetl.jlw.entity.HandsOn;
import com.ibeetl.jlw.entity.HandsOnSimulationTasks;
import com.ibeetl.jlw.web.query.HandsOnQuery; import com.ibeetl.jlw.web.query.HandsOnQuery;
import com.ibeetl.jlw.entity.FileEntity; import com.ibeetl.jlw.entity.FileEntity;
@ -46,6 +48,7 @@ import javax.annotation.Resource;
public class HandsOnService extends CoreBaseService<HandsOn>{ public class HandsOnService extends CoreBaseService<HandsOn>{
@Resource private HandsOnDao handsOnDao; @Resource private HandsOnDao handsOnDao;
@Resource private HandsOnSimulationTasksService handsOnSimulationTasksService;
public PageQuery<HandsOn>queryByCondition(PageQuery query){ public PageQuery<HandsOn>queryByCondition(PageQuery query){
PageQuery ret = handsOnDao.queryByCondition(query); PageQuery ret = handsOnDao.queryByCondition(query);
@ -156,4 +159,22 @@ public class HandsOnService extends CoreBaseService<HandsOn>{
} }
} }
/**
* -
* @param teacherOpenCourseId
*/
public void getHandonListByTeacherOpenCourseId(Long teacherOpenCourseId) {
HandsOnQuery handsOnQuery = new HandsOnQuery();
handsOnQuery.setTeacherOpenCourseId(teacherOpenCourseId);
List<HandsOn> handsOnList = handsOnDao.getValuesByQuery(handsOnQuery);
List<Long> handsOnIds = handsOnList.stream().map(HandsOn::getHandsOnId).distinct().collect(Collectors.toList());
List<HandsOnSimulationTasks> handsOnSimulationTasks = handsOnSimulationTasksService.queryObjectByHandsOnIds(handsOnIds);
for (HandsOn handsOn : handsOnList) {
List<HandsOnSimulationTasks> collect = handsOnSimulationTasks.stream().filter(v -> v.getHandsOnId().equals(handsOn.getHandsOnId())).collect(Collectors.toList());
handsOn.set("handsOnSimulationTasks", collect);
}
}
} }

@ -158,4 +158,7 @@ public class HandsOnSimulationTasksService extends CoreBaseService<HandsOnSimula
} }
} }
public List<HandsOnSimulationTasks> queryObjectByHandsOnIds(List<Long> handsOnIds) {
return handsOnSimulationTasksDao.queryObjectByHandsOnIds(handsOnIds);
}
} }

@ -208,4 +208,17 @@ public class HandsOnController{
} }
/**
* -
* @param teacherOpenCourseId ID
* @return
*/
@PostMapping("getHandonListByTeacherOpenCourseId")
public JsonResult getHandonListByTeacherOpenCourseId(Long teacherOpenCourseId) {
handsOnService.getHandonListByTeacherOpenCourseId(teacherOpenCourseId);
return JsonResult.success();
}
} }

@ -19,6 +19,8 @@ public class HandsOnQuery extends PageParam {
@NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class) @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class)
@Query(name = "实操主键", display = false) @Query(name = "实操主键", display = false)
private Long handsOnId; private Long handsOnId;
@Query(name = "开课ID", display = false)
private Long teacherOpenCourseId;
@Query(name = "归属课程", display = false) @Query(name = "归属课程", display = false)
private Long courseInfoId; private Long courseInfoId;
@Query(name = "归属章节", display = false) @Query(name = "归属章节", display = false)
@ -103,6 +105,14 @@ public class HandsOnQuery extends PageParam {
this.handsOnRecommend = handsOnRecommend; this.handsOnRecommend = handsOnRecommend;
} }
public Long getTeacherOpenCourseId() {
return teacherOpenCourseId;
}
public void setTeacherOpenCourseId(Long teacherOpenCourseId) {
this.teacherOpenCourseId = teacherOpenCourseId;
}
public HandsOn pojo(){ public HandsOn pojo(){
HandsOn pojo = new HandsOn(); HandsOn pojo = new HandsOn();
pojo.setHandsOnId(this.getHandsOnId()); pojo.setHandsOnId(this.getHandsOnId());
@ -114,6 +124,7 @@ public class HandsOnQuery extends PageParam {
pojo.setOrgId(this.getOrgId()); pojo.setOrgId(this.getOrgId());
pojo.setUserId(this.getUserId()); pojo.setUserId(this.getUserId());
pojo.setTrainingData(this.getTrainingData()); pojo.setTrainingData(this.getTrainingData());
pojo.setTeacherOpenCourseId(this.getTeacherOpenCourseId());
return pojo; return pojo;
} }

@ -13,6 +13,9 @@ queryByCondition
@if(!isEmpty(handsOnId)){ @if(!isEmpty(handsOnId)){
and t.hands_on_id =#handsOnId# and t.hands_on_id =#handsOnId#
@} @}
@if(!isEmpty(teacherOpenCourseId)){
and t.teacher_open_course_id =#teacherOpenCourseId#
@}
@if(!isEmpty(courseInfoId)){ @if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId# and t.course_info_id =#courseInfoId#
@} @}
@ -52,6 +55,9 @@ queryByConditionQuery
@if(!isEmpty(handsOnRecommend)){ @if(!isEmpty(handsOnRecommend)){
and t.hands_on_recommend =#handsOnRecommend# and t.hands_on_recommend =#handsOnRecommend#
@} @}
@if(!isEmpty(teacherOpenCourseId)){
and t.teacher_open_course_id =#teacherOpenCourseId#
@}
@ -134,6 +140,9 @@ getHandsOnValues
@if(!isEmpty(handsOnRecommend)){ @if(!isEmpty(handsOnRecommend)){
and t.hands_on_recommend =#handsOnRecommend# and t.hands_on_recommend =#handsOnRecommend#
@} @}
@if(!isEmpty(teacherOpenCourseId)){
and t.teacher_open_course_id =#teacherOpenCourseId#
@}
getValuesByQuery getValuesByQuery
@ -159,6 +168,20 @@ getValuesByQuery
@if(!isEmpty(handsOnRecommend)){ @if(!isEmpty(handsOnRecommend)){
and t.hands_on_recommend =#handsOnRecommend# and t.hands_on_recommend =#handsOnRecommend#
@} @}
@if(!isEmpty(teacherOpenCourseId)){
and t.teacher_open_course_id =#teacherOpenCourseId#
@}
queryObjectByHandsOnIds
===
* 根据开课ID查询
select t.*
from hands_on t
where t.teacher_open_course_id in( #join(handsOnIds)#)

Loading…
Cancel
Save