1. 修改代码生成模板;

2. 开课互动;
beetlsql3-dev
Mlxa0324
parent 7360af0c88
commit 9b178ba05c

@ -31,6 +31,7 @@ public interface ${entity.name}Dao extends BaseMapper<${entity.name}>{
int updateGivenByIds(${entity.name}Query ${entity.code}Query);
List<${entity.name}> getByIds(String ids);
List<${entity.name}> getValuesByQuery(${entity.name}Query ${entity.code}Query);
List<${entity.name}> getValuesByQueryNotWithPermission(${entity.name}Query ${entity.code}Query);
@if(entity.includeExcel){
List<Map<String,Object>>getExcelValues(${entity.name}Query ${entity.code}Query);
@}

@ -155,6 +155,10 @@ public class ${entity.name}Service extends CoreBaseService<${entity.name}>{
return ${entity.code}Dao.getValuesByQuery(${entity.code}Query);
}
public List<${entity.name}> getValuesByQueryNotWithPermission (${entity.name}Query ${entity.code}Query){
return ${entity.code}Dao.getValuesByQueryNotWithPermission(${entity.code}Query);
}
public ${entity.name} getInfo (Long ${entity.idAttribute.name}){
${entity.name}Query ${entity.code}Query = new ${entity.name}Query();
${entity.code}Query.set${upperFirst(entity.idAttribute.name)}(${entity.idAttribute.name});

@ -186,6 +186,38 @@ getValuesByQuery
@}
getValuesByQueryNotWithPermission
===
* 根据不为空的参数进行查询(不包含权限)
select t.*
from ${entity.tableName} t
where 1=1
@for(attr in attrs){
@if(null != attr.status){
\@if(isEmpty(${attr.name}) && isEmpty(${attr.name}Plural)){
and t.${attr.colName} != 2
\@}else{
\@if(!isEmpty(${attr.name})){
and t.${attr.colName} =#${attr.name}#
\@}else if(!isEmpty(${attr.name}Plural)){
and find_in_set(t.${attr.colName},#${attr.name}Plural#)
\@}
\@}
@}else{
\@if(!isEmpty(${attr.name})){
and t.${attr.colName} =#${attr.name}#
\@}
@if(attr.isChoice || attr.isOtherId){
\@if(!isEmpty(${attr.name}Plural)){
and find_in_set(t.${attr.colName},#${attr.name}Plural#)
\@}
@}
@}
@}
@if(entity.includeExcel){

@ -24,4 +24,5 @@ public interface TeacherOpenCourseChatLogDao extends BaseMapper<TeacherOpenCours
int updateGivenByIds(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery);
List<TeacherOpenCourseChatLog> getByIds(String ids);
List<TeacherOpenCourseChatLog> getValuesByQuery(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery);
List<TeacherOpenCourseChatLog> getValuesByQueryNotWithPermission(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery);
}

@ -3,16 +3,23 @@ package com.ibeetl.jlw.entity;
import com.ibeetl.admin.core.annotation.Dict;
import com.ibeetl.admin.core.entity.BaseEntity;
import com.ibeetl.admin.core.util.ValidateConfig;
import lombok.Data;
import org.beetl.sql.annotation.entity.AssignID;
import org.beetl.sql.fetch.annotation.Fetch;
import org.beetl.sql.fetch.annotation.FetchSql;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/*
* --
* gen by Spring Boot2 Admin 2022-09-18
*/
@Data
// 递归数据。最多支持1000层级再深层级的就无法查询了
@Fetch(level=1000)
public class TeacherOpenCourseChatLog extends BaseEntity{
//课程开课--讨论-日志ID
@ -22,9 +29,15 @@ public class TeacherOpenCourseChatLog extends BaseEntity{
private Long teacherOpenCourseChatLogId ;
//上级ID
//上级ID, 默认0L 顶级0L
private Long teacherOpenCourseChatLogParentId ;
private Long teacherOpenCourseChatLogParentId = 0L;
@FetchSql("select * from teacher_open_course_chat_log t " +
"where t.teacher_open_course_id = #teacherOpenCourseId# " +
"and t.teacher_open_course_chat_log_parent_id = #teacherOpenCourseChatLogId# " +
"and t.teacher_open_course_chat_log_parent_id != 0")
private List<TeacherOpenCourseChatLog> children;
//课程开课ID
@Dict(type="teacher_open_course.teacher_open_course_title.teacher_open_course_status=1")
@ -78,190 +91,4 @@ public class TeacherOpenCourseChatLog extends BaseEntity{
private Long userId ;
public TeacherOpenCourseChatLog(){
}
/**---ID
*@return
*/
public Long getTeacherOpenCourseChatLogId(){
return teacherOpenCourseChatLogId;
}
/**---ID
*@param teacherOpenCourseChatLogId
*/
public void setTeacherOpenCourseChatLogId(Long teacherOpenCourseChatLogId){
this.teacherOpenCourseChatLogId = teacherOpenCourseChatLogId;
}
/**ID
*@return
*/
public Long getTeacherOpenCourseChatLogParentId(){
return teacherOpenCourseChatLogParentId;
}
/**ID
*@param teacherOpenCourseChatLogParentId
*/
public void setTeacherOpenCourseChatLogParentId(Long teacherOpenCourseChatLogParentId){
this.teacherOpenCourseChatLogParentId = teacherOpenCourseChatLogParentId;
}
/**ID
*@return
*/
public Long getTeacherOpenCourseId(){
return teacherOpenCourseId;
}
/**ID
*@param teacherOpenCourseId
*/
public void setTeacherOpenCourseId(Long teacherOpenCourseId){
this.teacherOpenCourseId = teacherOpenCourseId;
}
/**ID
*@return
*/
public String getSchoolClassIds(){
return schoolClassIds;
}
/**ID
*@param schoolClassIds
*/
public void setSchoolClassIds(String schoolClassIds){
this.schoolClassIds = schoolClassIds;
}
/**ID
*@return
*/
public Long getTeacherId(){
return teacherId;
}
/**ID
*@param teacherId
*/
public void setTeacherId(Long teacherId){
this.teacherId = teacherId;
}
/**ID
*@return
*/
public Long getStudentId(){
return studentId;
}
/**ID
*@param studentId
*/
public void setStudentId(Long studentId){
this.studentId = studentId;
}
/**
*@return
*/
public String getChatContent(){
return chatContent;
}
/**
*@param chatContent
*/
public void setChatContent(String chatContent){
this.chatContent = chatContent;
}
/**
*@return
*/
public String getKeywords(){
return keywords;
}
/**
*@param keywords
*/
public void setKeywords(String keywords){
this.keywords = keywords;
}
/**
*@return
*/
public BigDecimal getStudentScore(){
return studentScore;
}
/**
*@param studentScore
*/
public void setStudentScore(BigDecimal studentScore){
this.studentScore = studentScore;
}
/**
*@return
*/
public String getChatFiles(){
return chatFiles;
}
/**
*@param chatFiles
*/
public void setChatFiles(String chatFiles){
this.chatFiles = chatFiles;
}
/** 1 2
*@return
*/
public Integer getTeacherOpenCourseChatLogStatus(){
return teacherOpenCourseChatLogStatus;
}
/** 1 2
*@param teacherOpenCourseChatLogStatus
*/
public void setTeacherOpenCourseChatLogStatus(Integer teacherOpenCourseChatLogStatus){
this.teacherOpenCourseChatLogStatus = teacherOpenCourseChatLogStatus;
}
/**
*@return
*/
public Date getTeacherOpenCourseChatLogAddTime(){
return teacherOpenCourseChatLogAddTime;
}
/**
*@param teacherOpenCourseChatLogAddTime
*/
public void setTeacherOpenCourseChatLogAddTime(Date teacherOpenCourseChatLogAddTime){
this.teacherOpenCourseChatLogAddTime = teacherOpenCourseChatLogAddTime;
}
/**ID
*@return
*/
public Long getOrgId(){
return orgId;
}
/**ID
*@param orgId
*/
public void setOrgId(Long orgId){
this.orgId = orgId;
}
/**ID
*@return
*/
public Long getUserId(){
return userId;
}
/**ID
*@param userId
*/
public void setUserId(Long userId){
this.userId = userId;
}
}

@ -38,6 +38,41 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
return ret;
}
// public PageQuery<TeacherOpenCourseChatLog> queryTreeListByCondition(PageQuery query){
// PageQuery ret = teacherOpenCourseChatLogDao.queryByCondition(query);
//
// // 上级ID集合
// String chatLogParentIds = ((List<TeacherOpenCourseChatLog>) ret.getList()).stream()
// .map(chatLog -> {
// // 取当前的ID作为上级ID
// Long parentId = chatLog.getTeacherOpenCourseChatLogId();
// if (null != parentId && 0L != parentId) {
// return String.valueOf(parentId);
// }
// return "";
// }).filter(StringUtils::isNotBlank).collect(joining(","));
//
// getDeepListByParentId(chatLogParentIds);
// return ret;
// }
//
// /**
// * 为了节省性能一次性查询多个ID
// * @param teacherOpenCourseChatLogParentIds
// * @return
// */
// public Map<Long, List<TeacherOpenCourseChatLog>> getDeepListByParentId(String teacherOpenCourseChatLogParentIds) {
//
// // 查询多个上级ID
// TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery = new TeacherOpenCourseChatLogQuery();
// teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogIdPlural(teacherOpenCourseChatLogParentIds);
// teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogStatus(1);
// List<TeacherOpenCourseChatLog> list = teacherOpenCourseChatLogDao.getValuesByQueryNotWithPermission(teacherOpenCourseChatLogQuery);
//
// return Optional.ofNullable(list).orElse(Lists.emptyList()).stream()
// .collect(groupingBy(TeacherOpenCourseChatLog::getTeacherOpenCourseChatLogParentId));
// }
public PageQuery<TeacherOpenCourseChatLog>queryByConditionQuery(PageQuery query){
PageQuery ret = teacherOpenCourseChatLogDao.queryByConditionQuery(query);
queryListAfter(ret.getList());

@ -120,10 +120,12 @@ public class TeacherOpenCourseChatLogController{
return JsonResult.success(page);
}
// @PostMapping(MODEL + "/treeList.json")
@PostMapping(MODEL + "/treeList.json")
@Function("teacherOpenCourseChatLog.query")
public JsonResult<PageQuery> treeList(TeacherOpenCourseChatLogQuery condition, @SCoreUser CoreUser coreUser) {
PageQuery page = condition.getPageQuery();
// 只查询顶级的列表
condition.setTeacherOpenCourseChatLogParentId(0L);
teacherOpenCourseChatLogService.queryByCondition(page);
return JsonResult.success(page);
}

@ -86,7 +86,7 @@ queryByCondition
and find_in_set(t.user_id,#userIdPlural#)
@}
@if(!isEmpty(teacherOpenCourseChatLogParentId)){
order by create_time desc
order by teacher_open_course_chat_log_add_time desc
@}
@ -431,5 +431,83 @@ getValuesByQuery
and find_in_set(t.user_id,#userIdPlural#)
@}
getValuesByQueryNotWithPermission
===
* 根据不为空的参数进行查询(不包含权限)
select t.*
from teacher_open_course_chat_log t
where 1=1
@if(!isEmpty(teacherOpenCourseChatLogId)){
and t.teacher_open_course_chat_log_id =#teacherOpenCourseChatLogId#
@}
@if(!isEmpty(teacherOpenCourseChatLogIdPlural)){
and find_in_set(t.teacher_open_course_chat_log_id,#teacherOpenCourseChatLogIdPlural#)
@}
@if(!isEmpty(teacherOpenCourseChatLogParentId)){
and t.teacher_open_course_chat_log_parent_id =#teacherOpenCourseChatLogParentId#
@}
@if(!isEmpty(teacherOpenCourseChatLogParentIdPlural)){
and find_in_set(t.teacher_open_course_chat_log_parent_id,#teacherOpenCourseChatLogParentIdPlural#)
@}
@if(!isEmpty(teacherOpenCourseId)){
and t.teacher_open_course_id =#teacherOpenCourseId#
@}
@if(!isEmpty(teacherOpenCourseIdPlural)){
and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#)
@}
@if(!isEmpty(schoolClassIds)){
and t.school_class_ids =#schoolClassIds#
@}
@if(!isEmpty(teacherId)){
and t.teacher_id =#teacherId#
@}
@if(!isEmpty(teacherIdPlural)){
and find_in_set(t.teacher_id,#teacherIdPlural#)
@}
@if(!isEmpty(studentId)){
and t.student_id =#studentId#
@}
@if(!isEmpty(studentIdPlural)){
and find_in_set(t.student_id,#studentIdPlural#)
@}
@if(!isEmpty(chatContent)){
and t.chat_content =#chatContent#
@}
@if(!isEmpty(keywords)){
and t.keywords =#keywords#
@}
@if(!isEmpty(studentScore)){
and t.student_score =#studentScore#
@}
@if(!isEmpty(chatFiles)){
and t.chat_files =#chatFiles#
@}
@if(isEmpty(teacherOpenCourseChatLogStatus) && isEmpty(teacherOpenCourseChatLogStatusPlural)){
and t.teacher_open_course_chat_log_status != 2
@}else{
@if(!isEmpty(teacherOpenCourseChatLogStatus)){
and t.teacher_open_course_chat_log_status =#teacherOpenCourseChatLogStatus#
@}else if(!isEmpty(teacherOpenCourseChatLogStatusPlural)){
and find_in_set(t.teacher_open_course_chat_log_status,#teacherOpenCourseChatLogStatusPlural#)
@}
@}
@if(!isEmpty(teacherOpenCourseChatLogAddTime)){
and t.teacher_open_course_chat_log_add_time =#teacherOpenCourseChatLogAddTime#
@}
@if(!isEmpty(orgId)){
and t.org_id =#orgId#
@}
@if(!isEmpty(orgIdPlural)){
and find_in_set(t.org_id,#orgIdPlural#)
@}
@if(!isEmpty(userId)){
and t.user_id =#userId#
@}
@if(!isEmpty(userIdPlural)){
and find_in_set(t.user_id,#userIdPlural#)
@}

@ -22,7 +22,8 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
height : Lib.getTableHeight(1),
cellMinWidth: 100,
method : 'post',
url : Common.ctxPath + '/jlw/teacherOpenCourseChatLog/list.json' // 数据接口
// url : Common.ctxPath + '/jlw/teacherOpenCourseChatLog/list.json' // 数据接口
url : Common.ctxPath + '/jlw/teacherOpenCourseChatLog/treeList.json' // 数据接口
,page : Lib.tablePage // 开启分页
,toolbar: '#toolbar_teacherOpenCourseChatLog' //自定义头部左侧工具栏
,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏

Loading…
Cancel
Save