diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index ad0b5bf1a..943ed301b 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -69,6 +69,7 @@ "vue-cropper": "0.4.9", "vue-quill-editor": "3.0.6", "vue-router": "3.0.2", + "vue-simple-uploader": "^0.7.4", "vue-splitpane": "1.0.4", "vuedraggable": "2.20.0", "vuex": "3.1.0" diff --git a/ruoyi-ui/src/api/benyi_train/lecturer.js b/ruoyi-ui/src/api/benyi_train/lecturer.js index 33b6bdb6f..a5d6da639 100644 --- a/ruoyi-ui/src/api/benyi_train/lecturer.js +++ b/ruoyi-ui/src/api/benyi_train/lecturer.js @@ -9,6 +9,15 @@ export function listLecturer(query) { }) } +// 查询讲师列表 +export function listAllLecturer(query) { + return request({ + url: '/benyi/lecturer/listAll', + method: 'get', + params: query + }) +} + // 查询讲师详细 export function getLecturer(id) { return request({ diff --git a/ruoyi-ui/src/api/benyi_train/video.js b/ruoyi-ui/src/api/benyi_train/video.js index a14fca122..5d522bc49 100644 --- a/ruoyi-ui/src/api/benyi_train/video.js +++ b/ruoyi-ui/src/api/benyi_train/video.js @@ -26,6 +26,15 @@ export function addVideo(data) { }) } +// 获取七牛云token +export function getQiNiuToken(data) { + return request({ + url: '/common/getQiNiuToken', + method: 'post', + data: data + }) +} + // 修改培训 export function updateVideo(data) { return request({ diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js index c379aab41..6b3c53cf8 100644 --- a/ruoyi-ui/src/main.js +++ b/ruoyi-ui/src/main.js @@ -24,6 +24,7 @@ import Pagination from "@/components/Pagination"; import Video from 'video.js' import 'video.js/dist/video-js.css' + // 全局方法挂载 Vue.prototype.getDicts = getDicts Vue.prototype.getConfigKey = getConfigKey diff --git a/ruoyi-ui/src/views/benyi_train/lecturer/index.vue b/ruoyi-ui/src/views/benyi_train/lecturer/index.vue index ea3bd612b..dac0daff3 100644 --- a/ruoyi-ui/src/views/benyi_train/lecturer/index.vue +++ b/ruoyi-ui/src/views/benyi_train/lecturer/index.vue @@ -98,14 +98,14 @@ - + - + - + - + + + - - - - - 删除 - - 导出 - - - - + + - - + + \ No newline at end of file + + + \ No newline at end of file diff --git a/ruoyi/pom.xml b/ruoyi/pom.xml index 52eaa7e40..3d3586f10 100644 --- a/ruoyi/pom.xml +++ b/ruoyi/pom.xml @@ -249,6 +249,32 @@ 5.1.5.RELEASE + + + com.squareup.okhttp3 + okhttp + 3.10.0 + + + + + com.qiniu + qiniu-java-sdk + 7.2.8 + + + okhttp + com.squareup.okhttp3 + + + + + + + com.google.code.gson + gson + + diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/ByFileUtil.java b/ruoyi/src/main/java/com/ruoyi/common/utils/ByFileUtil.java new file mode 100644 index 000000000..9c3936d44 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/common/utils/ByFileUtil.java @@ -0,0 +1,72 @@ +package com.ruoyi.common.utils; + +import com.google.gson.Gson; +import com.qiniu.common.QiniuException; +import com.qiniu.common.Zone; +import com.qiniu.http.Response; +import com.qiniu.storage.Configuration; +import com.qiniu.storage.UploadManager; +import com.qiniu.storage.model.DefaultPutRet; +import com.qiniu.util.Auth; +import com.ruoyi.framework.config.FileConfig; + +import java.io.File; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Base64; + +public class ByFileUtil { + + /** + * File转成编码成BASE64 + * + * @param file 文件对象 + * @return String + */ + public static String fileToBase64(File file) { + String base64 = null; + try { + byte[] b = Files.readAllBytes(Paths.get(file.getAbsolutePath())); + return Base64.getEncoder().encodeToString(b); + } catch (Exception e) { + e.printStackTrace(); + } + return base64; + } + + + /** + * 将文件上传到七牛云 + */ + public static String uploadQNImg(InputStream file, String key, FileConfig constantQiniu) { + // 构造一个带指定Zone对象的配置类 华北 2020-02-06 已改用华东 + Configuration cfg = new Configuration(Zone.zone0()); + // 其他参数参考类注释 + UploadManager uploadManager = new UploadManager(cfg); + // 生成上传凭证,然后准备上传 + try { + Auth auth = Auth.create(constantQiniu.getAccessKey(), constantQiniu.getSecretKey()); + String upToken = auth.uploadToken(constantQiniu.getBucket()); + try { + Response response = uploadManager.put(file, key, upToken, null, null); + // 解析上传成功的结果 + DefaultPutRet putRet = new Gson().fromJson(response.bodyString(), DefaultPutRet.class); + + String returnPath = constantQiniu.getDomain() + "" + putRet.key; + return returnPath; + } catch (QiniuException ex) { + Response r = ex.response; + System.err.println(r.toString()); + try { + System.err.println(r.bodyString()); + } catch (QiniuException ex2) { + //ignore + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return ""; + } +} diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java b/ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java index 6921fea77..b476f43e5 100644 --- a/ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java +++ b/ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java @@ -21,9 +21,9 @@ import com.ruoyi.framework.config.RuoYiConfig; public class FileUploadUtils { /** - * 默认大小 50M + * 默认大小 500M */ - public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024; + public static final long DEFAULT_MAX_SIZE = 500 * 1024 * 1024; /** * 默认的文件名最大长度 100 diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java b/ruoyi/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java index d179a9188..c64c16fe1 100644 --- a/ruoyi/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java +++ b/ruoyi/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java @@ -32,7 +32,9 @@ public class MimeTypeUtils // 压缩文件 "rar", "zip", "gz", "bz2", // pdf - "pdf" }; + "pdf", + //视频 + "mp4"}; public static String getExtension(String prefix) { diff --git a/ruoyi/src/main/java/com/ruoyi/framework/config/FileConfig.java b/ruoyi/src/main/java/com/ruoyi/framework/config/FileConfig.java new file mode 100644 index 000000000..b100054d7 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/framework/config/FileConfig.java @@ -0,0 +1,35 @@ +package com.ruoyi.framework.config; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class FileConfig { + @Value("${file.access.key}") + private String accessKey; + + @Value("${file.secret.key}") + private String secretKey; + + @Value("${file.bucket}") + private String bucket; + + @Value("${file.domain}") + private String domain; + + public String getAccessKey() { + return accessKey; + } + + public String getSecretKey() { + return secretKey; + } + + public String getBucket() { + return bucket; + } + + public String getDomain() { + return domain; + } +} diff --git a/ruoyi/src/main/java/com/ruoyi/framework/config/RuoYiConfig.java b/ruoyi/src/main/java/com/ruoyi/framework/config/RuoYiConfig.java index 1f6e20ad1..7bf9d3fc4 100644 --- a/ruoyi/src/main/java/com/ruoyi/framework/config/RuoYiConfig.java +++ b/ruoyi/src/main/java/com/ruoyi/framework/config/RuoYiConfig.java @@ -113,4 +113,12 @@ public class RuoYiConfig { return getProfile() + "/upload"; } + + /** + * 获取视频上传路径 + */ + public static String getUploadVideoPath() + { + return getProfile() + "/video"; + } } \ No newline at end of file diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByLecturerController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByLecturerController.java index b86b719f9..0070733f9 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByLecturerController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByLecturerController.java @@ -48,6 +48,18 @@ public class ByLecturerController extends BaseController return getDataTable(list); } + /** + * 根据岗位id获取用户信息列表 + */ + @GetMapping("/listAll") + public AjaxResult getAllLecturerList(ByLecturer byLecturer) { + AjaxResult ajax = AjaxResult.success(); + List list = byLecturerService.selectByLecturerList(byLecturer); + ajax.put("lecturer", list); + + return ajax; + } + /** * 导出讲师列表 */ diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByTrainVideoController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByTrainVideoController.java index 5f673c5dc..cb13b17fc 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByTrainVideoController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByTrainVideoController.java @@ -1,6 +1,11 @@ package com.ruoyi.project.benyi.controller; +import java.util.Date; import java.util.List; + +import com.qiniu.util.Auth; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.framework.config.FileConfig; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -33,6 +38,7 @@ public class ByTrainVideoController extends BaseController @Autowired private IByTrainVideoService byTrainVideoService; + /** * 查询培训列表 */ @@ -76,6 +82,8 @@ public class ByTrainVideoController extends BaseController @PostMapping public AjaxResult add(@RequestBody ByTrainVideo byTrainVideo) { + byTrainVideo.setCreatetime(new Date()); + byTrainVideo.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId()); return toAjax(byTrainVideoService.insertByTrainVideo(byTrainVideo)); } diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByTrainVideo.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByTrainVideo.java index 9acd32605..dd5b61bf7 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByTrainVideo.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByTrainVideo.java @@ -10,42 +10,63 @@ import java.util.Date; /** * 培训对象 by_train_video - * + * * @author tsbz * @date 2020-05-25 */ -public class ByTrainVideo extends BaseEntity -{ +public class ByTrainVideo extends BaseEntity { private static final long serialVersionUID = 1L; - /** 编号 */ + /** + * 编号 + */ private Long id; - /** 培训视频标题 */ + /** + * 培训视频标题 + */ @Excel(name = "培训视频标题") private String title; - /** 简介 */ + /** + * 简介 + */ @Excel(name = "简介") private String information; - /** 讲师 */ + /** + * 讲师 + */ @Excel(name = "讲师") - private String lecturer; + private Long lecturer; - /** 视频路径 */ + /** + * 讲师 + */ + @Excel(name = "讲师") + private String lecturername; + + /** + * 视频路径 + */ @Excel(name = "视频路径") private String videourl; - /** 所属类别 */ + /** + * 所属类别 + */ @Excel(name = "所属类别") private String type; - /** 适用班级 */ + /** + * 适用班级 + */ @Excel(name = "适用班级") private String classtype; - /** 上传人员 */ + /** + * 上传人员 + */ @Excel(name = "上传人员") private Long createuserid; @@ -55,76 +76,75 @@ public class ByTrainVideo extends BaseEntity @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createtime; - public void setId(Long id) - { + public void setId(Long id) { this.id = id; } - public Long getId() - { + public Long getId() { return id; } - public void setTitle(String title) - { + + public void setTitle(String title) { this.title = title; } - public String getTitle() - { + public String getTitle() { return title; } - public void setInformation(String information) - { + + public void setInformation(String information) { this.information = information; } - public String getInformation() - { + public String getInformation() { return information; } - public void setLecturer(String lecturer) - { + + public void setLecturer(Long lecturer) { this.lecturer = lecturer; } - public String getLecturer() - { + public Long getLecturer() { return lecturer; } - public void setVideourl(String videourl) - { + + public void setLecturername(String lecturername) { + this.lecturername = lecturername; + } + + public String getLecturername() { + return lecturername; + } + + public void setVideourl(String videourl) { this.videourl = videourl; } - public String getVideourl() - { + public String getVideourl() { return videourl; } - public void setType(String type) - { + + public void setType(String type) { this.type = type; } - public String getType() - { + public String getType() { return type; } - public void setClasstype(String classtype) - { + + public void setClasstype(String classtype) { this.classtype = classtype; } - public String getClasstype() - { + public String getClasstype() { return classtype; } - public void setCreateuserid(Long createuserid) - { + + public void setCreateuserid(Long createuserid) { this.createuserid = createuserid; } - public Long getCreateuserid() - { + public Long getCreateuserid() { return createuserid; } @@ -138,16 +158,17 @@ public class ByTrainVideo extends BaseEntity @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("title", getTitle()) - .append("information", getInformation()) - .append("lecturer", getLecturer()) - .append("videourl", getVideourl()) - .append("type", getType()) - .append("classtype", getClasstype()) - .append("createuserid", getCreateuserid()) - .append("createtime", getCreatetime()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("title", getTitle()) + .append("information", getInformation()) + .append("lecturer", getLecturer()) + .append("lecturername", getLecturername()) + .append("videourl", getVideourl()) + .append("type", getType()) + .append("classtype", getClasstype()) + .append("createuserid", getCreateuserid()) + .append("createtime", getCreatetime()) + .toString(); } } diff --git a/ruoyi/src/main/java/com/ruoyi/project/common/CommonController.java b/ruoyi/src/main/java/com/ruoyi/project/common/CommonController.java index 6c62e0a3a..c570724ac 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/common/CommonController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/common/CommonController.java @@ -1,7 +1,12 @@ package com.ruoyi.project.common; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import com.qiniu.util.Auth; +import com.ruoyi.common.utils.ByFileUtil; +import com.ruoyi.framework.config.FileConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -17,32 +22,40 @@ import com.ruoyi.framework.config.RuoYiConfig; import com.ruoyi.framework.config.ServerConfig; import com.ruoyi.framework.web.domain.AjaxResult; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; + +import static com.ruoyi.common.utils.file.FileUploadUtils.extractFilename; + /** * 通用请求处理 - * + * * @author ruoyi */ @RestController -public class CommonController -{ +public class CommonController { private static final Logger log = LoggerFactory.getLogger(CommonController.class); @Autowired private ServerConfig serverConfig; + @Resource + private FileConfig fileConfig; + @Autowired + private FileConfig constantQiniu; /** * 通用下载请求 - * + * * @param fileName 文件名称 - * @param delete 是否删除 + * @param delete 是否删除 */ @GetMapping("common/download") - public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) - { - try - { - if (!FileUtils.isValidFilename(fileName)) - { + public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) { + try { + if (!FileUtils.isValidFilename(fileName)) { throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName)); } String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1); @@ -53,26 +66,23 @@ public class CommonController response.setHeader("Content-Disposition", "attachment;fileName=" + FileUtils.setFileDownloadHeader(request, realFileName)); FileUtils.writeBytes(filePath, response.getOutputStream()); - if (delete) - { + if (delete) { FileUtils.deleteFile(filePath); } - } - catch (Exception e) - { + } catch (Exception e) { log.error("下载文件失败", e); } } + /** * 通用上传请求 */ @PostMapping("/common/upload") - public AjaxResult uploadFile(MultipartFile file) throws Exception - { - try - { + public AjaxResult uploadFile(MultipartFile file) throws Exception { + try { // 上传文件路径 String filePath = RuoYiConfig.getUploadPath(); + System.out.println("path=" + filePath); // 上传并返回新文件名称 String fileName = FileUploadUtils.upload(filePath, file); String url = serverConfig.getUrl() + fileName; @@ -80,19 +90,57 @@ public class CommonController ajax.put("fileName", fileName); ajax.put("url", url); return ajax; - } - catch (Exception e) - { + } catch (Exception e) { return AjaxResult.error(e.getMessage()); } } + /** + * 通用上传请求 + */ + @PostMapping("/common/uploadqiniu") + public AjaxResult uploadFileQiNiu(MultipartFile file) throws Exception { + try { + // 上传文件路径 + String filePath = RuoYiConfig.getUploadPath(); + // 上传并返回新文件名称 + //String fileName =FileUploadUtils.upload(filePath, file); + + String fileName = "video" + extractFilename(file); + System.out.println("start===filename=" + fileName); + + InputStream in = file.getInputStream(); + String url = ByFileUtil.uploadQNImg(in, fileName, fileConfig); + + AjaxResult ajax = AjaxResult.success(); + ajax.put("fileName", fileName); + ajax.put("url", url); + System.out.println("end==="); + return ajax; + } catch (Exception e) { + return AjaxResult.error(e.getMessage()); + } + } + + /** + * 获取七牛token + **/ + @PostMapping("/common/getQiNiuToken") + public AjaxResult getQiNiuToken() { + AjaxResult ajax = AjaxResult.success(); + + Auth auth = Auth.create(constantQiniu.getAccessKey(), constantQiniu.getSecretKey()); + System.out.println("auth:" + auth); + String upToken = auth.uploadToken(constantQiniu.getBucket()); + ajax.put("token", upToken); + return ajax; + } + /** * 本地资源通用下载 */ @GetMapping("/common/download/resource") - public void resourceDownload(String name, HttpServletRequest request, HttpServletResponse response) throws Exception - { + public void resourceDownload(String name, HttpServletRequest request, HttpServletResponse response) throws Exception { // 本地资源路径 String localPath = RuoYiConfig.getProfile(); // 数据库资源地址 diff --git a/ruoyi/src/main/java/com/ruoyi/project/tool/gen/util/VelocityUtils.java b/ruoyi/src/main/java/com/ruoyi/project/tool/gen/util/VelocityUtils.java index 3b5b02c9c..506582112 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/tool/gen/util/VelocityUtils.java +++ b/ruoyi/src/main/java/com/ruoyi/project/tool/gen/util/VelocityUtils.java @@ -138,7 +138,7 @@ public class VelocityUtils { fileName = StringUtils.format("{}/service/I{}Service.java", javaPath, className); } - else if (template.contains("serviceImpl.java.vm")) + else if (template.contains("service.java.vm")) { fileName = StringUtils.format("{}/service/impl/{}ServiceImpl.java", javaPath, className); } diff --git a/ruoyi/src/main/resources/application.yml b/ruoyi/src/main/resources/application.yml index 3881fa71c..68790d28b 100644 --- a/ruoyi/src/main/resources/application.yml +++ b/ruoyi/src/main/resources/application.yml @@ -40,15 +40,15 @@ spring: messages: # 国际化资源文件路径 basename: i18n/messages - profiles: + profiles: active: druid # 文件上传 servlet: - multipart: - # 单个文件大小 - max-file-size: 10MB - # 设置总上传的文件大小 - max-request-size: 20MB + multipart: + # 单个文件大小 + max-file-size: 50MB + # 设置总上传的文件大小 + max-request-size: 100MB # 服务模块 devtools: restart: @@ -61,7 +61,7 @@ spring: # 端口,默认为6379 port: 6379 # 密码 - password: + password: # 连接超时时间 timeout: 10s lettuce: @@ -77,40 +77,40 @@ spring: # token配置 token: - # 令牌自定义标识 - header: Authorization - # 令牌秘钥 - secret: abcdefghijklmnopqrstuvwxyz - # 令牌有效期(默认30分钟) - expireTime: 30 - + # 令牌自定义标识 + header: Authorization + # 令牌秘钥 + secret: abcdefghijklmnopqrstuvwxyz + # 令牌有效期(默认30分钟) + expireTime: 30 + # MyBatis配置 mybatis: - # 搜索指定包别名 - typeAliasesPackage: com.ruoyi.project.**.domain - # 配置mapper的扫描,找到所有的mapper.xml映射文件 - mapperLocations: classpath*:mybatis/**/*Mapper.xml - # 加载全局的配置文件 - configLocation: classpath:mybatis/mybatis-config.xml + # 搜索指定包别名 + typeAliasesPackage: com.ruoyi.project.**.domain + # 配置mapper的扫描,找到所有的mapper.xml映射文件 + mapperLocations: classpath*:mybatis/**/*Mapper.xml + # 加载全局的配置文件 + configLocation: classpath:mybatis/mybatis-config.xml # PageHelper分页插件 -pagehelper: +pagehelper: helperDialect: mysql reasonable: true supportMethodsArguments: true - params: count=countSql + params: count=countSql # 防止XSS攻击 -xss: +xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) excludes: /system/notice/* # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* - + # 代码生成 -gen: +gen: # 作者 author: tsbz # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool @@ -118,4 +118,13 @@ gen: # 自动去除表前缀,默认是true autoRemovePre: false # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) - tablePrefix: sys_ \ No newline at end of file + tablePrefix: sys_ + +#七牛云 +file: + access: + key: 3leP0wEJvWdIck7x4QyzA3lS_Ua8eiFOUEDUro30 + secret: + key: auEPimrlHeCBJFc8fcT3s8bOBULKwH_zK95xpQzV + domain: https://files.benyiedu.com/ + bucket: bywebfile diff --git a/ruoyi/src/main/resources/mybatis/benyi/ByTrainVideoMapper.xml b/ruoyi/src/main/resources/mybatis/benyi/ByTrainVideoMapper.xml index 08244c7ee..ceec0d428 100644 --- a/ruoyi/src/main/resources/mybatis/benyi/ByTrainVideoMapper.xml +++ b/ruoyi/src/main/resources/mybatis/benyi/ByTrainVideoMapper.xml @@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -17,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, title, information, lecturer, videourl, type, classtype, createuserid, createtime from by_train_video + select id, title, information, lecturer,(select name from by_lecturer where lecturer=by_lecturer.id) as lecturername, videourl, type, classtype, createuserid, createtime from by_train_video