Merge remote-tracking branch 'origin/dev' into dev

dev
xiepeng 2024-03-25 10:20:29 +08:00
commit 3d1f7acc6d
34 changed files with 463 additions and 3068 deletions

View File

@ -28,7 +28,6 @@ import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
import static com.sun.xml.internal.ws.spi.db.BindingContextFactory.LOGGER;
/**
*

View File

@ -1,11 +1,13 @@
package com.zcloud.controller.eduArchives;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.controller.base.BaseController;
import com.zcloud.service.eduArchives.ArchivesPdfFileService;
import com.zcloud.service.eduArchives.ArchivesStudentService;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.eduStudy.ClassService;
import com.zcloud.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -29,6 +31,8 @@ public class ArchivesStudentController extends BaseController {
private ArchivesStudentService archivesstudentService;
@Autowired
private ArchivesPdfFileService archivesPdfFileService;
@Autowired
private ClassService classService;
/**
*
*
@ -220,4 +224,79 @@ public class ArchivesStudentController extends BaseController {
archivesPdfFileService.registerform(pd);
return map;
}
/**
* @Description:
* STUDENT
* @Author:
* @Date: 2023/3/17/017 16:34
* @Param:
* @Return:
*/
@RequestMapping("/batchDownByClass")
@ResponseBody
public Object batchDownByClass(HttpServletResponse response, Page page) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
PageData apf = new PageData();
apf.put("ARCHIVES_PDF_FILE_ID", this.get32UUID());
apf.put("TABLE_NAME", "bus_student");
apf.put("TABLE_ID", pd.get("STUDENT_ID"));
apf.put("TYPE", "1");
apf.put("STATUS", "0");
apf.put("CREATOR", Jurisdiction.getUsername());
apf.put("CREATTIME", DateUtil.date2Str(new Date()));
PageData classInfo = classService.findById(pd);
apf.put("DESCR", classInfo.getString("NAME") + "-班级档案");
apf.put("METHOD_NAME", "batchDownByClass"); //方法名
apf.put("CLASS_NAME", PageData.class.getName()); //方法名中参数的类型 --如方法类型有多个使类型用逗号连接格式xx,yyy
pd.put("ARCHIVES_PDF_FILE_ID", apf.get("ARCHIVES_PDF_FILE_ID"));
map.put("result", errInfo);
pd.put("projectPath", PathUtil.getProjectpath());
apf.put("PARAM_NAME", JSONObject.toJSON(pd).toString());//方法名中参数的值 --如方法中参数有多个,使参数用逗号连接,格式:{"a":a},{"b":b}
archivesPdfFileService.save(apf);
// 异步生成档案
archivesPdfFileService.batchDownByClass(pd);
return map;
}
/**
* @Description:
* STUDENT
* @Author:
* @Date: 2023/3/17/017 16:34
* @Param:
* @Return:
*/
@RequestMapping("/archivepersonnel")
@ResponseBody
public Object archivepersonnel(HttpServletResponse response) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
List<PageData> classList = JSONArray.parseArray((String) pd.get("curriculum"), PageData.class);
pd.put("STUDENT_ID", classList.get(0).get("STUDENT_ID"));
pd.put("CLASS_ID", classList.get(0).get("CLASS_ID"));
pd.put("STUDENT_NAME", classList.get(0).get("STUDENT_NAME"));
PageData apf = new PageData();
apf.put("ARCHIVES_PDF_FILE_ID", this.get32UUID());
apf.put("TABLE_NAME", "bus_student");
apf.put("TABLE_ID", pd.get("STUDENT_ID"));
apf.put("TYPE", "1");
apf.put("STATUS", "0");
apf.put("CREATOR", Jurisdiction.getUsername());
apf.put("CREATTIME", DateUtil.date2Str(new Date()));
apf.put("DESCR", pd.get("STUDENT_NAME") + "-班级详情");
apf.put("METHOD_NAME", "archivepersonnel"); //方法名
apf.put("CLASS_NAME", PageData.class.getName()); //方法名中参数的类型 --如方法类型有多个使类型用逗号连接格式xx,yyy
pd.put("ARCHIVES_PDF_FILE_ID", apf.get("ARCHIVES_PDF_FILE_ID"));
map.put("result", errInfo);
pd.put("projectPath", PathUtil.getProjectpath());
apf.put("PARAM_NAME", JSONObject.toJSON(pd).toString());//方法名中参数的值 --如方法中参数有多个,使参数用逗号连接,格式:{"a":a},{"b":b}
archivesPdfFileService.save(apf);
// 异步生成档案
archivesPdfFileService.archivepersonnel(pd);
return map;
}
}

View File

@ -165,10 +165,10 @@ public class StudentController extends BaseController {
}
}
PageData editClass = new PageData();
editClass.put("CLASS_ID",pd.getString("CLASS_ID"));
editClass.put("RELEASE_TYPE",pd.getString("RELEASE_TYPE"));
editClass.put("PERSONNEL_TYPES",pd.getString("PERSONNEL_TYPES"));
editClass.put("EXAMINATION",pd.getString("EXAMINATION"));
editClass.put("CLASS_ID", pd.getString("CLASS_ID"));
editClass.put("RELEASE_TYPE", pd.getString("RELEASE_TYPE"));
editClass.put("PERSONNEL_TYPES", pd.getString("PERSONNEL_TYPES"));
editClass.put("EXAMINATION", pd.getString("EXAMINATION"));
classService.edit(editClass);
map.put("result", errInfo);
return map;
@ -299,6 +299,7 @@ public class StudentController extends BaseController {
map.put("result", errInfo);
return map;
}
/**
*
*
@ -322,28 +323,6 @@ public class StudentController extends BaseController {
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/exportStudentList")
@ResponseBody
public Object exportStudentList() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
List<PageData> varList = studentService.listAllByExoprt(pd); //列出PostPaper列表
map.put("varList", varList);
map.put("result", errInfo);
return map;
}
/**
*
*
@ -362,59 +341,102 @@ public class StudentController extends BaseController {
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
List<PageData> varList = studentService.listAllByExoprt(pd); //列出PostPaper列表
Map<String, Object> objMap = new HashMap<>();
List<Map<String,Object>> list = new ArrayList<>();
if(varList.size()>0){
for (PageData student: varList) {
//通过留言id去获取留言上传的图片列表
Map<String, Object> objMap = new LinkedHashMap<>();
List<Map<String, Object>> list = new ArrayList<>();
// List<PageData> list = new ArrayList<>();
if (varList.size() > 0) {
for (PageData student : varList) {
StudentMessageExcel excelObj = new StudentMessageExcel();
excelObj.setUSER_ID_CARD(student.getString("USER_ID_CARD"));
excelObj.setNAME(student.getString("NAME"));
excelObj.setSEX(student.getString("SEX"));
excelObj.setSEX("1".equals(student.getString("SEX")) ? "男" : "女");
excelObj.setPHONE(student.getString("PHONE"));
excelObj.setDEPARTMENT_NAME(student.getString("DEPARTMENT_NAME"));
excelObj.setPOST_NAME(student.getString("POST_NAME"));
excelObj.setALL_CLASSHOUR(student.getString("ALL_CLASSHOUR"));
excelObj.setCOMPLETE_CLASSHOUR(student.getString("COMPLETE_CLASSHOUR"));
excelObj.setPASSED(student.getString("PASSED"));
excelObj.setPASSED("0".equals(student.getString("STAGEEXAMSTATE")) ? "不考试" : student.getString("PASSED"));
excelObj.setEXAMSCORE(student.getString("EXAMSCORE"));
excelObj.setSTUDYSTATE(student.getString("STUDYSTATE"));
switch (student.getString("STUDYSTATE")) {
case "1":
excelObj.setSTUDYSTATE("学习中");
break;
case "2":
excelObj.setSTUDYSTATE("已学完");
break;
case "3":
excelObj.setSTUDYSTATE("已完成");
break;
case "4":
excelObj.setSTUDYSTATE("未完成");
break;
case "5":
excelObj.setSTUDYSTATE("待评估");
break;
case "6":
excelObj.setSTUDYSTATE("评估未合格");
break;
case "0":
excelObj.setSTUDYSTATE("未学习");
break;
}
excelObj.setCLASS_NAME(student.getString("CLASS_NAME"));
File USER_SIGN = new File(PathUtil.getProjectpath() + Const.FILEPATHFILE + pd.getString("USER_SIGN_FILE_PATH"));
// if (Tools.notEmpty(pd.getString("USER_SIGN_FILE_PATH"))) {
// File USER_SIGN = new File(PathUtil.getProjectpath() + Const.FILEPATHFILE + pd.getString("USER_SIGN_FILE_PATH"));
// excelObj.setUSER_SIGN_FILE(USER_SIGN);
// }
File USER_SIGN = new File("D:\\图片\\11111.png");
excelObj.setUSER_SIGN_FILE(USER_SIGN);
File PORTRAIT = new File(PathUtil.getProjectpath() + Const.FILEPATHFILE + pd.getString("PORTRAIT"));
excelObj.setPORTRAIT(PORTRAIT);
if (Tools.notEmpty(pd.getString("PORTRAIT"))) {
File PORTRAIT = new File(PathUtil.getProjectpath() + Const.FILEPATHFILE + pd.getString("PORTRAIT"));
excelObj.setPORTRAIT(PORTRAIT);
}
objMap = ImageExcelUtil.javaBean2Map(excelObj);
list.add(objMap);
}
}
Object[] objects = objMap.keySet().toArray();
String[] titles = new String[objects.length];
Map<String, String> titleName = new HashMap<>();
titleName.put("USER_ID_CARD","身份证");
titleName.put("NAME","姓名");
titleName.put("SEX","性别");
titleName.put("PHONE","手机号");
titleName.put("DEPARTMENT_NAME","部门");
titleName.put("POST_NAME","工种");
titleName.put("ALL_CLASSHOUR","要求总学时");
titleName.put("COMPLETE_CLASSHOUR","已完成学时");
titleName.put("PASSED","是否考试通过");
titleName.put("EXAMSCORE","考试分数");
titleName.put("STUDYSTATE","学习状态");
titleName.put("CLASS_NAME","班级名称");
titleName.put("USER_SIGN_FILE","用户签字");
titleName.put("PORTRAIT","人像照片");
Map<String, String> titleName = new LinkedHashMap<>();
titleName.put("USER_ID_CARD", "身份证");
titleName.put("NAME", "姓名");
titleName.put("SEX", "性别");
titleName.put("PHONE", "手机号");
titleName.put("DEPARTMENT_NAME", "部门");
titleName.put("POST_NAME", "工种");
titleName.put("ALL_CLASSHOUR", "要求总学时");
titleName.put("COMPLETE_CLASSHOUR", "已完成学时");
titleName.put("PASSED", "是否考试通过");
titleName.put("EXAMSCORE", "考试分数");
titleName.put("STUDYSTATE", "学习状态");
titleName.put("CLASS_NAME", "班级名称");
titleName.put("USER_SIGN_FILE", "用户签字");
titleName.put("PORTRAIT", "人像照片");
for(int i=0;i<titles.length;i++){
for (int i = 0; i < titles.length; i++) {
String key = objects[i].toString();
titles[i] = titleName.get(key);
}
// List<String> titles = new ArrayList<>();
// titles.add("身份证号");
// titles.add("姓名");
// titles.add("性别");
// titles.add("手机号");
// titles.add("部门");
// titles.add("工种");
// titles.add("要求总学时");
// titles.add("已完成学时");
// titles.add("是否考试通过");
// titles.add("考试分数");
// titles.add("学习状态");
// titles.add("班级名称");
// titles.add("用户签字");
// titles.add("人像照片");
String fileName = "学员学习记录";
response.setContentType("application/vnd.ms-excel");
response.addHeader("Content-Disposition", "attachment; filename=" + fileName);
ImageExcelUtil.excelOut(titles,list.size(),list,fileName, response, PathUtil.getProjectpath());
ImageExcelUtil.excelOut(titles, list.size(), list, fileName, response, PathUtil.getProjectpath());
}
@RequestMapping("/list")
@ -424,7 +446,7 @@ public class StudentController extends BaseController {
try {
PageData request = this.getPageData();
request.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
if ("0".equals(Jurisdiction.getIS_MAIN())){
if ("0".equals(Jurisdiction.getIS_MAIN())) {
request.put("USER_ID", Jurisdiction.getUSER_ID());
}
page.setPd(request);

View File

@ -60,10 +60,11 @@ public class TrainedUserSignController extends BaseController {
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
pd.put("ISDELETE", 0);
//签字方式以上传图片的形式存储数据
if (SIGN_PICTURE_2 != null) {
pd.put("SIGN_PICTURE", smb.saveFile(SIGN_PICTURE_2, pd.getString("ENTERPRISE_ID")));
pd.put("SIGN_PICTURE", smb.saveFile(SIGN_PICTURE_2, pd.getString("CORPINFO_ID")));
} else {
//签字方式以签字的形式存储数据
if (Tools.notEmpty(pd.getString("SIGN_PICTURE"))) {
@ -113,9 +114,9 @@ public class TrainedUserSignController extends BaseController {
* @param
* @throws Exception
*/
@RequestMapping(value = "/isdelete")
@RequestMapping(value = "/delete")
@ResponseBody
public Object isdelete() throws Exception {
public Object delete() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
@ -187,9 +188,10 @@ public class TrainedUserSignController extends BaseController {
// }
pd.put("OPERATOR", Jurisdiction.getUsername());
pd.put("OPERATTIME", DateUtil.date2Str(new Date()));
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
//签字方式以上传图片的形式存储数据
if (SIGN_PICTURE_2 != null) {
pd.put("SIGN_PICTURE", smb.saveFile(SIGN_PICTURE_2, pd.getString("ENTERPRISE_ID")));
pd.put("SIGN_PICTURE", smb.saveFile(SIGN_PICTURE_2, pd.getString("CORPINFO_ID")));
} else {
//签字方式以签字的形式存储数据
if (Tools.notEmpty(pd.getString("SIGN_PICTURE")) && pd.getString("SIGN_PICTURE").contains("data:image/png;base64,")) {
@ -207,5 +209,4 @@ public class TrainedUserSignController extends BaseController {
map.put("result", errInfo);
return map;
}
}

View File

@ -1,10 +1,10 @@
package com.zcloud.controller.eightWork;
package com.zcloud.controller.eightwork;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.logs.LogAnno;
import com.zcloud.service.eightWork.EightWorkVideoManagerService;
import com.zcloud.service.eightwork.EightWorkVideoManagerService;
import com.zcloud.util.DateUtil;
import com.zcloud.util.Jurisdiction;
import com.zcloud.util.ObjectExcelView;

View File

@ -1,4 +1,4 @@
package com.zcloud.mapper.datasource.eightWork;
package com.zcloud.mapper.datasource.eightwork;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;

View File

@ -863,7 +863,7 @@ public class ArchivesPdfFileServiceImpl implements ArchivesPdfFileService {
(Tools.notEmpty(stageStudent.getString("STAGEEXAMSTATE")) && Integer.parseInt(stageStudent.get("STAGEEXAMSTATE").toString()) > 1) && !("5".equals(stageStudent.get("STUDYSTATE"))) ||
(stageStudent.getString("STAGEEXAMSTATE").equals("0") && Integer.parseInt(stageStudent.get("STUDYSTATE").toString()) > 1)) {
PageData para = new PageData();
para.put("CORP_NAME", corpinfo.getString("NAME"));
para.put("CORP_NAME", corpinfo.getString("CORP_NAME"));
para.put("ASSESSOR_SIGN", allSign.get(0).getString("ASSESSOR_SIGN")); //签字数据
para.put("RECORDOR_SIGN", allSign.get(0).getString("RECORDOR_SIGN")); //签字数据
para.put("SAFETYDEPTOR_SIGN", allSign.get(0).getString("SAFETYDEPTOR_SIGN")); //签字数据

View File

@ -1,4 +1,4 @@
package com.zcloud.service.eightWork;
package com.zcloud.service.eightwork;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;

View File

@ -37,7 +37,7 @@ public class BlindBoardServiceImpl implements BlindBoardService {
@Autowired
private BlindBoardToMeasuresMapper blindboardToMeasuresMapper;
@Autowired
private com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper eightworkvideomanagerMapper;
private EightWorkVideoManagerMapper eightworkvideomanagerMapper;
@Autowired
private Smb smb;
@Autowired

View File

@ -35,7 +35,7 @@ public class BreakGroundServiceImpl implements BreakGroundService {
@Autowired
private BreakGroundToMeasuresMapper breakgroundToMeasuresMapper;
@Autowired
private com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper eightworkvideomanagerMapper;
private EightWorkVideoManagerMapper eightworkvideomanagerMapper;
@Autowired
private Smb smb;
@Autowired

View File

@ -37,7 +37,7 @@ public class ConfinedspaceServiceImpl implements ConfinedspaceService {
@Autowired
private ConfinedSpaceGasMapper confinedspacegasMapper;
@Autowired
private com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper eightworkvideomanagerMapper;
private EightWorkVideoManagerMapper eightworkvideomanagerMapper;
@Autowired
private Smb smb;
@Autowired

View File

@ -35,7 +35,7 @@ public class CutRoadServiceImpl implements CutRoadService {
@Autowired
private CutRoadToMeasuresMapper cutroadToMeasuresMapper;
@Autowired
private com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper eightworkvideomanagerMapper;
private EightWorkVideoManagerMapper eightworkvideomanagerMapper;
@Autowired
private Smb smb;
@Autowired

View File

@ -1,9 +1,9 @@
package com.zcloud.service.eightWork.impl;
package com.zcloud.service.eightwork.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper;
import com.zcloud.service.eightWork.EightWorkVideoManagerService;
import com.zcloud.mapper.datasource.eightwork.EightWorkVideoManagerMapper;
import com.zcloud.service.eightwork.EightWorkVideoManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

View File

@ -37,7 +37,7 @@ public class ElectricityServiceImpl implements ElectricityService {
@Autowired
private ElectricityGasMapper electricitygasMapper;
@Autowired
private com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper eightworkvideomanagerMapper;
private EightWorkVideoManagerMapper eightworkvideomanagerMapper;
@Autowired
private Smb smb;
@Autowired

View File

@ -36,7 +36,7 @@ public class HighworkServiceImpl implements HighworkService {
@Autowired
private HighworkToMeasuresMapper highworkToMeasuresMapper;
@Autowired
private com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper eightworkvideomanagerMapper;
private EightWorkVideoManagerMapper eightworkvideomanagerMapper;
@Autowired
private Smb smb;
@Autowired

View File

@ -35,7 +35,7 @@ public class HoistingServiceImpl implements HoistingService {
@Autowired
private HoistingToMeasuresMapper hoistingToMeasuresMapper;
@Autowired
private com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper eightworkvideomanagerMapper;
private EightWorkVideoManagerMapper eightworkvideomanagerMapper;
@Autowired
private Smb smb;
@Autowired

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.eightwork.*;
import com.zcloud.service.eightwork.HotworkService;
import com.zcloud.util.*;
import org.springframework.beans.factory.annotation.Autowired;
@ -23,21 +24,21 @@ import java.util.stream.Collectors;
public class HotworkServiceImpl implements HotworkService {
@Autowired
private com.zcloud.mapper.datasource.eightwork.HotworkMapper hotworkMapper;
private HotworkMapper hotworkMapper;
@Autowired
private com.zcloud.mapper.datasource.eightwork.EightWorkTaskFlowMapper eightWorkTaskFlowMapper;
private EightWorkTaskFlowMapper eightWorkTaskFlowMapper;
@Autowired
private com.zcloud.mapper.datasource.eightwork.EightWorkFlowLogMapper eightWorkFlowLogMapper;
private EightWorkFlowLogMapper eightWorkFlowLogMapper;
@Autowired
private com.zcloud.mapper.datasource.eightwork.HotworkSignMapper hotworkSignMapper;
private HotworkSignMapper hotworkSignMapper;
@Autowired
private com.zcloud.mapper.datasource.eightwork.HotworkToMeasuresMapper hotworkToMeasuresMapper;
private HotworkToMeasuresMapper hotworkToMeasuresMapper;
@Autowired
private com.zcloud.mapper.datasource.eightwork.HotworkGasMapper hotworkGasMapper;
private HotworkGasMapper hotworkGasMapper;
@Autowired
private Smb smb;
@Autowired
private com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper eightworkvideomanagerMapper;
private EightWorkVideoManagerMapper eightworkvideomanagerMapper;
@Autowired
private SendMessageUtil sendMessageUtil;

View File

@ -7,7 +7,7 @@ import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.video.VideoManagerMapper;
import com.zcloud.service.video.VideoManagerService;
import com.zcloud.util.Jurisdiction;
import com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper;
import com.zcloud.mapper.datasource.eightwork.EightWorkVideoManagerMapper;
import com.zcloud.util.PLSUtil;
import com.zcloud.util.ReturnMap;
import com.zcloud.util.Tools;

View File

@ -9,6 +9,7 @@ import org.apache.poi.hssf.usermodel.HSSFPatriarch;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.Entry;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
@ -23,271 +24,275 @@ import java.util.*;
public class ImageExcelUtil {
private static final Log log = LogFactory.getLog(ImageExcelUtil.class);
private static final Log log = LogFactory.getLog(ImageExcelUtil.class);
/**
* excel
* @date 2024/03/20
* @param titles
* @param rows
* @param maps maplistmap javaBean2Maptitles[]
* @param fileName
* @param response response
* @param path ()
*/
public static void excelOut(String[] titles, int rows, List<Map<String,Object>> maps, String fileName,
HttpServletResponse response, String path){
/**
* excel
*
* @param titles
* @param rows
* @param maps maplistmap javaBean2Maptitles[]
* @param fileName
* @param response response
* @param path ()
* @date 2024/03/20
*/
public static void excelOut(String[] titles, int rows, List<Map<String, Object>> maps, String fileName,
HttpServletResponse response, String path) {
OutputStream out = null;
BufferedImage bufferImg = null;
HSSFWorkbook wb = null;
OutputStream out = null;
BufferedImage bufferImg = null;
HSSFWorkbook wb = null;
try{
//创建工作sheet
wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet(fileName);
//设置单元格内容水平垂直居中
HSSFCellStyle style = wb.createCellStyle();
try {
//创建工作sheet
wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet(fileName);
//设置单元格内容水平垂直居中
HSSFCellStyle style = wb.createCellStyle();
// style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
// style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
style.setWrapText(true); //设置内容自动换行
style.setWrapText(true); //设置内容自动换行
//画图的顶级管理器一个sheet只能获取一个一定要注意这点
HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
HSSFRow row0 = sheet.createRow(0);
row0.setHeightInPoints(25);
if (titles.length == 0){
return ;
}
HSSFCell cell = null;
//第一行、标题行列
for (int i=0;i<titles.length;i++){
cell = row0.createCell(i); //第一个单元格
cell.setCellValue(titles[i]); //设定值
cell.setCellStyle(style);
sheet.setColumnWidth(i,6000);
}
//画图的顶级管理器一个sheet只能获取一个一定要注意这点
HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
HSSFRow row0 = sheet.createRow(0);
row0.setHeightInPoints(25);
if (titles.length == 0) {
return;
}
HSSFCell cell = null;
//第一行、标题行列
for (int i = 0; i < titles.length; i++) {
cell = row0.createCell(i); //第一个单元格
cell.setCellValue(titles[i]); //设定值
cell.setCellStyle(style);
sheet.setColumnWidth(i, 6000);
}
HSSFRow row = null;
HSSFCell cellRow = null;
HSSFClientAnchor anchor = null;
HSSFRow row = null;
HSSFCell cellRow = null;
HSSFClientAnchor anchor = null;
for (int i=1;i<=rows;i++){
int cellColumn = 0;
//创建行
row = sheet.createRow(i);
//设置默认行高
row.setHeightInPoints(25);
//行数据处理
Map<String, Object> stringObjectMap = maps.get(i - 1);
for(Object value : stringObjectMap.keySet()){
//行单元格
cellRow = row.createCell(cellColumn);
cellRow.setCellStyle(style);
//如果行数据中有图片时候的处理
if (value.equals("images")){
File[] file = (File[]) stringObjectMap.get(value);
if (file == null || file.length == 0){
cellRow.setCellValue("");
continue;
}else{
row.setHeightInPoints(50);
for (int i = 1; i <= rows; i++) {
int cellColumn = 0;
//创建行
row = sheet.createRow(i);
//设置默认行高
row.setHeightInPoints(15);
//行数据处理
Map<String, Object> stringObjectMap = maps.get(i - 1);
for (int x=0;x<file.length;x++){
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
if (x>0){
cellRow = row.createCell(cellColumn);
cellRow.setCellStyle(style);
}
sheet.setColumnWidth(cellColumn,5000);
log.error("图片路径"+file[x]);
bufferImg = ImageIO.read(file[x]);
ImageIO.write(bufferImg, "jpg", byteArrayOut);
anchor = new HSSFClientAnchor(0, 0, 1023, 255,(short) cellColumn, i, (short) cellColumn, i);
// anchor.setAnchorType(3);
patriarch.createPicture(anchor, wb.addPicture(byteArrayOut.toByteArray(), HSSFWorkbook.PICTURE_TYPE_JPEG));
cellColumn++;
}
continue;
}
}
cellRow.setCellValue(stringObjectMap.get(value).toString());
cellColumn ++;
}
for (Object value : stringObjectMap.keySet()) {
//行单元格
cellRow = row.createCell(cellColumn);
cellRow.setCellStyle(style);
//如果行数据中有图片时候的处理
if ("USER_SIGN_FILE".equals(value) || "PORTRAIT".equals(value)) {
File file = (File) stringObjectMap.get(value);
if (file == null) {
cellRow.setCellValue("");
continue;
} else {
row.setHeightInPoints(50);
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
cellRow = row.createCell(cellColumn);
cellRow.setCellStyle(style);
sheet.setColumnWidth(cellColumn, 5000);
log.error("图片路径" + file);
bufferImg = ImageIO.read(file);
ImageIO.write(bufferImg, "jpg", byteArrayOut);
anchor = new HSSFClientAnchor(0, 0, 1023, 255, (short) cellColumn, i, (short) cellColumn, i);
patriarch.createPicture(anchor, wb.addPicture(byteArrayOut.toByteArray(), HSSFWorkbook.PICTURE_TYPE_PNG));
cellColumn++;
}
}
if (stringObjectMap.get(value) != null) {
cellRow.setCellValue(stringObjectMap.get(value).toString());
} else {
cellRow.setCellValue("");
}
cellColumn++;
}
}
if(wb!=null){
out = response.getOutputStream();
response.setContentType("application/x-msdownload");
response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8") +".xls");
// 写入excel文件
wb.write(out);
}
}catch (Exception e){
e.printStackTrace();
}finally {
if(out != null){
try {
out.close();
}
if (wb != null) {
out = response.getOutputStream();
response.setContentType("application/x-msdownload");
response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xls");
// 写入excel文件
wb.write(out);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (out != null) {
try {
out.close();
//执行删除生成的图片 TODO
//执行删除生成的图片 TODO
// File file = new File("E:\\data\\nginxd\\sportsApplets");//输入要删除文件目录的绝对路径
// File file = new File("/data/nginxd/sportsApplets/excelDeleteImage/");//输入要删除文件目录的绝对路径
File file = new File(path);//输入要删除文件目录的绝对路径
deleteFile(file);//由于是保存网络图片到本地服务区所以画完图片到excel就要删除文件
} catch (IOException e) {
e.printStackTrace();
}
}
File file = new File(path);//输入要删除文件目录的绝对路径
deleteFile(file);//由于是保存网络图片到本地服务区所以画完图片到excel就要删除文件
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
}
/**
* excel
* @date 2021/01/11
* @param file
*/
public static void deleteFile(File file){
//判断文件不为null或文件目录存在
if (file == null || !file.exists()){
log.error("文件删除失败,请检查文件路径是否正确");
return;
}
//取得这个目录下的所有子文件对象
File[] files = file.listFiles();
//遍历该目录下的文件对象
for (File f: files){
//打印文件名
String name = file.getName();
log.error("删除的文件名"+name);
//判断子目录是否存在子目录,如果是文件则删除
if (f.isDirectory()){
deleteFile(f);
}else {
f.delete();
}
}
//删除空文件夹 for循环已经把上一层节点的目录清空。
file.delete();
}
/**
* excel
*
* @param file
* @date 2021/01/11
*/
public static void deleteFile(File file) {
//判断文件不为null或文件目录存在
if (file == null || !file.exists()) {
log.error("文件删除失败,请检查文件路径是否正确");
return;
}
//取得这个目录下的所有子文件对象
File[] files = file.listFiles();
//遍历该目录下的文件对象
for (File f : files) {
//打印文件名
String name = file.getName();
log.error("删除的文件名" + name);
//判断子目录是否存在子目录,如果是文件则删除
if (f.isDirectory()) {
deleteFile(f);
} else {
f.delete();
}
}
//删除空文件夹 for循环已经把上一层节点的目录清空。
file.delete();
}
/**
*
* @date 2021/01/11
* @param imageUrl
* @param path
* @return
*/
public static String saveFile(String imageUrl, String path){
String filename = imageUrl.substring(imageUrl.lastIndexOf("/")+1, imageUrl.length());
log.error("图片===="+filename);
/**
*
*
* @param imageUrl
* @param path
* @return
* @date 2021/01/11
*/
public static String saveFile(String imageUrl, String path) {
String filename = imageUrl.substring(imageUrl.lastIndexOf("/") + 1, imageUrl.length());
log.error("图片====" + filename);
// Random rand = new Random();
// int s = rand.nextInt(900)+ 100;
int s = (int) (Math.random() * 10000);
log.error("随机数=="+s);
filename = s + filename; //这里如果有文件名称重复的,就取一个随机数拼接文件名
File sf= null;
OutputStream os = null;
InputStream is = null;
try {
// 构造URL
URL url = new URL(imageUrl);
// 打开连接
URLConnection con = url.openConnection();
//设置请求超时为5s
con.setConnectTimeout(5*1000);
// 输入流
is = con.getInputStream();
int s = (int) (Math.random() * 10000);
log.error("随机数==" + s);
filename = s + filename; //这里如果有文件名称重复的,就取一个随机数拼接文件名
File sf = null;
OutputStream os = null;
InputStream is = null;
try {
// 构造URL
URL url = new URL(imageUrl);
// 打开连接
URLConnection con = url.openConnection();
//设置请求超时为5s
con.setConnectTimeout(5 * 1000);
// 输入流
is = con.getInputStream();
// 1K的数据缓冲
byte[] bs = new byte[1024];
// 读取到的数据长度
int len;
// 输出的文件流
// 1K的数据缓冲
byte[] bs = new byte[1024];
// 读取到的数据长度
int len;
// 输出的文件流
// String path = "E:\\data\\nginxd\\sportsApplets";
// String path = "/data/nginxd/sportsApplets/excelDeleteImage/";
sf = new File(path);
if(!sf.exists()){
sf.mkdirs();
}
os = new FileOutputStream(sf.getPath()+"/"+filename);
// 开始读取
while ((len = is.read(bs)) != -1) {
os.write(bs, 0, len);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
// 完毕,关闭所有链接
try {
if(os!=null){
os.close();
}
if(is!=null){
is.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return sf.getPath()+"/"+filename;
}
sf = new File(path);
if (!sf.exists()) {
sf.mkdirs();
}
os = new FileOutputStream(sf.getPath() + "/" + filename);
// 开始读取
while ((len = is.read(bs)) != -1) {
os.write(bs, 0, len);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
// 完毕,关闭所有链接
try {
if (os != null) {
os.close();
}
if (is != null) {
is.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return sf.getPath() + "/" + filename;
}
/**
* java-map getClassfile
* @date 2021/01/11
* @param javaBean
* @return Map
* @throws Exception
*/
public static Map<String, Object> javaBean2Map(Object javaBean) throws Exception {
Map<String, Object> map = new LinkedHashMap<>();
//反射的实现方式:第一种
/**
* java-map getClassfile
*
* @param javaBean
* @return Map
* @throws Exception
* @date 2021/01/11
*/
public static Map<String, Object> javaBean2Map(Object javaBean) throws Exception {
Map<String, Object> map = new LinkedHashMap<>();
//反射的实现方式:第一种
/*Class<Student> studentClass = Student.class;
studentClass.getClass();*/
//第二种实现方式
Method[] methods = javaBean.getClass().getMethods(); // 获取所有方法
//第三种实现方式
/*Class.forName("类路径");*/
String fileName = null;
File[] files = null;
for (Method method : methods) {
if (method.getName().startsWith("get")) {
String field = method.getName(); // 拼接属性名
if (field.contains("getClass")){
continue;
}
field = field.substring(field.indexOf("get") + 3);
field = field.toLowerCase().charAt(0) + field.substring(1);
Object value = method.invoke(javaBean, (Object[]) null); // 执行方法
if (field.equals("images")){
fileName = field;
files = (File[]) value;
continue;
}
map.put(field, value);
}
}
if (fileName != null){
map.put(fileName,files);
}
return map;
}
//第二种实现方式
Method[] methods = javaBean.getClass().getMethods(); // 获取所有方法
//第三种实现方式
/*Class.forName("类路径");*/
String fileName = null;
File file = null;
for (Method method : methods) {
if (method.getName().startsWith("get")) {
String field = method.getName(); // 拼接属性名
if (field.contains("getClass")) {
continue;
}
field = field.substring(field.indexOf("get") + 3);
Object value = method.invoke(javaBean, (Object[]) null); // 执行方法
if (field.equals("USER_SIGN_FILE") || field.equals("PORTRAIT")) {
fileName = field;
file = (File) value;
continue;
}
if (fileName != null) {
map.put(fileName, file);
fileName = null;
} else {
map.put(field, value);
}
}
}
return map;
}
/**
*
* @date 2021/01/11
* @param originStr
* @return String
*/
public static String reverse(String originStr) {
if(originStr == null || originStr.length() <= 1)
return originStr;
String substring = originStr.substring(1);
String s = reverse(substring) + originStr.charAt(0);
return s;
}
/**
*
*
* @param originStr
* @return String
* @date 2021/01/11
*/
public static String reverse(String originStr) {
if (originStr == null || originStr.length() <= 1)
return originStr;
String substring = originStr.substring(1);
String s = reverse(substring) + originStr.charAt(0);
return s;
}
}

View File

@ -1,6 +1,6 @@
<?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.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper">
<mapper namespace="com.zcloud.mapper.datasource.eightwork.EightWorkVideoManagerMapper">
<!--表名 -->
<sql id="tableName">

View File

@ -1,191 +0,0 @@
<?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.zcloud.mapper.datasource.task.CourseExamMapper">
<!--表名 -->
<sql id="tableName">
BUS_COURSEEXAM
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.CURRICULUM_ID,
f.COURSEPAPERS_ID,
f.USER_ID,
f.EXAMTIME,
f.EXAMQUESTIONNUM,
f.EXAMQUESTIONRIGHT,
f.EXAMQUESTIONWRONG,
f.EXAMSCORE,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE,
f.CORPINFO_ID,
f.COURSEEXAM_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
CURRICULUM_ID,
COURSEPAPERS_ID,
USER_ID,
EXAMTIME,
EXAMQUESTIONNUM,
EXAMQUESTIONRIGHT,
EXAMQUESTIONWRONG,
EXAMSCORE,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
ISDELETE,
CORPINFO_ID,
COURSEEXAM_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{CURRICULUM_ID},
#{COURSEPAPERS_ID},
#{USER_ID},
#{EXAMTIME},
#{EXAMQUESTIONNUM},
#{EXAMQUESTIONRIGHT},
#{EXAMQUESTIONWRONG},
#{EXAMSCORE},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{ISDELETE},
#{CORPINFO_ID},
#{COURSEEXAM_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
COURSEEXAM_ID = #{COURSEEXAM_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
CURRICULUM_ID = #{CURRICULUM_ID},
COURSEPAPERS_ID = #{COURSEPAPERS_ID},
USER_ID = #{USER_ID},
EXAMTIME = #{EXAMTIME},
EXAMQUESTIONNUM = #{EXAMQUESTIONNUM},
EXAMQUESTIONRIGHT = #{EXAMQUESTIONRIGHT},
EXAMQUESTIONWRONG = #{EXAMQUESTIONWRONG},
EXAMSCORE = #{EXAMSCORE},
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME},
COURSEEXAM_ID = COURSEEXAM_ID
where
COURSEEXAM_ID = #{COURSEEXAM_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
,u.NAME USERNAME
,p.EXAMNAME
,p.EXAMTIME
,p.ANSWERSHEETTIME
,p.EXAMSCORE
,p.CURRICULUMUSERS
,p.QUESTIONNUM
from
<include refid="tableName"></include> f
LEFT JOIN sys_user u ON u.USER_ID = f.USER_ID
LEFT JOIN BUS_COURSEPAPERS p ON p.COURSEPAPERS_ID = f.COURSEPAPERS_ID
where
f.COURSEEXAM_ID = #{COURSEEXAM_ID}
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- 根据需求自己加检索条件
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
ORDER BY f.OPERATTIME DESC
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
COURSEEXAM_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 列表(根据所选ID获取数据) -->
<select id="findByIds" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
COURSEEXAM_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>

View File

@ -1,207 +0,0 @@
<?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.zcloud.mapper.datasource.task.CourseExamRecordMapper">
<!--表名 -->
<sql id="tableName">
BUS_COURSEEXAMRECORD
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.CURRICULUM_ID,
f.COURSEPAPERS_ID,
f.COURSEEXAM_ID,
f.COURSEWARE_ID,
f.COURSEWARETYPE,
f.QUESTION_ID,
f.USER_ID,
f.ANSWER,
f.ANSWERRIGHT,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE,
f.CORPINFO_ID,
f.COURSEEXAMRECORD_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
CURRICULUM_ID,
COURSEPAPERS_ID,
COURSEEXAM_ID,
COURSEWARE_ID,
COURSEWARETYPE,
QUESTION_ID,
USER_ID,
ANSWER,
ANSWERRIGHT,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
ISDELETE,
CORPINFO_ID,
COURSEEXAMRECORD_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{CURRICULUM_ID},
#{COURSEPAPERS_ID},
#{COURSEEXAM_ID},
#{COURSEWARE_ID},
#{COURSEWARETYPE},
#{QUESTION_ID},
#{USER_ID},
#{ANSWER},
#{ANSWERRIGHT},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{ISDELETE},
#{CORPINFO_ID},
#{COURSEEXAMRECORD_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
COURSEEXAMRECORD_ID = #{COURSEEXAMRECORD_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
CURRICULUM_ID = #{CURRICULUM_ID},
COURSEPAPERS_ID = #{COURSEPAPERS_ID},
COURSEEXAM_ID = #{COURSEEXAM_ID},
COURSEWARE_ID = #{COURSEWARE_ID},
COURSEWARETYPE = #{COURSEWARETYPE},
QUESTION_ID = #{QUESTION_ID},
USER_ID = #{USER_ID},
ANSWE = #{ANSWE},
ANSWERIGHT = #{ANSWERIGHT},
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME},
COURSEEXAMRECORD_ID = COURSEEXAMRECORD_ID
where
COURSEEXAMRECORD_ID = #{COURSEEXAMRECORD_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.COURSEEXAMRECORD_ID = #{COURSEEXAMRECORD_ID}
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- 根据需求自己加检索条件
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
ORDER BY f.OPERATTIME DESC
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
COURSEEXAMRECORD_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 列表(根据所选ID获取数据) -->
<select id="findByIds" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
COURSEEXAMRECORD_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<!-- 试卷答题展示(获取答题情况) -->
<select id="findByExam" parameterType="pd" resultType="pd">
select
f.COURSEEXAMRECORD_ID,
f.ANSWER,
f.ANSWERRIGHT,
q.QUESTION_ID,
q.QUESTIONTYPE,
q.QUESTIONDRY,
q.OPTIONA,
q.OPTIONB,
q.OPTIONC,
q.OPTIOND
from
<include refid="tableName"></include> f
LEFT JOIN BUS_QUESTION q ON q.QUESTION_ID = f.QUESTION_ID AND q.ISDELETE = '0'
where f.ISDELETE = '0'
AND f.COURSEEXAM_ID = #{COURSEEXAM_ID}
ORDER BY q.CREATTIME ASC
</select>
</mapper>

View File

@ -1,174 +0,0 @@
<?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.zcloud.mapper.datasource.task.CourseStudyMapper">
<!--表名 -->
<sql id="tableName">
BUS_COURSESTUDY
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.CURRICULUM_ID,
f.USER_ID,
f.STUDYTIME,
f.STUDYQUESTIONNUM,
f.STUDYQUESTIONRIGHT,
f.STUDYQUESTIONWRONG,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE,
f.CORPINFO_ID,
f.COURSESTUDY_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
CURRICULUM_ID,
USER_ID,
STUDYTIME,
STUDYQUESTIONNUM,
STUDYQUESTIONRIGHT,
STUDYQUESTIONWRONG,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
ISDELETE,
CORPINFO_ID,
COURSESTUDY_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{CURRICULUM_ID},
#{USER_ID},
#{STUDYTIME},
#{STUDYQUESTIONNUM},
#{STUDYQUESTIONRIGHT},
#{STUDYQUESTIONWRONG},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{ISDELETE},
#{CORPINFO_ID},
#{COURSESTUDY_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
COURSESTUDY_ID = #{COURSESTUDY_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
CURRICULUM_ID = #{CURRICULUM_ID},
USER_ID = #{USER_ID},
STUDYTIME = #{STUDYTIME},
STUDYQUESTIONNUM = #{STUDYQUESTIONNUM},
STUDYQUESTIONRIGHT = #{STUDYQUESTIONRIGHT},
STUDYQUESTIONWRONG = #{STUDYQUESTIONWRONG},
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME},
COURSESTUDY_ID = COURSESTUDY_ID
where
COURSESTUDY_ID = #{COURSESTUDY_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.COURSESTUDY_ID = #{COURSESTUDY_ID}
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- 根据需求自己加检索条件
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
ORDER BY f.OPERATTIME DESC
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
COURSESTUDY_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 列表(根据所选ID获取数据) -->
<select id="findByIds" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
COURSESTUDY_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>

View File

@ -1,182 +0,0 @@
<?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.zcloud.mapper.datasource.task.CourseStudyRecordMapper">
<!--表名 -->
<sql id="tableName">
BUS_COURSESTUDYRECORD
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.COURSESTUDY_ID,
f.CURRICULUM_ID,
f.COURSEWARE_ID,
f.COURSEWARETYPE,
f.QUESTION_ID,
f.USER_ID,
f.ANSWER,
f.ANSWERRIGHT,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE,
f.CORPINFO_ID,
f.COURSESTUDYRECORD_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
COURSESTUDY_ID,
CURRICULUM_ID,
COURSEWARE_ID,
COURSEWARETYPE,
QUESTION_ID,
USER_ID,
ANSWER,
ANSWERRIGHT,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
ISDELETE,
CORPINFO_ID,
COURSESTUDYRECORD_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{COURSESTUDY_ID},
#{CURRICULUM_ID},
#{COURSEWARE_ID},
#{COURSEWARETYPE},
#{QUESTION_ID},
#{USER_ID},
#{ANSWER},
#{ANSWERRIGHT},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{ISDELETE},
#{CORPINFO_ID},
#{COURSESTUDYRECORD_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
COURSESTUDYRECORD_ID = #{COURSESTUDYRECORD_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
COURSESTUDY_ID = #{COURSESTUDY_ID},
CURRICULUM_ID = #{CURRICULUM_ID},
COURSEWARE_ID = #{COURSEWARE_ID},
COURSEWARETYPE = #{COURSEWARETYPE},
QUESTION_ID = #{QUESTION_ID},
USER_ID = #{USER_ID},
ANSWER = #{ANSWER},
ANSWERRIGHT = #{ANSWERRIGHT},
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME},
COURSESTUDYRECORD_ID = COURSESTUDYRECORD_ID
where
COURSESTUDYRECORD_ID = #{COURSESTUDYRECORD_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.COURSESTUDYRECORD_ID = #{COURSESTUDYRECORD_ID}
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- 根据需求自己加检索条件
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
ORDER BY f.OPERATTIME DESC
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
COURSESTUDYRECORD_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 列表(根据所选ID获取数据) -->
<select id="findByIds" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
COURSESTUDYRECORD_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>

View File

@ -1,225 +0,0 @@
<?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.zcloud.mapper.datasource.task.CourseStudyVideoRecordMapper">
<!--表名 -->
<sql id="tableName">
BUS_COURSESTUDYVIDEORECORD
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.CURRICULUM_ID,
f.VIDEOCOURSEWARE_ID,
f.USER_ID,
f.RESOURCETIME,
f.PLAYCOUNT,
f.TYPE,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE,
f.CORPINFO_ID,
f.STUDYTASK_ID,
f.COURSESTUDYVIDEORECORD_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
CURRICULUM_ID,
VIDEOCOURSEWARE_ID,
USER_ID,
RESOURCETIME,
PLAYCOUNT,
TYPE,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
ISDELETE,
CORPINFO_ID,
STUDYTASK_ID,
COURSESTUDYVIDEORECORD_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{CURRICULUM_ID},
#{VIDEOCOURSEWARE_ID},
#{USER_ID},
#{RESOURCETIME},
#{PLAYCOUNT},
#{TYPE},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{ISDELETE},
#{CORPINFO_ID},
#{STUDYTASK_ID},
#{COURSESTUDYVIDEORECORD_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
COURSESTUDYVIDEORECORD_ID = #{COURSESTUDYVIDEORECORD_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
CURRICULUM_ID = #{CURRICULUM_ID},
VIDEOCOURSEWARE_ID = #{VIDEOCOURSEWARE_ID},
USER_ID = #{USER_ID},
RESOURCETIME = #{RESOURCETIME},
PLAYCOUNT = #{PLAYCOUNT},
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME},
COURSESTUDYVIDEORECORD_ID = COURSESTUDYVIDEORECORD_ID
where
COURSESTUDYVIDEORECORD_ID = #{COURSESTUDYVIDEORECORD_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.COURSESTUDYVIDEORECORD_ID = #{COURSESTUDYVIDEORECORD_ID}
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- 根据需求自己加检索条件
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
ORDER BY f.OPERATTIME DESC
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0'
<if test="CURRICULUM_ID != null and CURRICULUM_ID != ''">
and f.CURRICULUM_ID = #{CURRICULUM_ID}
</if>
<if test="VIDEOCOURSEWARE_ID != null and VIDEOCOURSEWARE_ID != ''">
and f.VIDEOCOURSEWARE_ID = #{VIDEOCOURSEWARE_ID}
</if>
<if test="USER_ID != null and USER_ID != ''">
and f.USER_ID = #{USER_ID}
</if>
<if test="CORPINFO_ID != null and CORPINFO_ID != ''">
and f.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="STUDYTASK_ID != null and STUDYTASK_ID != ''">
and f.STUDYTASK_ID = #{STUDYTASK_ID}
</if>
ORDER BY f.OPERATTIME DESC
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
COURSESTUDYVIDEORECORD_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 列表(根据所选ID获取数据) -->
<select id="findByIds" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
COURSESTUDYVIDEORECORD_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<!-- 列表(全部) -->
<select id="listAllByCount" parameterType="pd" resultType="pd">
select f.VIDEOCOURSEWARE_ID,
IF(f.TYPE='1',v.CLASSHOUR,d.CLASSHOUR) CLASSHOUR
from BUS_COURSESTUDYVIDEORECORD f
LEFT JOIN BUS_VIDEOCOURSEWARE v on f.VIDEOCOURSEWARE_ID = v.VIDEOCOURSEWARE_ID
LEFT JOIN BUS_DATACOURSEWARE d on f.VIDEOCOURSEWARE_ID = d.DATACOURSEWARE_ID
WHERE
f.ISDELETE = '0' AND f.PLAYCOUNT > 0
<!-- 考虑有相同的课件,需要去重统计-->
<!-- <if test="CURRICULUM_ID != null and CURRICULUM_ID != ''">-->
<!-- AND f.CURRICULUM_ID = #{CURRICULUM_ID}-->
<!-- </if>-->
<if test="USER_ID != null and USER_ID != ''">
AND f.USER_ID = #{USER_ID}
</if>
<if test="STUDYTASK_ID != null and STUDYTASK_ID != ''">
AND f.STUDYTASK_ID = #{STUDYTASK_ID}
</if>
GROUP BY f.VIDEOCOURSEWARE_ID, f.TYPE
</select>
<!-- 修改 -->
<update id="editResourceTime" parameterType="pd">
update
<include refid="tableName"></include>
set
RESOURCETIME = #{RESOURCETIME},
PLAYCOUNT = #{PLAYCOUNT},
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
WHERE
COURSESTUDYVIDEORECORD_ID = #{COURSESTUDYVIDEORECORD_ID}
</update>
</mapper>

View File

@ -1,234 +0,0 @@
<?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.zcloud.mapper.datasource.task.StageExamMapper">
<!--表名 -->
<sql id="tableName">
BUS_STAGEEXAM
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.CURRICULUM_ID,
f.STAGEEXAMPAPER_ID,
f.USER_ID,
f.EXAMTIMEBEGIN,
f.EXAMTIMEEND,
f.EXAMQUESTIONNUM,
f.EXAMQUESTIONRIGHT,
f.EXAMQUESTIONWRONG,
f.EXAMSCORE,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE,
f.CORPINFO_ID,
f.STUDYTASK_ID,
f.STAGEEXAM_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
CURRICULUM_ID,
STAGEEXAMPAPER_ID,
USER_ID,
EXAMTIMEBEGIN,
EXAMTIMEEND,
EXAMQUESTIONNUM,
EXAMQUESTIONRIGHT,
EXAMQUESTIONWRONG,
EXAMSCORE,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
ISDELETE,
CORPINFO_ID,
STUDYTASK_ID,
STAGEEXAM_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{CURRICULUM_ID},
#{STAGEEXAMPAPER_ID},
#{USER_ID},
#{EXAMTIMEBEGIN},
#{EXAMTIMEEND},
#{EXAMQUESTIONNUM},
#{EXAMQUESTIONRIGHT},
#{EXAMQUESTIONWRONG},
#{EXAMSCORE},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{ISDELETE},
#{CORPINFO_ID},
#{STUDYTASK_ID},
#{STAGEEXAM_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
STAGEEXAM_ID = #{STAGEEXAM_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
CURRICULUM_ID = #{CURRICULUM_ID},
STAGEEXAMPAPER_ID = #{STAGEEXAMPAPER_ID},
USER_ID = #{USER_ID},
EXAMTIMEBEGIN = #{EXAMTIMEBEGIN},
EXAMTIMEEND = #{EXAMTIMEEND},
EXAMQUESTIONNUM = #{EXAMQUESTIONNUM},
EXAMQUESTIONRIGHT = #{EXAMQUESTIONRIGHT},
EXAMQUESTIONWRONG = #{EXAMQUESTIONWRONG},
EXAMSCORE = #{EXAMSCORE},
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME},
STAGEEXAM_ID = STAGEEXAM_ID
where
STAGEEXAM_ID = #{STAGEEXAM_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
,u.NAME USERNAME
,p.EXAMNAME
,p.EXAMTIME
,p.ANSWERSHEETTIME
,p.EXAMSCORE
,p.CURRICULUMUSERS
,p.QUESTIONNUM
from
<include refid="tableName"></include> f
LEFT JOIN sys_user u ON u.USER_ID = f.USER_ID
LEFT JOIN BUS_STAGEEXAMPAPER p ON p.STAGEEXAMPAPER_ID = f.STAGEEXAMPAPER_ID
where
f.STAGEEXAM_ID = #{STAGEEXAM_ID}
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- 根据需求自己加检索条件
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
ORDER BY f.OPERATTIME DESC
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
STAGEEXAM_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 列表(根据所选ID获取数据) -->
<select id="findByIds" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
STAGEEXAM_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<!-- 通过ID获取数据 -->
<select id="findByPaperUser" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
,u.NAME USERNAME
,p.EXAMNAME
,p.EXAMTIME
,p.ANSWERSHEETTIME
,p.EXAMSCORE
,p.CURRICULUMUSERS
,p.QUESTIONNUM
from
<include refid="tableName"></include> f
LEFT JOIN sys_user u ON u.USER_ID = f.USER_ID
LEFT JOIN BUS_STAGEEXAMPAPER p ON p.STAGEEXAMPAPER_ID = f.STAGEEXAMPAPER_ID
where
f.STUDYTASK_ID = #{STUDYTASK_ID} AND f.STAGEEXAMPAPER_ID = #{STAGEEXAMPAPER_ID} AND f.USER_ID = #{USER_ID}
ORDER BY f.CREATTIME desc
LIMIT 1
</select>
<!-- 根据任务id获取全部用户的全部考试成绩 -->
<select id="getUserExamScoreByStudystaskId" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
,(select r.USER_SIGN_PATH from BUS_STAGESTUDENTRELATION r where r.ISDELETE = '0' and r.STUDYTASK_ID = f.STUDYTASK_ID and r.USER_ID = f.USER_ID) AS USER_SIGN_PATH
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{CORPINFO_ID}
<if test="STUDYTASK_ID!= null and STUDYTASK_ID != ''"><!-- 关键词检索 -->
and f.STUDYTASK_ID =#{STUDYTASK_ID}
</if>
<if test="USER_ID!= null and USER_ID != ''"><!-- 关键词检索 -->
and f.USER_ID =#{USER_ID}
</if>
</select>
</mapper>

View File

@ -1,213 +0,0 @@
<?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.zcloud.mapper.datasource.task.StageExamRecordMapper">
<!--表名 -->
<sql id="tableName">
BUS_STAGEEXAMRECORD
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.STAGEEXAMPAPER_ID,
f.CURRICULUM_ID,
f.COURSEWARE_ID,
f.COURSEWARETYPE,
f.QUESTION_ID,
f.ANSWER,
f.USER_ID,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE,
f.CORPINFO_ID,
f.STAGEEXAM_ID,
f.ANSWERRIGHT,
f.STUDYTASK_ID,
f.STAGEEXAMRECORD_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
STAGEEXAMPAPER_ID,
CURRICULUM_ID,
COURSEWARE_ID,
COURSEWARETYPE,
QUESTION_ID,
ANSWER,
USER_ID,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
ISDELETE,
CORPINFO_ID,
STAGEEXAM_ID,
ANSWERRIGHT,
STUDYTASK_ID,
STAGEEXAMRECORD_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{STAGEEXAMPAPER_ID},
#{CURRICULUM_ID},
#{COURSEWARE_ID},
#{COURSEWARETYPE},
#{QUESTION_ID},
#{ANSWER},
#{USER_ID},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{ISDELETE},
#{CORPINFO_ID},
#{STAGEEXAM_ID},
#{ANSWERRIGHT},
#{STUDYTASK_ID},
#{STAGEEXAMRECORD_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
STAGEEXAMRECORD_ID = #{STAGEEXAMRECORD_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
STAGEEXAMPAPER_ID = #{STAGEEXAMPAPER_ID},
CURRICULUM_ID = #{CURRICULUM_ID},
COURSEWARE_ID = #{COURSEWARE_ID},
COURSEWARETYPE = #{COURSEWARETYPE},
QUESTION_ID = #{QUESTION_ID},
ANSWER = #{ANSWER},
USER_ID = #{USER_ID},
STAGEEXAM_ID = #{STAGEEXAM_ID},
ANSWERRIGHT = #{ANSWERRIGHT},
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME},
STAGEEXAMRECORD_ID = STAGEEXAMRECORD_ID
where
STAGEEXAMRECORD_ID = #{STAGEEXAMRECORD_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.STAGEEXAMRECORD_ID = #{STAGEEXAMRECORD_ID}
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- 根据需求自己加检索条件
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
ORDER BY f.OPERATTIME DESC
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
STAGEEXAMRECORD_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 列表(根据所选ID获取数据) -->
<select id="findByIds" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
STAGEEXAMRECORD_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<!-- 试卷答题展示(获取答题情况) -->
<select id="findByExam" parameterType="pd" resultType="pd">
select
f.STAGEEXAMRECORD_ID,
f.ANSWER,
f.ANSWERRIGHT,
q.QUESTION_ID,
q.QUESTIONTYPE,
q.QUESTIONDRY,
q.OPTIONA,
q.OPTIONB,
q.OPTIONC,
q.OPTIOND
from
<include refid="tableName"></include> f
LEFT JOIN BUS_QUESTION q ON q.QUESTION_ID = f.QUESTION_ID AND q.ISDELETE = '0'
where f.ISDELETE = '0'
AND f.STAGEEXAM_ID = #{STAGEEXAM_ID}
<if test="STUDYTASK_ID!= null and STUDYTASK_ID != ''"><!-- 关键词检索 -->
and f.STUDYTASK_ID =#{STUDYTASK_ID}
</if>
order by q.QUESTIONTYPE asc,q.QUESTIONNUMBER+0 asc,q.COURSEWARETYPE asc
</select>
</mapper>

View File

@ -1,487 +0,0 @@
<?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.zcloud.mapper.datasource.task.StageStudentRelationMapper">
<!--表名 -->
<sql id="tableName">
BUS_STAGESTUDENTRELATION
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.STAGEEXAMPAPER_ID,
f.USER_ID,
f.STAGEEXAMSTATE,
f.STAGEEXAMSCORE,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE,
f.CORPINFO_ID,
f.STUDYTASK_ID,
f.COMPLETE_COURSEWARE,
f.COMPLETE_CLASSHOUR,
f.STAGESTUDENTRELATION_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
STAGEEXAMPAPER_ID,
USER_ID,
STAGEEXAMSTATE,
STAGEEXAMSCORE,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
ISDELETE,
CORPINFO_ID,
STUDYTASK_ID,
COMPLETE_COURSEWARE,
COMPLETE_CLASSHOUR,
STAGESTUDENTRELATION_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{STAGEEXAMPAPER_ID},
#{USER_ID},
#{STAGEEXAMSTATE},
#{STAGEEXAMSCORE},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{ISDELETE},
#{CORPINFO_ID},
#{STUDYTASK_ID},
#{COMPLETE_COURSEWARE},
#{COMPLETE_CLASSHOUR},
#{STAGESTUDENTRELATION_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
STAGESTUDENTRELATION_ID = #{STAGESTUDENTRELATION_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
STAGEEXAMPAPER_ID = #{STAGEEXAMPAPER_ID},
USER_ID = #{USER_ID},
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME},
STAGESTUDENTRELATION_ID = STAGESTUDENTRELATION_ID
where
STAGESTUDENTRELATION_ID = #{STAGESTUDENTRELATION_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.STAGESTUDENTRELATION_ID = #{STAGESTUDENTRELATION_ID}
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
u.NAME USERNAME,
d.NAME LEARNERCATEGORYNAME,
<include refid="Field"></include>
from
<include refid="tableName"></include> f
LEFT JOIN SYS_USER u on f.USER_ID = u.USER_ID
LEFT JOIN <include refid="dicTableName"></include> d on d.DICTIONARIES_ID = u.LEARNERCATEGORY AND d.parent_id = '532282f9c48346b8b646531909c739df'
where f.ISDELETE = '0' and f.STAGEEXAMPAPER_ID = #{pd.STAGEEXAMPAPER_ID}
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and u.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
</if>
ORDER BY f.OPERATTIME DESC
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
f.STAGESTUDENTRELATION_ID,
f.STAGEEXAMPAPER_ID,
f.USER_ID,
f.STAGEEXAMSTATE,
f.STAGEEXAMSCORE,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE,
f.CORPINFO_ID,
f.STUDYTASK_ID,
f.COMPLETE_COURSEWARE,
u.NAME AS USER_NAME,
u.USERNAME as PHONE,
d.NAME AS DEPARTMENT_NAME,
x.NAME AS SEX_NAME,
i.USER_ID_CARD,
p.NAME POSTNAME,
u.USERNAME,
u.NAME,
TRUNCATE((IF(cr.RESOURCETIME IS NULL,0,(cr.RESOURCETIME DIV 60))+f.COMPLETE_CLASSHOUR),0) COMPLETE_CLASSHOUR,
stu.SUM_CLASSHOUR as SUM_CLASSHOUR
from
<include refid="tableName"></include> f
left join SYS_USER u on u.USER_ID = f.USER_ID
left join OA_DEPARTMENT d on d.DEPARTMENT_ID=u.DEPARTMENT_ID
left join SYS_USERINFO i on i.USER_ID = f.USER_ID
left join SYS_DICTIONARIES x on x.DICTIONARIES_ID = i.SEX
left join sys_post p on p.POST_ID = u.POST_ID and p.ISDELETE = '0' and p.STATUS = '0'
left join bus_studytask stu on stu.STUDYTASK_ID = f.STUDYTASK_ID
left join (select sum(co.RESOURCETIME) RESOURCETIME,co.STUDYTASK_ID,co.USER_ID from BUS_COURSESTUDYVIDEORECORD co where co.PLAYCOUNT = 0
group by co.STUDYTASK_ID,co.USER_ID) cr ON cr.STUDYTASK_ID = f.STUDYTASK_ID and cr.USER_ID = f.USER_ID
where f.ISDELETE = '0' and f.CORPINFO_ID = #{CORPINFO_ID}
<if test="STUDYTASK_ID!= null and STUDYTASK_ID != ''"><!-- 关键词检索 -->
and f.STUDYTASK_ID =#{STUDYTASK_ID}
</if>
<if test="USER_ID!= null and USER_ID != ''"><!-- 关键词检索 -->
and f.USER_ID =#{USER_ID}
</if>
<if test="userkey!= null and userkey != ''"><!-- 关键词检索 -->
and
(
u.USERNAME LIKE CONCAT(CONCAT('%', #{userkey}),'%')
or
u.EMAIL LIKE CONCAT(CONCAT('%', #{userkey}),'%')
or
u.NUMBER LIKE CONCAT(CONCAT('%', #{userkey}),'%')
or
u.NAME LIKE CONCAT(CONCAT('%', #{userkey}),'%')
or
u.PHONE LIKE CONCAT(CONCAT('%', #{userkey}),'%')
)
</if>
<if test="DEPARTMENT_ID!= null and DEPARTMENT_ID != ''"><!-- 用户部门 -->
and u.DEPARTMENT_ID = #{DEPARTMENT_ID}
</if>
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
STAGESTUDENTRELATION_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 列表(根据所选ID获取数据) -->
<select id="findByIds" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
STAGESTUDENTRELATION_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<!-- 列表(全部) -->
<select id="findByExamPaper" parameterType="pd" resultType="pd">
select
f.USER_ID
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.STAGEEXAMPAPER_ID = #{STAGEEXAMPAPER_ID}
</select>
<!-- 删除(根据试卷ID删除考试人员)-->
<delete id="deleteByExamPaper" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where ISDELETE = '0'
AND STAGEEXAMPAPER_ID = #{STAGEEXAMPAPER_ID}
</delete>
<!-- 列表【我的考试】(获取当前用户的所属阶段考试信息) -->
<select id="pageDataByUserlistPage" parameterType="page" resultType="pd">
select
p.STAGEEXAMPAPER_ID,
p.EXAMNAME,
p.EXAMTIME,
p.ANSWERSHEETTIME,
p.EXAMSCORE,
p.QUESTIONNUM,
p.EXAMSTATE,
f.STAGESTUDENTRELATION_ID,
f.STAGEEXAMSTATE,
f.STAGEEXAMSCORE
from
<include refid="tableName"></include> f
LEFT JOIN BUS_STAGEEXAMPAPER p ON p.STAGEEXAMPAPER_ID = f.STAGEEXAMPAPER_ID AND p.ISDELETE = '0'
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
p.EXAMNAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
<!-- 根据需求自己加检索条件
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
<if test="pd.EXAMSTATE != null and pd.EXAMSTATE != ''">
<choose>
<when test="pd.EXAMSTATE == 1"> <!-- 未开始 -->
and f.STAGEEXAMSTATE = #{pd.EXAMSTATE} and p.EXAMTIME &gt;= NOW()
</when>
<when test="pd.EXAMSTATE == 2"> <!-- 进行中 -->
and f.STAGEEXAMSTATE = '1' and p.EXAMTIME &lt;= NOW()
</when>
<when test="pd.EXAMSTATE == 3"> <!-- 已通过 -->
and f.STAGEEXAMSTATE = #{pd.EXAMSTATE}
</when>
<when test="pd.EXAMSTATE == 4"> <!-- 已结束 -->
and f.STAGEEXAMSTATE in ('3','4')
</when>
</choose>
</if>
AND f.USER_ID = #{pd.USER_ID}
GROUP BY f.STAGEEXAMPAPER_ID ORDER BY p.EXAMTIME DESC
</select>
<!-- 修改(更新学员考试状态) -->
<update id="updateStudentState" parameterType="pd">
update
<include refid="tableName"></include>
set
<if test="USER_SIGN_PATH!= null and USER_SIGN_PATH != ''"><!-- 关键词检索 -->
USER_SIGN_PATH = #{USER_SIGN_PATH},
</if>
STAGEEXAMSTATE = #{STAGEEXAMSTATE},
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
STAGESTUDENTRELATION_ID = #{STAGESTUDENTRELATION_ID}
</update>
<!-- 修改(更新学员考试成绩及状态) -->
<update id="updateStudentScore" parameterType="pd">
update
<include refid="tableName"></include>
set
<if test="STAGEEXAMSCORE != null and STAGEEXAMSCORE != ''">
STAGEEXAMSCORE = #{STAGEEXAMSCORE},
</if>
<if test="STAGEEXAMSTATE != null and STAGEEXAMSTATE != ''">
STAGEEXAMSTATE = #{STAGEEXAMSTATE},
</if>
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
STAGESTUDENTRELATION_ID = #{STAGESTUDENTRELATION_ID}
</update>
<!-- 处理没有参加考试的学员阶考考试未考STAGEEXAMSTATE = '4' -->
<update id="overStage" parameterType="pd">
update
<include refid="tableName"></include> f
LEFT JOIN BUS_STAGEEXAMPAPER p ON p.STAGEEXAMPAPER_ID = f.STAGEEXAMPAPER_ID AND p.ISDELETE = '0'
set
f.STAGEEXAMSTATE = '4',
f.OPERATTIME = #{OPERATTIME}
where f.STAGEEXAMSTATE = '1'
AND SUBSTR(DATE_ADD(CONCAT_WS(':', p.EXAMTIME, '00'), INTERVAL p.ANSWERSHEETTIME MINUTE),1,10) = #{ENDTIME}
</update>
<!-- 列表【app我的任务】获取当前用户的所属任务信息列表 -->
<select id="pageTaskByUserlistPage" parameterType="page" resultType="pd">
select
t.STUDYTASK_ID,
t.STUDY_NAME,
t.PEIXUE_START_TIME,
t.PEIXUE_END_TIME,
t.STATE,
t.COURSEWARE_COUNT,
f.COMPLETE_COURSEWARE,
dic1.name POSTTYPENAME,
dic2.name TRAINTYPENAME,
p.STAGEEXAMPAPER_ID,
p.EXAMNAME,
p.EXAMTIME,
p.ANSWERSHEETTIME,
p.EXAMSCORE,
p.QUESTIONNUM,
p.EXAMSTATE,
p.PASSSCORE,
f.STAGESTUDENTRELATION_ID,
f.STAGEEXAMSTATE,
(select count(*) from BUS_STAGEEXAM stag where stag.STUDYTASK_ID = f.STUDYTASK_ID and stag.USER_ID =#{pd.USER_ID} ) as ksCount ,
p.NUMBER_OF_EXAMINATIONS,
f.STAGEEXAMSCORE
from
<include refid="tableName"></include> f
INNER JOIN BUS_STUDYTASK t ON t.STUDYTASK_ID = f.STUDYTASK_ID AND t.ISDELETE = '0'
LEFT JOIN BUS_STAGEEXAMPAPER p ON p.STAGEEXAMPAPER_ID = f.STAGEEXAMPAPER_ID AND p.ISDELETE = '0'
LEFT JOIN SYS_DICTIONARIES dic1 ON dic1.DICTIONARIES_ID = t.POSTTYPE
LEFT JOIN SYS_DICTIONARIES dic2 ON dic2.DICTIONARIES_ID = t.TRAINTYPE
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
AND f.USER_ID = #{pd.USER_ID}
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- 根据需求自己加检索条件-->
t.STUDY_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
)
</if>
<if test="pd.STATUS != null and pd.STATUS != ''"><!-- 关键词检索 -->
<if test="pd.STATUS != null and pd.STATUS == 1">
and DATE_FORMAT( t.PEIXUE_START_TIME, '%Y-%m-%d' ) &gt; DATE_FORMAT( NOW(), '%Y-%m-%d' )
</if>
<if test="pd.STATUS != null and pd.STATUS == 2">
and DATE_FORMAT( t.PEIXUE_START_TIME, '%Y-%m-%d' ) &lt;= DATE_FORMAT( NOW(), '%Y-%m-%d' )
and DATE_FORMAT( t.PEIXUE_END_TIME, '%Y-%m-%d' ) &gt;= DATE_FORMAT( NOW(), '%Y-%m-%d' )
</if>
<if test="pd.STATUS != null and pd.STATUS == 3">
and DATE_FORMAT( t.PEIXUE_END_TIME, '%Y-%m-%d' ) &lt; DATE_FORMAT( NOW(), '%Y-%m-%d' )
</if>
</if>
<if test="pd.examinationState != null and pd.examinationState != ''"><!-- 关键词检索 -->
and f.STAGEEXAMSTATE =#{pd.examinationState}
</if>
GROUP BY f.STAGEEXAMPAPER_ID ORDER BY p.EXAMTIME DESC
</select>
<!-- 列表【app成绩查询】获取当前用户的所属考试信息列表 -->
<select id="pageTaskScoreByUserlistPage" parameterType="page" resultType="pd">
select
t.STUDYTASK_ID,
t.STUDY_NAME,
p.STAGEEXAMPAPER_ID,
p.EXAMNAME,
p.EXAMTIME,
p.ANSWERSHEETTIME,
p.EXAMSCORE,
p.QUESTIONNUM,
p.EXAMSTATE,
p.PASSSCORE,
f.STAGESTUDENTRELATION_ID,
f.STAGEEXAMSTATE,
f.STAGEEXAMSCORE
from
<include refid="tableName"></include> f
LEFT JOIN BUS_STUDYTASK t ON t.STUDYTASK_ID = f.STUDYTASK_ID AND t.ISDELETE = '0'
LEFT JOIN BUS_STAGEEXAMPAPER p ON p.STAGEEXAMPAPER_ID = f.STAGEEXAMPAPER_ID AND p.ISDELETE = '0'
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
and f.STAGEEXAMSTATE in ('2','3')
and f.STAGEEXAMSCORE != '-1' -- 未参加考试
AND f.USER_ID = #{pd.USER_ID}
GROUP BY f.STAGEEXAMPAPER_ID ORDER BY p.EXAMTIME DESC
</select>
<!-- 列表【app成绩查询】获取当前用户的所属考试所有信息列表 -->
<select id="pageTaskScoreByUserAll" parameterType="page" resultType="pd">
select
t.STUDYTASK_ID,
t.STUDY_NAME,
p.STAGEEXAMPAPER_ID,
p.EXAMNAME,
p.EXAMTIME,
p.ANSWERSHEETTIME,
p.EXAMSCORE,
p.QUESTIONNUM,
p.EXAMSTATE,
p.PASSSCORE,
f.STAGESTUDENTRELATION_ID,
f.STAGEEXAMSTATE,
f.STAGEEXAMSCORE
from
<include refid="tableName"></include> f
LEFT JOIN BUS_STUDYTASK t ON t.STUDYTASK_ID = f.STUDYTASK_ID AND t.ISDELETE = '0'
LEFT JOIN BUS_STAGEEXAMPAPER p ON p.STAGEEXAMPAPER_ID = f.STAGEEXAMPAPER_ID AND p.ISDELETE = '0'
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
and f.STAGEEXAMSTATE in ('2','3')
and f.STAGEEXAMSCORE != '-1' -- 未参加考试
AND f.USER_ID = #{pd.USER_ID}
GROUP BY f.STAGEEXAMPAPER_ID ORDER BY p.EXAMTIME DESC
</select>
<!-- 列表【app学习详细】根据STAGESTUDENTRELATION_ID获取当前的修改任务 -->
<select id="getMyTask" parameterType="pd" resultType="pd">
select
t.STUDYTASK_ID,
t.STUDY_NAME,
t.COURSEWARE_COUNT,
p.STAGEEXAMPAPER_ID,
p.EXAMNAME,
p.EXAMTIME,
p.ANSWERSHEETTIME,
p.EXAMSCORE,
p.QUESTIONNUM,
p.EXAMSTATE,
p.PASSSCORE,
f.STAGESTUDENTRELATION_ID,
f.STAGEEXAMSTATE,
f.STAGEEXAMSCORE,
f.COMPLETE_COURSEWARE,
( SELECT count(stag.USER_ID) FROM BUS_STAGEEXAM stag WHERE stag.STUDYTASK_ID = f.STUDYTASK_ID AND stag.USER_ID = #{USER_ID} ) AS ksCount,
p.NUMBER_OF_EXAMINATIONS
from
<include refid="tableName"></include> f
LEFT JOIN BUS_STUDYTASK t ON t.STUDYTASK_ID = f.STUDYTASK_ID AND t.ISDELETE = '0'
LEFT JOIN BUS_STAGEEXAMPAPER p ON p.STAGEEXAMPAPER_ID = f.STAGEEXAMPAPER_ID AND p.ISDELETE = '0'
where f.STAGESTUDENTRELATION_ID = #{STAGESTUDENTRELATION_ID}
</select>
<!-- 修改 -->
<update id="updateClassHourAndCount" parameterType="pd">
update
<include refid="tableName"></include>
set
COMPLETE_COURSEWARE = #{COMPLETE_COURSEWARE},
COMPLETE_CLASSHOUR = #{COMPLETE_CLASSHOUR}
where
USER_ID = #{USER_ID}
and STUDYTASK_ID =#{STUDYTASK_ID}
</update>
</mapper>

View File

@ -1,515 +0,0 @@
<?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.zcloud.mapper.datasource.task.StudyTaskMapper">
<!--表名 -->
<sql id="tableName">
BUS_STUDYTASK
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.STUDY_NAME,
f.TRAINTYPE,
f.POSTTYPE,
f.PEIXUE_START_TIME,
f.PEIXUE_END_TIME,
f.KJ_STATE,
f.GJ_STATE,
f.STAGEEXAMPAPER_ID,
f.STUDY_USER_ID,
f.STUDY_CURRICULUM_ID,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE,
f.CORPINFO_ID,
f.STATE,
f.COURSEWARE_COUNT,
f.SUM_CLASSHOUR,
f.STUDYTASK_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
STUDY_NAME,
TRAINTYPE,
POSTTYPE,
PEIXUE_START_TIME,
PEIXUE_END_TIME,
KJ_STATE,
GJ_STATE,
STAGEEXAMPAPER_ID,
STUDY_USER_ID,
STUDY_CURRICULUM_ID,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
ISDELETE,
CORPINFO_ID,
STATE,
COURSEWARE_COUNT,
SUM_CLASSHOUR,
STUDYTASK_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{STUDY_NAME},
#{TRAINTYPE},
#{POSTTYPE},
#{PEIXUE_START_TIME},
#{PEIXUE_END_TIME},
#{KJ_STATE},
#{GJ_STATE},
#{STAGEEXAMPAPER_ID},
#{STUDY_USER_ID},
#{STUDY_CURRICULUM_ID},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{ISDELETE},
#{CORPINFO_ID},
#{STATE},
#{COURSEWARE_COUNT},
#{SUM_CLASSHOUR},
#{STUDYTASK_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
delete from
<include refid="tableName"></include>
where
STUDYTASK_ID = #{STUDYTASK_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
STUDY_NAME = #{STUDY_NAME},
TRAINTYPE = #{TRAINTYPE},
POSTTYPE = #{POSTTYPE},
PEIXUE_START_TIME = #{PEIXUE_START_TIME},
PEIXUE_END_TIME = #{PEIXUE_END_TIME},
KJ_STATE = #{KJ_STATE},
GJ_STATE = #{GJ_STATE},
STAGEEXAMPAPER_ID = #{STAGEEXAMPAPER_ID},
STUDY_USER_ID = #{STUDY_USER_ID},
STUDY_CURRICULUM_ID = #{STUDY_CURRICULUM_ID},
CREATOR = #{CREATOR},
CREATTIME = #{CREATTIME},
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME},
ISDELETE = #{ISDELETE},
CORPINFO_ID = #{CORPINFO_ID},
STUDYTASK_ID = STUDYTASK_ID
where
STUDYTASK_ID = #{STUDYTASK_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>,
p.PASSSCORE,
dic1.name as post_type_name,
dic2.name as train_type_name,
p.INPUT_ID INPUT_ID
from
<include refid="tableName"></include> f
LEFT JOIN sys_dictionaries dic1 ON dic1.DICTIONARIES_ID = f.POSTTYPE
LEFT JOIN sys_dictionaries dic2 ON dic2.DICTIONARIES_ID = f.TRAINTYPE
left join bus_stageexampaper p on p.STUDYTASK_ID=f.STUDYTASK_ID
where
f.STUDYTASK_ID = #{STUDYTASK_ID}
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
,dic1.name as post_type_name
,dic2.name as train_type_name,
(SELECT count(*) FROM bus_stagestudentrelation s1 WHERE s1.STUDYTASK_ID = f.STUDYTASK_ID and s1.ISDELETE = '0' ) AS userCount,
(SELECT count(*) FROM bus_stagestudentrelation s2 WHERE s2.STUDYTASK_ID = f.STUDYTASK_ID and s2.ISDELETE = '0' and CAST(st.PASSSCORE AS DECIMAL) &lt;= CAST(s2.STAGEEXAMSCORE AS DECIMAL) and s2.STAGEEXAMSCORE > '-1') AS hg,
(SELECT count(*) FROM bus_stagestudentrelation s3 WHERE s3.STUDYTASK_ID = f.STUDYTASK_ID and s3.ISDELETE = '0' and s3.STAGEEXAMSCORE > '-1') AS cj
from
<include refid="tableName"></include> f
LEFT JOIN sys_dictionaries dic1 ON dic1.DICTIONARIES_ID = f.POSTTYPE
LEFT JOIN sys_dictionaries dic2 ON dic2.DICTIONARIES_ID = f.TRAINTYPE
LEFT JOIN BUS_STAGEEXAMPAPER st on st.STUDYTASK_ID = f.STUDYTASK_ID
where 1=1
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and ( f.STUDY_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%') )
</if>
<if test="pd.STATE != null and pd.STATE != ''"><!-- 关键词检索 -->
and STATE = #{pd.STATE}
</if>
<if test="pd.TRAINTYPE != null and pd.TRAINTYPE != ''"><!-- 关键词检索 -->
and TRAINTYPE = #{pd.TRAINTYPE}
</if>
<if test="pd.POSTTYPE != null and pd.POSTTYPE != ''"><!-- 关键词检索 -->
and POSTTYPE = #{pd.POSTTYPE}
</if>
<if test="pd.STARTTIME != null and pd.STARTTIME != ''">
and f.PEIXUE_START_TIME &gt;= #{pd.STARTTIME}
</if>
<if test="pd.ENDTIME != null and pd.ENDTIME != ''">
and f.PEIXUE_END_TIME &lt;= #{pd.ENDTIME}
</if>
<if test="pd.STATUS != null and pd.STATUS == 1">
and DATE_FORMAT( f.PEIXUE_START_TIME, '%Y-%m-%d' ) &gt; DATE_FORMAT( NOW(), '%Y-%m-%d' )
</if>
<if test="pd.STATUS != null and pd.STATUS == 2">
and DATE_FORMAT( f.PEIXUE_START_TIME, '%Y-%m-%d' ) &lt;= DATE_FORMAT( NOW(), '%Y-%m-%d' )
and DATE_FORMAT( f.PEIXUE_END_TIME, '%Y-%m-%d' ) &gt;= DATE_FORMAT( NOW(), '%Y-%m-%d' )
</if>
<if test="pd.STATUS != null and pd.STATUS == 3">
and DATE_FORMAT( f.PEIXUE_END_TIME, '%Y-%m-%d' ) &lt; DATE_FORMAT( NOW(), '%Y-%m-%d' )
</if>
<if test="pd.STUDY_USER_ID != null and pd.STUDY_USER_ID != ''"><!-- 关键词检索 -->
and exists (SELECT 1 FROM bus_stagestudentrelation s WHERE s.USER_ID=#{pd.STUDY_USER_ID} and f.STUDYTASK_ID=s.STUDYTASK_ID)
</if>
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''"><!-- 关键词检索 -->
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</if>
<if test="pd.MONTH != null and pd.MONTH != ''">
and DATE_FORMAT(f.CREATTIME,'%Y-%m')=#{pd.MONTH}
</if>
ORDER BY f.OPERATTIME desc ,f.PEIXUE_START_TIME DESC
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="String">
delete from
<include refid="tableName"></include>
where
STUDYTASK_ID in
<foreach item="item" index="index" collection="array" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- (全部视频课件+资料课件) -->
<select id="getAllCourseware" parameterType="pd" resultType="pd">
select distinct f.* from
(
select
CONCAT_WS('_', v.VIDEOCOURSEWARE_ID, '1') COURSEWARE_ID,
CONCAT_WS('', '[', '视频课件]', v.COURSEWARENAME) COURSEWARENAME,
SPEAKER,
CLASSHOUR,
v.OPERATTIME
from
BUS_VIDEOCOURSEWARE v
left join bus_kcmiddlekj kk on kk.COURSEWAREID = v.VIDEOCOURSEWARE_ID and kk.COURSEWARETYPE=1
left join bus_studytaskcurriculum sc on sc.CURRICULUM_ID = kk.CURRICULUMID
where sc.STUDYTASK_ID = #{STUDYTASK_ID}
UNION ALL
select
CONCAT_WS('_', d.DATACOURSEWARE_ID, '2') COURSEWARE_ID,
CONCAT_WS('', '[', '资料课件]', d.COURSEWARENAME) COURSEWARENAME,
SPEAKER,
CLASSHOUR,
d.OPERATTIME
from
BUS_DATACOURSEWARE d
left join bus_kcmiddlekj kk on kk.COURSEWAREID = d.DATACOURSEWARE_ID and kk.COURSEWARETYPE=2
left join bus_studytaskcurriculum sc on sc.CURRICULUM_ID = kk.CURRICULUMID
where sc.STUDYTASK_ID = #{STUDYTASK_ID}
) f
ORDER BY f.OPERATTIME DESC
</select>
<!-- CURRICULUM 课程 -->
<select id="getcurriculumAllBystudyTaskId" parameterType="pd" resultType="pd">
select * ,COUNT(m.KCMIDDLEKJ_ID) COURSEWARECOUNT
from BUS_STUDYTASKCURRICULUM f
LEFT JOIN BUS_CURRICULUM c on c.CURRICULUM_ID = f.CURRICULUM_ID
LEFT JOIN BUS_KCMIDDLEKJ m ON m.CURRICULUMID = f.CURRICULUM_ID AND m.ISDELETE = '0'
where 1=1
<if test="STUDYTASK_ID != null and STUDYTASK_ID != ''"><!-- 关键词检索 -->
and f.STUDYTASK_ID = #{STUDYTASK_ID}
</if>
GROUP BY f.CURRICULUM_ID
</select>
<!-- (全部视频课件+资料课件) -->
<select id="getAllcurriculum" parameterType="pd" resultType="pd">
select distinct c.*
from
<include refid="tableName"></include>f
left join bus_studytaskcurriculum kk on kk.STUDYTASK_ID = f.STUDYTASK_ID
left join bus_curriculum c on c.CURRICULUM_ID = kk.CURRICULUM_ID
where f.STUDYTASK_ID = #{STUDYTASK_ID}
</select>
<!-- 更新任务状态 -->
<update id="updateTaskState" parameterType="pd">
update
<include refid="tableName"></include>
set
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME},
STATE = #{STATE}
where
STUDYTASK_ID = #{STUDYTASK_ID}
</update>
<select id="getAllByuserInfo" parameterType="pd" resultType="pd">
select IF(f.COURSEWARETYPE='1',v.COURSEWARENAME,d.COURSEWARENAME) COURSEWARENAME
,IF(f.COURSEWARETYPE='1',v.CLASSHOUR,d.CLASSHOUR) CLASSHOUR ,
c.PLAYCOUNT,c.RESOURCETIME,f.COURSEWARETYPE
from BUS_KCMIDDLEKJ f
LEFT JOIN BUS_VIDEOCOURSEWARE v on f.COURSEWAREID = v.VIDEOCOURSEWARE_ID AND f.COURSEWARETYPE='1' AND v.ISDELETE = '0'
LEFT JOIN BUS_DATACOURSEWARE d on f.COURSEWAREID = d.DATACOURSEWARE_ID AND f.COURSEWARETYPE='2' AND d.ISDELETE = '0'
LEFT JOIN bus_coursestudyvideorecord c on c.VIDEOCOURSEWARE_ID = f.COURSEWAREID and c.USER_ID = #{STUDYTASK_USERID} and c.STUDYTASK_ID = #{STUDYTASK_ID}
where 1=1 and f.CURRICULUMID in (select CURRICULUM_ID from BUS_STUDYTASKCURRICULUM WHERE STUDYTASK_ID = #{STUDYTASK_ID})
GROUP BY f.COURSEWAREID
ORDER BY f.COURSEWARETYPE desc
</select>
<!-- 列表 -->
<select id="userdatalistPage" parameterType="page" resultType="pd">
SELECT
s.STUDYTASK_ID,
s.STUDY_NAME,
s.SUM_CLASSHOUR,
f.STAGEEXAMSCORE,
st.PASSSCORE,
s.PEIXUE_START_TIME,
s.PEIXUE_END_TIME,
TRUNCATE((SUM(IF(co.RESOURCETIME IS NULL,0,(co.RESOURCETIME DIV 60)))+f.COMPLETE_CLASSHOUR),0) yixue,
dic1. NAME AS post_type_name,
dic2. NAME AS train_type_name
FROM
bus_stagestudentrelation f
LEFT JOIN BUS_STUDYTASK s ON s.STUDYTASK_ID = f.STUDYTASK_ID
LEFT JOIN sys_dictionaries dic1 ON dic1.DICTIONARIES_ID = s.POSTTYPE
LEFT JOIN sys_dictionaries dic2 ON dic2.DICTIONARIES_ID = s.TRAINTYPE
LEFT JOIN BUS_STAGEEXAMPAPER st ON st.STUDYTASK_ID = f.STUDYTASK_ID
LEFT JOIN BUS_COURSESTUDYVIDEORECORD co ON co.STUDYTASK_ID = f.STUDYTASK_ID and co.USER_ID = f.USER_ID AND co.PLAYCOUNT = 0
WHERE
1 = 1
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and ( s.STUDY_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%') )
</if>
<if test="pd.STATE != null and pd.STATE != ''"><!-- 关键词检索 -->
and STATE = #{pd.STATE}
</if>
<if test="pd.TRAINTYPE != null and pd.TRAINTYPE != ''"><!-- 关键词检索 -->
and TRAINTYPE = #{pd.TRAINTYPE}
</if>
<if test="pd.POSTTYPE != null and pd.POSTTYPE != ''"><!-- 关键词检索 -->
and POSTTYPE = #{pd.POSTTYPE}
</if>
<if test="pd.STARTTIME != null and pd.STARTTIME != ''">
and s.PEIXUE_START_TIME &gt;= #{pd.STARTTIME}
</if>
<if test="pd.ENDTIME != null and pd.ENDTIME != ''">
and s.PEIXUE_END_TIME &lt;= #{pd.ENDTIME}
</if>
<if test="pd.STATUS != null and pd.STATUS == 1">
and DATE_FORMAT( s.PEIXUE_START_TIME, '%Y-%m-%d' ) &gt; DATE_FORMAT( NOW(), '%Y-%m-%d' )
</if>
<if test="pd.STATUS != null and pd.STATUS == 2">
and DATE_FORMAT( s.PEIXUE_START_TIME, '%Y-%m-%d' ) &lt;= DATE_FORMAT( NOW(), '%Y-%m-%d' )
and DATE_FORMAT( s.PEIXUE_END_TIME, '%Y-%m-%d' ) &gt;= DATE_FORMAT( NOW(), '%Y-%m-%d' )
</if>
<if test="pd.STATUS != null and pd.STATUS == 3">
and DATE_FORMAT( s.PEIXUE_END_TIME, '%Y-%m-%d' ) &lt; DATE_FORMAT( NOW(), '%Y-%m-%d' )
</if>
<if test="pd.STUDY_USER_ID != null and pd.STUDY_USER_ID != ''"><!-- 关键词检索 -->
and f.USER_ID = #{pd.STUDY_USER_ID}
</if>
GROUP BY f.STAGESTUDENTRELATION_ID
ORDER BY s.OPERATTIME desc ,s.PEIXUE_START_TIME DESC
</select>
<!-- (全部视频课件+资料课件) -->
<select id="getAllCoursewareByHandout" parameterType="pd" resultType="pd">
select distinct f.* from
(
select
CONCAT_WS('_', v.VIDEOCOURSEWARE_ID, '1') COURSEWARE_ID,
v.COURSEWARENAME as COURSEWARENAME,
'视频课件' as coutType,
v.SPEAKER,
v.COURSEWAREINTRODUCE,
v.CLASSHOUR,
v.OPERATTIME
from
BUS_VIDEOCOURSEWARE v
left join bus_kcmiddlekj kk on kk.COURSEWAREID = v.VIDEOCOURSEWARE_ID and kk.COURSEWARETYPE=1
left join bus_studytaskcurriculum sc on sc.CURRICULUM_ID = kk.CURRICULUMID
where sc.STUDYTASK_ID = #{STUDYTASK_ID}
UNION ALL
select
CONCAT_WS('_', d.DATACOURSEWARE_ID, '2') COURSEWARE_ID,
d.COURSEWARENAME as COURSEWARENAME,
'资料课件' as coutType,
d.SPEAKER,
d.COURSEWAREINTRODUCE,
d.CLASSHOUR,
d.OPERATTIME
from
BUS_DATACOURSEWARE d
left join bus_kcmiddlekj kk on kk.COURSEWAREID = d.DATACOURSEWARE_ID and kk.COURSEWARETYPE=2
left join bus_studytaskcurriculum sc on sc.CURRICULUM_ID = kk.CURRICULUMID
where sc.STUDYTASK_ID = #{STUDYTASK_ID}
) f
ORDER BY f.OPERATTIME DESC
</select>
<!-- 修改 任务的结束时间 -->
<update id="editEndTime" parameterType="pd">
update
<include refid="tableName"></include>
set
PEIXUE_END_TIME = #{PEIXUE_END_TIME},
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
STUDYTASK_ID = #{STUDYTASK_ID}
</update>
<!-- BI页面统计 -->
<select id="BIstatistics" parameterType="pd" resultType="pd">
SELECT
a.NAME,
IFNULL(sum(rl.count ),0) as count
FROM
(
SELECT
d.NAME,
t.STUDYTASK_ID,
GROUP_CONCAT( t.STUDYTASK_ID ) AS taskids
FROM
sys_dictionaries d
LEFT JOIN sys_dictionaries c ON c.PARENT_ID = d.DICTIONARIES_ID
LEFT JOIN bus_studytask t ON ( t.POSTTYPE = d.DICTIONARIES_ID OR t.POSTTYPE = c.DICTIONARIES_ID ) and t.CORPINFO_ID = #{CORPINFO_ID}
WHERE
d.PARENT_ID = 'f6a7c4f5602f46e291d06b1390a3f820'
GROUP BY
d.DICTIONARIES_ID
) a
LEFT JOIN ( SELECT count( 1 ) AS count, r.STUDYTASK_ID FROM bus_stagestudentrelation r where r.STAGEEXAMSTATE = 2 GROUP BY r.STUDYTASK_ID ) rl ON FIND_IN_SET( rl.STUDYTASK_ID, a.taskids )
GROUP BY a.NAME
</select>
<!-- 绩效得分 -->
<select id="getDeptExamine" parameterType="pd" resultType="pd" >
SELECT
d.DEPARTMENT_ID,
ifnull(un.user_count,0) as user_count,
ifnull(st.NUM,0) as st_count
FROM
OA_DEPARTMENT d
LEFT JOIN (
SELECT
count( distinct f.USER_ID) NUM,
u.DEPARTMENT_ID
FROM
bus_stagestudentrelation f
LEFT JOIN BUS_STUDYTASK t ON t.STUDYTASK_ID = f.STUDYTASK_ID
LEFT JOIN SYS_USER u ON u.USER_ID = f.USER_ID
WHERE
(
t.PEIXUE_START_TIME BETWEEN #{STARTTIME} and #{ENDTIME}
or
t.PEIXUE_END_TIME BETWEEN #{STARTTIME} and #{ENDTIME}
or
(t.PEIXUE_START_TIME &lt;= #{STARTTIME} and t.PEIXUE_END_TIME &gt;= #{ENDTIME})
)
group by u.DEPARTMENT_ID
) st on st.DEPARTMENT_ID=d.DEPARTMENT_ID
LEFT JOIN
( SELECT count( 1 ) as user_count,u.DEPARTMENT_ID FROM SYS_USER u WHERE u.ISDELETE = 0 group by u.DEPARTMENT_ID) un on un.DEPARTMENT_ID = d.DEPARTMENT_ID
where
d.ISDELETE = 0
</select>
<select id="getUserExamine" parameterType="pd" resultType="pd" >
SELECT
u.USER_ID,
ifnull(st.NUM,0) as st_count,
ifnull(pa.NUM,0) as pass_count
FROM
SYS_USER u
LEFT JOIN (
SELECT
count( distinct f.USER_ID) NUM,
f.USER_ID
FROM
bus_stagestudentrelation f
LEFT JOIN BUS_STUDYTASK t ON t.STUDYTASK_ID = f.STUDYTASK_ID
WHERE
(
t.PEIXUE_START_TIME BETWEEN #{STARTTIME} and #{ENDTIME}
or
t.PEIXUE_END_TIME BETWEEN #{STARTTIME} and #{ENDTIME}
or
(t.PEIXUE_START_TIME &lt;= #{STARTTIME} and t.PEIXUE_END_TIME &gt;= #{ENDTIME})
)
group by f.USER_ID
) st on st.USER_ID=u.USER_ID
LEFT JOIN (
SELECT
count( distinct f.USER_ID) NUM,
f.USER_ID
FROM
bus_stagestudentrelation f
LEFT JOIN BUS_STUDYTASK t ON t.STUDYTASK_ID = f.STUDYTASK_ID
LEFT JOIN BUS_STAGEEXAMPAPER p ON t.STUDYTASK_ID = p.STUDYTASK_ID
WHERE
(
t.PEIXUE_START_TIME BETWEEN #{STARTTIME} and #{ENDTIME}
or
t.PEIXUE_END_TIME BETWEEN #{STARTTIME} and #{ENDTIME}
or
(t.PEIXUE_START_TIME &lt;= #{STARTTIME} and t.PEIXUE_END_TIME &gt;= #{ENDTIME})
)
and p.PASSSCORE &lt;= f.STAGEEXAMSCORE
group by f.USER_ID
) pa on pa.USER_ID=u.USER_ID
where
u.ISDELETE = 0
</select>
<select id="getDiagnosis" parameterType="pd" resultType="pd">
SELECT
(select count(1) from BUS_CURRICULUM f where DATE_FORMAT(f.CREATTIME,'%Y-%m')=#{MONTH} and f.CORPINFO_ID = #{CORPINFO_ID}) as curriculum_count,
(select count(1) from BUS_COURSEPAPERS f where DATE_FORMAT(f.CREATTIME,'%Y-%m')=#{MONTH} and f.CORPINFO_ID = #{CORPINFO_ID}) as paper_count,
(select count(1) from BUS_STUDYTASK f where DATE_FORMAT(f.CREATTIME,'%Y-%m')=#{MONTH} and f.CORPINFO_ID = #{CORPINFO_ID} ) as task_count
</select>
</mapper>

View File

@ -1,132 +0,0 @@
<?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.zcloud.mapper.datasource.task.StudytaskCurriculumMapper">
<!--表名 -->
<sql id="tableName">
BUS_STUDYTASKCURRICULUM
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.STUDYTASK_ID,
f.CURRICULUM_ID,
f.STUDYTASKCURRICULUM_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
STUDYTASK_ID,
CURRICULUM_ID,
STUDYTASKCURRICULUM_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{STUDYTASK_ID},
#{CURRICULUM_ID},
#{STUDYTASKCURRICULUM_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
STUDYTASKCURRICULUM_ID = #{STUDYTASKCURRICULUM_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
STUDYTASK_ID = #{STUDYTASK_ID},
CURRICULUM_ID = #{CURRICULUM_ID},
STUDYTASKCURRICULUM_ID = STUDYTASKCURRICULUM_ID
where
STUDYTASKCURRICULUM_ID = #{STUDYTASKCURRICULUM_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.STUDYTASKCURRICULUM_ID = #{STUDYTASKCURRICULUM_ID}
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0'
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- 根据需求自己加检索条件
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where 1=1
<if test="STUDYTASK_ID != null and STUDYTASK_ID != ''"><!-- 关键词检索 -->
STUDYTASK_ID = #{STUDYTASK_ID}
</if>
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="String">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
STUDYTASKCURRICULUM_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 列表(全部) -->
<select id="countByCurriculumId" parameterType="pd" resultType="integer">
select count(*)
from
<include refid="tableName"></include> f
where 1=1
<if test="CURRICULUM_ID != null and CURRICULUM_ID != ''"><!-- 关键词检索 -->
and CURRICULUM_ID = #{CURRICULUM_ID}
</if>
</select>
</mapper>

View File

@ -1,154 +0,0 @@
<?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.zcloud.mapper.datasource.task.StudytaskSignMapper">
<!--表名 -->
<sql id="tableName">
BUS_STUDYTASKSIGN
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.USER_ID,
f.STUDYTASK_ID,
f.TYPE,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.CORPINFO_ID,
f.STUDYTASKSIGN_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
USER_ID,
STUDYTASK_ID,
TYPE,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
CORPINFO_ID,
STUDYTASKSIGN_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{USER_ID},
#{STUDYTASK_ID},
#{TYPE},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{CORPINFO_ID},
#{STUDYTASKSIGN_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
STUDYTASKSIGN_ID = #{STUDYTASKSIGN_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
USER_ID = #{USER_ID},
STUDYTASK_ID = #{STUDYTASK_ID},
TYPE = #{TYPE},
CREATOR = #{CREATOR},
CREATTIME = #{CREATTIME},
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME},
STUDYTASKSIGN_ID = STUDYTASKSIGN_ID
where
STUDYTASKSIGN_ID = #{STUDYTASKSIGN_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.STUDYTASKSIGN_ID = #{STUDYTASKSIGN_ID}
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0'
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- 根据需求自己加检索条件
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="String">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
STUDYTASKSIGN_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据任务id获取签字信息 -->
<select id="getListByStudytaskID" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
,u.USER_SIGN_FILE_PATH
from
<include refid="tableName"></include> f
LEFT JOIN sys_userinfo u on u.USER_ID = f.user_id
where 1=1
<if test="STUDYTASK_ID != null and STUDYTASK_ID != ''">
and f.STUDYTASK_ID = #{STUDYTASK_ID}
</if>
</select>
</mapper>

View File

@ -195,6 +195,12 @@
WHERE
f.ISDELETE = '0'
and f.STAGEEXAMPAPERINPUT_ID = #{STAGEEXAMPAPERINPUT_ID}
<if test="KEYWORDS != null and KEYWORDS != ''"><!-- 关键词检索 -->
and f.QUESTIONDRY LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
</if>
<if test="QUESTIONTYPE != null and QUESTIONTYPE != ''"><!-- 关键词检索 -->
and f.QUESTIONTYPE = #{QUESTIONTYPE}
</if>
order by f.QUESTIONNUMBER
</select>

View File

@ -541,8 +541,7 @@
f.COMPLETE_CLASSHOUR,
s.STUDENT_ID,
s.POST_ID,
en.NAME ENTERPRISE_NAME,
ci.NAME as CORPINFO_NAME,
ci.CORP_NAME,
od.NAME as DEPATEMENT_NAME,
sp.NAME as POST_NAME,
t.ISSTRENGTHEN,
@ -554,7 +553,6 @@
f
INNER JOIN BUS_CLASS t ON t.CLASS_ID = f.CLASS_ID AND t.ISDELETE = '0'
LEFT JOIN BUS_STUDENT s on s.CLASS_ID = f.CLASS_ID and s.USER_ID = f.USER_ID and s.ISDELETE = '0'
LEFT JOIN BUS_ENTERPRISE en ON en.ENTERPRISE_ID = s.ENTERPRISE_ID and en.ISDELETE = '0'
LEFT JOIN bus_corp_info ci on ci.CORPINFO_ID = s.CORPINFO_ID and ci.ISDELETE = '0'
LEFT JOIN oa_department od on od.DEPARTMENT_ID = s.DEPARTMENT_ID and od.ISDELETE = '0'
LEFT JOIN sys_post sp on sp.POST_ID = s.POST_ID and sp.ISDELETE = '0'

View File

@ -1008,6 +1008,7 @@
ct.NAME CERTIFICATETYPE_NAME,
doe.NAME DEGREE_OF_EDUCATION_NAME,
ui.AUTHENTICATION,
ui.PORTRAIT,
(
select
sum(c.CLASSHOUR)
@ -1054,42 +1055,39 @@
AND ccc.isdelete = '0'
where f.ISDELETE = '0'
<if test="pd.DASHBOARD!= null and pd.DASHBOARD != ''"><!-- 首页统计学员 -->
and c.STATE != '1'
<if test="NAME!= null and pd.NAME != ''"><!-- 关键词检索 -->
and f.NAME LIKE CONCAT(CONCAT('%', #{NAME}),'%')
</if>
<if test="pd.NAME!= null and pd.NAME != ''"><!-- 关键词检索 -->
and f.NAME LIKE CONCAT(CONCAT('%', #{pd.NAME}),'%')
<if test="DEGREE_OF_EDUCATION!= null and DEGREE_OF_EDUCATION != ''"><!-- 关键词检索 -->
and f.DEGREE_OF_EDUCATION = #{DEGREE_OF_EDUCATION}
</if>
<if test="pd.DEGREE_OF_EDUCATION!= null and pd.DEGREE_OF_EDUCATION != ''"><!-- 关键词检索 -->
and f.DEGREE_OF_EDUCATION = #{pd.DEGREE_OF_EDUCATION}
<if test="PERSONNEL_TYPE!= null and PERSONNEL_TYPE != ''"><!-- 关键词检索 -->
and f.PERSONNEL_TYPE = #{PERSONNEL_TYPE}
</if>
<if test="pd.PERSONNEL_TYPE!= null and pd.PERSONNEL_TYPE != ''"><!-- 关键词检索 -->
and f.PERSONNEL_TYPE = #{pd.PERSONNEL_TYPE}
<if test="KEYWORDS!= null and KEYWORDS != ''"><!-- 关键词检索 -->
and f.NAME LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
</if>
<if test="pd.KEYWORDS!= null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and f.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
<if test="CORPINFO_ID != null and CORPINFO_ID != ''"><!-- 关键词检索 -->
and f.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''"><!-- 关键词检索 -->
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
<if test="DEPARTMENT_ID!= null and DEPARTMENT_ID != ''"><!-- 关键词检索 -->
and f.DEPARTMENT_ID = #{DEPARTMENT_ID}
</if>
<if test="pd.DEPARTMENT_ID!= null and pd.DEPARTMENT_ID != ''"><!-- 关键词检索 -->
and f.DEPARTMENT_ID = #{pd.DEPARTMENT_ID}
<if test="POST_ID!= null and POST_ID != ''"><!-- 关键词检索 -->
and f.POST_ID = #{POST_ID}
</if>
<if test="pd.POST_ID!= null and pd.POST_ID != ''"><!-- 关键词检索 -->
and f.POST_ID = #{pd.POST_ID}
<if test="START_TIME!= null and START_TIME != '' and END_TIME!= null and END_TIME != ''"><!-- 关键词检索 -->
and f.CREATTIME &gt;= CONCAT(#{START_TIME}, ' 00:00:00')
and f.CREATTIME &lt;= CONCAT(#{END_TIME}, ' 23:59:59')
</if>
<if test="pd.START_TIME!= null and pd.START_TIME != '' and pd.END_TIME!= null and pd.END_TIME != ''"><!-- 关键词检索 -->
and f.CREATTIME &gt;= CONCAT(#{pd.START_TIME}, ' 00:00:00')
and f.CREATTIME &lt;= CONCAT(#{pd.END_TIME}, ' 23:59:59')
<if test="STUDYSTATE!= null and STUDYSTATE != ''"><!-- 关键词检索 -->
and ssr.STUDYSTATE = #{STUDYSTATE}
</if>
<if test="pd.STUDYSTATE!= null and pd.STUDYSTATE != ''"><!-- 关键词检索 -->
and ssr.STUDYSTATE = #{pd.STUDYSTATE}
<if test="STAGEEXAMSTATE!= null and STAGEEXAMSTATE != ''"><!-- 关键词检索 -->
and ssr.STAGEEXAMSTATE = #{STAGEEXAMSTATE}
</if>
<if test="pd.STAGEEXAMSTATE!= null and pd.STAGEEXAMSTATE != ''"><!-- 关键词检索 -->
and ssr.STAGEEXAMSTATE = #{pd.STAGEEXAMSTATE}
</if>
<if test="pd.CLASS_ID!= null and pd.CLASS_ID != ''"><!-- 关键词检索 -->
and f.CLASS_ID = #{pd.CLASS_ID}
<if test="CLASS_ID!= null and CLASS_ID != ''"><!-- 关键词检索 -->
and f.CLASS_ID = #{CLASS_ID}
</if>
group by f.STUDENT_ID
order by f.OPERATTIME desc