1.辅导员导出去向填写记录
2.学院查看 导出去向填写记录 导出返校情况 查看 导出预计离校情况 查看 导出学生到家情况
This commit is contained in:
@@ -9,8 +9,11 @@ import com.srs.comprehensive.domain.ViewStuInfo;
|
||||
import com.srs.survey.domain.dto.LeaveExport;
|
||||
import com.srs.survey.domain.dto.LeaveRes;
|
||||
import com.srs.survey.domain.dto.ReturnRes;
|
||||
import com.srs.survey.domain.dto.XwReturnRes;
|
||||
import com.srs.survey.domain.vo.SurItineraryStatisticsVo;
|
||||
import com.srs.survey.service.ISurSurveyService;
|
||||
import com.srs.system.domain.SysDeptMap;
|
||||
import com.srs.system.service.ISysDeptMapService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
@@ -40,6 +43,30 @@ public class SurItineraryController extends BaseController {
|
||||
@Autowired
|
||||
private ISurSurveyService surSurveyService;
|
||||
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('survey:itinerary:listFdyAll')")
|
||||
@Log(title = "辅导员导出学生假期填写记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/fdyExport")
|
||||
@ApiOperation("辅导员导出学生假期填写记录")
|
||||
public void fdyExport(HttpServletResponse response, SurItinerary param)
|
||||
{
|
||||
param.tNo = getUsername();
|
||||
List<SurItinerary> list = surItineraryService.listView(param);
|
||||
ExcelUtil<SurItinerary> util = new ExcelUtil<SurItinerary>(SurItinerary.class);
|
||||
util.exportExcel(response, list, "学生假期返校数据");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('survey:itinerary:listFdyAll')")
|
||||
@GetMapping("/listFdyAll")
|
||||
@ApiOperation("辅导员查询待审核")
|
||||
public TableDataInfo listFdyAll(SurItinerary param){
|
||||
param.tNo = getUsername();
|
||||
startPage();
|
||||
List<SurItinerary> list = surItineraryService.listView(param);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/countFdyClassWillLeave/{surveyId}")
|
||||
@ApiOperation("统计预计离校")
|
||||
public AjaxResult countFdyClassWillLeave(@PathVariable Long surveyId) {
|
||||
@@ -209,11 +236,97 @@ public class SurItineraryController extends BaseController {
|
||||
return surItineraryService.leaveAudit(param);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('survey:itinerary:listFdyAll')")
|
||||
@GetMapping("/listFdyAll")
|
||||
@ApiOperation("辅导员查询待审核")
|
||||
public TableDataInfo listFdyAll(SurItinerary param){
|
||||
param.tNo = getUsername();
|
||||
@Autowired
|
||||
ISysDeptMapService _deptMap;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('survey:itinerary:listXw')")
|
||||
@GetMapping("/listXwReturnRes1/{surveyId}")
|
||||
@ApiOperation("学务列出学生返校情况")
|
||||
public AjaxResult listXwReturnRes1(@PathVariable Long surveyId) {
|
||||
Long oldId = getDeptId();
|
||||
SysDeptMap dept = _deptMap.getOldDeptByNewId(oldId);
|
||||
Long deptId = null;
|
||||
if (dept != null) {
|
||||
deptId = dept.getOldDeptId();
|
||||
}
|
||||
List<Map<String, Object>> list = surItineraryService.listXwReturnRes1(surveyId,deptId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('survey:itinerary:listXw')")
|
||||
@GetMapping("/listXwSubmitRes/{surveyId}")
|
||||
@ApiOperation("学务列出到家人数")
|
||||
public AjaxResult listXwSubmitRes(@PathVariable Long surveyId) {
|
||||
Long oldId = getDeptId();
|
||||
SysDeptMap dept = _deptMap.getOldDeptByNewId(oldId);
|
||||
Long deptId = null;
|
||||
if (dept != null) {
|
||||
deptId = dept.getOldDeptId();
|
||||
}
|
||||
List<Map<String, Object>> list = surItineraryService.listXwSubmitRes(surveyId,deptId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('survey:itinerary:listXw')")
|
||||
@GetMapping("/countXwWillLeave/{surveyId}")
|
||||
@ApiOperation("学院统计预计离校")
|
||||
public AjaxResult countXwWillLeave(@PathVariable Long surveyId) {
|
||||
Long oldId = getDeptId();
|
||||
SysDeptMap dept = _deptMap.getOldDeptByNewId(oldId);
|
||||
Long deptId = null;
|
||||
if (dept != null) {
|
||||
deptId = dept.getOldDeptId();
|
||||
}
|
||||
List<Map<String, Object>> list = surItineraryService.countXwWillLeave(surveyId,deptId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('survey:itinerary:listXw')")
|
||||
@PostMapping("/exportXwReturnRes")
|
||||
@ApiOperation("学务导出学生假期返校结果")
|
||||
public void exportXwReturnRes(HttpServletResponse response, SurItinerary param)
|
||||
{
|
||||
Long oldId = getDeptId();
|
||||
SysDeptMap dept = _deptMap.getOldDeptByNewId(oldId);
|
||||
Long deptId = null;
|
||||
if (dept != null) {
|
||||
deptId = dept.getOldDeptId();
|
||||
}
|
||||
param.setDeptId(deptId);
|
||||
List<XwReturnRes> list = surItineraryService.listXwReturnRes(param);
|
||||
ExcelUtil<XwReturnRes> util = new ExcelUtil<XwReturnRes>(XwReturnRes.class);
|
||||
util.exportExcel(response, list, "学生假期返校结果");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('survey:itinerary:listXw')")
|
||||
@Log(title = "学务导出学生假期填写记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/xwExport")
|
||||
@ApiOperation("学务导出学生假期填写记录")
|
||||
public void xwExport(HttpServletResponse response, SurItinerary param)
|
||||
{
|
||||
Long oldId = getDeptId();
|
||||
SysDeptMap dept = _deptMap.getOldDeptByNewId(oldId);
|
||||
Long deptId = null;
|
||||
if (dept != null) {
|
||||
deptId = dept.getOldDeptId();
|
||||
}
|
||||
param.setDeptId(deptId);
|
||||
List<SurItinerary> list = surItineraryService.listView(param);
|
||||
ExcelUtil<SurItinerary> util = new ExcelUtil<SurItinerary>(SurItinerary.class);
|
||||
util.exportExcel(response, list, "学生假期返校数据");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('survey:itinerary:listXw')")
|
||||
@GetMapping("/listXw")
|
||||
@ApiOperation("学院数据")
|
||||
public TableDataInfo listXw(SurItinerary param){
|
||||
Long oldId = getDeptId();
|
||||
SysDeptMap dept = _deptMap.getOldDeptByNewId(oldId);
|
||||
Long deptId = null;
|
||||
if (dept != null) {
|
||||
deptId = dept.getOldDeptId();
|
||||
}
|
||||
param.setDeptId(deptId);
|
||||
startPage();
|
||||
List<SurItinerary> list = surItineraryService.listView(param);
|
||||
return getDataTable(list);
|
||||
|
||||
@@ -31,7 +31,16 @@ public class SurItinerary extends BaseEntity{
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
|
||||
/**
|
||||
* 所属主题
|
||||
*/
|
||||
@ApiModelProperty("所属主题")
|
||||
@TableField("survey_id")
|
||||
// @Excel(name = "所属主题")
|
||||
public Long surveyId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Excel(name = "主题名称")
|
||||
public String surveyName;
|
||||
|
||||
@TableField(exist = false)
|
||||
@@ -40,18 +49,6 @@ private static final long serialVersionUID=1L;
|
||||
@TableField(exist = false)
|
||||
public String tNo;
|
||||
|
||||
@TableField(exist = false)
|
||||
public String campusName;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
public String parkName;
|
||||
|
||||
@TableField(exist = false)
|
||||
public String buildingName;
|
||||
|
||||
@TableField(exist = false)
|
||||
public String roomNo;
|
||||
|
||||
|
||||
/**
|
||||
@@ -66,7 +63,7 @@ private static final long serialVersionUID=1L;
|
||||
*/
|
||||
@ApiModelProperty("学院id")
|
||||
@TableField("dept_id")
|
||||
@Excel(name = "学院id")
|
||||
// @Excel(name = "学院id")
|
||||
public Long deptId;
|
||||
|
||||
/**
|
||||
@@ -77,6 +74,10 @@ private static final long serialVersionUID=1L;
|
||||
@TableField(exist = false)
|
||||
public String deptName;
|
||||
|
||||
@TableField("more_dept_name")
|
||||
@Excel(name = "详细学院")
|
||||
public String moreDeptName;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
@@ -90,14 +91,14 @@ private static final long serialVersionUID=1L;
|
||||
*/
|
||||
@ApiModelProperty("所属班级")
|
||||
@TableField("class_id")
|
||||
@Excel(name = "所属班级")
|
||||
// @Excel(name = "所属班级")
|
||||
public Long classId;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
@ApiModelProperty("所属班级")
|
||||
@Excel(name = "所属班级")
|
||||
@Excel(name = "班级")
|
||||
@TableField(exist = false)
|
||||
public String className;
|
||||
|
||||
@@ -140,7 +141,7 @@ private static final long serialVersionUID=1L;
|
||||
*/
|
||||
@ApiModelProperty("所在校区")
|
||||
@TableField("school_district")
|
||||
@Excel(name = "所在校区")
|
||||
// @Excel(name = "所在校区")
|
||||
public String schoolDistrict;
|
||||
|
||||
/**
|
||||
@@ -148,7 +149,7 @@ private static final long serialVersionUID=1L;
|
||||
*/
|
||||
@ApiModelProperty("公寓楼")
|
||||
@TableField("apartment")
|
||||
@Excel(name = "公寓楼")
|
||||
// @Excel(name = "公寓楼")
|
||||
public String apartment;
|
||||
|
||||
/**
|
||||
@@ -156,50 +157,127 @@ private static final long serialVersionUID=1L;
|
||||
*/
|
||||
@ApiModelProperty("宿舍号")
|
||||
@TableField("room")
|
||||
@Excel(name = "宿舍号")
|
||||
// @Excel(name = "宿舍号")
|
||||
public String room;
|
||||
|
||||
/**
|
||||
* 计划返校时间
|
||||
*/
|
||||
@Excel(name = "住宿校区")
|
||||
@TableField(exist = false)
|
||||
public String campusName;
|
||||
|
||||
@Excel(name = "住宿园区")
|
||||
@TableField(exist = false)
|
||||
public String parkName;
|
||||
|
||||
@Excel(name = "住宿楼栋")
|
||||
@TableField(exist = false)
|
||||
public String buildingName;
|
||||
|
||||
@Excel(name = "宿舍号")
|
||||
@TableField(exist = false)
|
||||
public String roomNo;
|
||||
|
||||
@ApiModelProperty("是否离校")
|
||||
@TableField("is_leave")
|
||||
@Excel(name = "是否离校",readConverterExp = "0=否,1=是")
|
||||
public String isLeave;
|
||||
|
||||
@ApiModelProperty("家长姓名(离校、留校)")
|
||||
@TableField("fam_name")
|
||||
@Excel(name = "家长姓名(离校、留校)")
|
||||
public String famName;
|
||||
|
||||
@ApiModelProperty("家长电话(离校、留校)")
|
||||
@TableField("fam_phone")
|
||||
@Excel(name = "家长电话(离校、留校)")
|
||||
public String famPhone;
|
||||
|
||||
@ApiModelProperty("家长是否知晓(离校、留校)")
|
||||
@TableField("fam_know")
|
||||
@Excel(name = "家长是否知晓(离校、留校)")
|
||||
public String famKnow;
|
||||
|
||||
|
||||
@ApiModelProperty("预计离校时间")
|
||||
@TableField("will_leave_time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "预计离校时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
public Date willLeaveTime;
|
||||
|
||||
@ApiModelProperty("去向地")
|
||||
@TableField("will_addr")
|
||||
@Excel(name = "去向地")
|
||||
public String willAddr;
|
||||
|
||||
|
||||
@ApiModelProperty("计划返校时间")
|
||||
@TableField("scheduled_return_time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "计划返校时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
public Date scheduledReturnTime;
|
||||
|
||||
/**
|
||||
* 是否到校
|
||||
*/
|
||||
@ApiModelProperty("预计留校时间")
|
||||
@TableField("will_stay_time")
|
||||
@Excel(name = "预计留校时间")
|
||||
public String willStayTime;
|
||||
|
||||
@ApiModelProperty("留校事由")
|
||||
@TableField("stay_reason")
|
||||
@Excel(name = "留校事由")
|
||||
public String stayReason;
|
||||
|
||||
|
||||
@ApiModelProperty("离校、留校审核状态")
|
||||
@TableField("leave_status")
|
||||
@Excel(name = "离校、留校审核状态",dictType = "sur_status")
|
||||
public String leaveStatus;
|
||||
|
||||
@ApiModelProperty("是否到家")
|
||||
@TableField("is_home")
|
||||
@Excel(name = "是否到家")
|
||||
public String isHome;
|
||||
|
||||
@ApiModelProperty("到家定位")
|
||||
@TableField("home_gps")
|
||||
// @Excel(name = "到家定位")
|
||||
public String homeGps;
|
||||
|
||||
|
||||
@TableField("home_gps_addr")
|
||||
public String homeGpsAddr;
|
||||
|
||||
@TableField("home_submit")
|
||||
public String homeSubmit;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("home_gps_time")
|
||||
@Excel(name = "到家定位时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
public Date homeGpsTime;
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty("是否到校")
|
||||
@TableField("reach_school_status")
|
||||
@Excel(name = "是否到校")
|
||||
public String reachSchoolStatus;
|
||||
|
||||
/**
|
||||
* 家长姓名
|
||||
*/
|
||||
@ApiModelProperty("家长姓名")
|
||||
@TableField("parent_name")
|
||||
@Excel(name = "家长姓名")
|
||||
public String parentName;
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty("到校定位")
|
||||
@TableField("attend_school_gps")
|
||||
// @Excel(name = "到校定位")
|
||||
public String attendSchoolGps;
|
||||
|
||||
/**
|
||||
* 家长电话
|
||||
* 到校时间
|
||||
*/
|
||||
@ApiModelProperty("家长电话")
|
||||
@TableField("parent_phone")
|
||||
@Excel(name = "家长电话")
|
||||
@Sensitive(desensitizedType = DesensitizedType.PHONE)
|
||||
public String parentPhone;
|
||||
@ApiModelProperty("到校时间")
|
||||
@TableField("attend_school_time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "到校时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
public Date attendSchoolTime;
|
||||
|
||||
/**
|
||||
* 家长是否知晓
|
||||
*/
|
||||
@ApiModelProperty("家长是否知晓")
|
||||
@TableField("know")
|
||||
@Excel(name = "家长是否知晓")
|
||||
public String know;
|
||||
|
||||
/**
|
||||
* 未返校原因分类
|
||||
@@ -218,112 +296,43 @@ private static final long serialVersionUID=1L;
|
||||
public String absentSchoolRemark;
|
||||
|
||||
/**
|
||||
* 到校定位
|
||||
* 家长姓名
|
||||
*/
|
||||
@ApiModelProperty("到校定位")
|
||||
@TableField("attend_school_gps")
|
||||
@Excel(name = "到校定位")
|
||||
public String attendSchoolGps;
|
||||
@ApiModelProperty("家长姓名(返校)")
|
||||
@TableField("parent_name")
|
||||
@Excel(name = "家长姓名(返校)")
|
||||
public String parentName;
|
||||
|
||||
/**
|
||||
* 到校时间
|
||||
* 家长电话
|
||||
*/
|
||||
@ApiModelProperty("到校时间")
|
||||
@TableField("attend_school_time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "到校时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
public Date attendSchoolTime;
|
||||
@ApiModelProperty("家长电话(返校)")
|
||||
@TableField("parent_phone")
|
||||
@Excel(name = "家长电话(返校)")
|
||||
@Sensitive(desensitizedType = DesensitizedType.PHONE)
|
||||
public String parentPhone;
|
||||
|
||||
/**
|
||||
* 家长是否知晓
|
||||
*/
|
||||
@ApiModelProperty("家长是否知晓(返校)")
|
||||
@TableField("know")
|
||||
@Excel(name = "家长是否知晓(返校)")
|
||||
public String know;
|
||||
|
||||
|
||||
/**
|
||||
* 状态:0.保存,1.保存,2.已审核
|
||||
*/
|
||||
@ApiModelProperty("状态:0.保存,1.待审核,2.已审核")
|
||||
@ApiModelProperty("返校审核状态")
|
||||
@TableField("status")
|
||||
@Excel(name = "状态:0.保存,1.待审核,2.已审核")
|
||||
@Excel(name = "返校审核状态",dictType = "sur_status")
|
||||
public String status;
|
||||
|
||||
/**
|
||||
* 所属主题
|
||||
*/
|
||||
@ApiModelProperty("所属主题")
|
||||
@TableField("survey_id")
|
||||
@Excel(name = "所属主题")
|
||||
public Long surveyId;
|
||||
|
||||
|
||||
@ApiModelProperty("预计离校时间")
|
||||
@TableField("will_leave_time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "预计离校时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
public Date willLeaveTime;
|
||||
|
||||
@ApiModelProperty("是否离校")
|
||||
@TableField("is_leave")
|
||||
@Excel(name = "是否离校")
|
||||
public String isLeave;
|
||||
|
||||
@ApiModelProperty("家长姓名1")
|
||||
@TableField("fam_name")
|
||||
@Excel(name = "家长姓名1")
|
||||
public String famName;
|
||||
|
||||
@ApiModelProperty("家长电话1")
|
||||
@TableField("fam_phone")
|
||||
@Excel(name = "家长电话1")
|
||||
public String famPhone;
|
||||
|
||||
@ApiModelProperty("家长是否知晓1")
|
||||
@TableField("fam_know")
|
||||
@Excel(name = "家长是否知晓1")
|
||||
public String famKnow;
|
||||
|
||||
|
||||
@ApiModelProperty("预计留校时间")
|
||||
@TableField("will_stay_time")
|
||||
@Excel(name = "预计留校时间")
|
||||
public String willStayTime;
|
||||
|
||||
@ApiModelProperty("离校或留校状态")
|
||||
@TableField("leave_status")
|
||||
@Excel(name = "离校或留校状态")
|
||||
public String leaveStatus;
|
||||
|
||||
@ApiModelProperty("是否到家")
|
||||
@TableField("is_home")
|
||||
@Excel(name = "是否到家")
|
||||
public String isHome;
|
||||
|
||||
@ApiModelProperty("到家定位")
|
||||
@TableField("home_gps")
|
||||
@Excel(name = "到家定位")
|
||||
public String homeGps;
|
||||
|
||||
@ApiModelProperty("留校事由")
|
||||
@TableField("stay_reason")
|
||||
@Excel(name = "留校事由")
|
||||
public String stayReason;
|
||||
|
||||
|
||||
@ApiModelProperty("去向地")
|
||||
@TableField("will_addr")
|
||||
@Excel(name = "去向地")
|
||||
public String willAddr;
|
||||
|
||||
|
||||
@TableField("home_gps_addr")
|
||||
public String homeGpsAddr;
|
||||
|
||||
@TableField("home_submit")
|
||||
public String homeSubmit;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("home_gps_time")
|
||||
public Date homeGpsTime;
|
||||
|
||||
@TableField("more_dept_name")
|
||||
public String moreDeptName;
|
||||
|
||||
@TableField("stu_fdy_name")
|
||||
@Excel(name = "学生辅导员姓名")
|
||||
public String stuFdyName;
|
||||
|
||||
@TableField(exist = false)
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.srs.survey.domain.dto;
|
||||
|
||||
import com.srs.common.annotation.Excel;
|
||||
|
||||
public class XwReturnRes {
|
||||
|
||||
@Excel(name = "班级名称")
|
||||
public String className;
|
||||
@Excel(name = "学生数")
|
||||
public int stuNum;
|
||||
@Excel(name = "实习人数")
|
||||
public String shixi;
|
||||
@Excel(name = "应返校人数")
|
||||
public String yingfanxiao;
|
||||
@Excel(name = "实际累计返校")
|
||||
public String yifanxiao;
|
||||
@Excel(name = "未返校")
|
||||
public String weifanxiao;
|
||||
@Excel(name = "路上")
|
||||
public String lushang;
|
||||
@Excel(name = "病假")
|
||||
public String bingjia;
|
||||
@Excel(name = "无票")
|
||||
public String wupiao;
|
||||
@Excel(name = "无课请事假延长")
|
||||
public String wuke;
|
||||
@Excel(name = "事假")
|
||||
public String shijia;
|
||||
@Excel(name = "红白事")
|
||||
public String hongbaishi;
|
||||
@Excel(name = "考试")
|
||||
public String kaoshi;
|
||||
@Excel(name = "参赛")
|
||||
public String cansai;
|
||||
@Excel(name = "兵检或役前训练")
|
||||
public String bingjian;
|
||||
@Excel(name = "退学或休学")
|
||||
public String tuixue;
|
||||
}
|
||||
@@ -3,11 +3,13 @@ package com.srs.survey.mapper;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.srs.survey.domain.SurItinerary;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.srs.survey.domain.dto.LeaveRes;
|
||||
import com.srs.survey.domain.dto.ReturnRes;
|
||||
import com.srs.survey.domain.dto.SubmitRes;
|
||||
import com.srs.survey.domain.dto.XwReturnRes;
|
||||
import com.srs.survey.domain.vo.SurItineraryStatisticsVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -19,18 +21,26 @@ import org.apache.ibatis.annotations.Param;
|
||||
* @date 2025-03-14
|
||||
*/
|
||||
@Mapper
|
||||
public interface SurItineraryMapper extends BaseMapper<SurItinerary> {
|
||||
public interface SurItineraryMapper extends MPJBaseMapper<SurItinerary> {
|
||||
|
||||
public List<Map<String, Object>> countWillLeave(Long surveyId);
|
||||
|
||||
public List<Map<String, Object>> countFdyClassWillLeave(@Param("surveyId") Long surveyId,@Param("fdyNo") String fdyNo);
|
||||
|
||||
|
||||
public List<Map<String, Object>> countXwWillLeave(@Param("surveyId") Long surveyId,@Param("deptId") Long deptId);
|
||||
|
||||
public List<Map<String, Object>> listSubmitRes(Long surveyId);
|
||||
|
||||
|
||||
public List<Map<String, Object>> listXwSubmitRes(@Param("surveyId") Long surveyId ,@Param("deptId") Long deptId);
|
||||
|
||||
public List<LeaveRes> listLeaveRes(Long surveyId);
|
||||
|
||||
public List<ReturnRes> listReturnRes(Long surveyId);
|
||||
|
||||
public List<XwReturnRes> listXwReturnRes(SurItinerary param);
|
||||
|
||||
|
||||
public List<SurItinerary> listView(SurItinerary param);
|
||||
|
||||
@@ -38,6 +48,8 @@ public interface SurItineraryMapper extends BaseMapper<SurItinerary> {
|
||||
public List<Map<String, Object>> listReturnRes1(Long surveyId);
|
||||
|
||||
|
||||
public List<Map<String, Object>> listXwReturnRes1(@Param("surveyId") Long surveyId ,@Param("deptId") Long deptId);
|
||||
|
||||
/**
|
||||
* 查询学生假期返校
|
||||
*
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.srs.survey.domain.SurItinerary;
|
||||
import com.srs.survey.domain.dto.LeaveRes;
|
||||
import com.srs.survey.domain.dto.ReturnRes;
|
||||
import com.srs.survey.domain.dto.SubmitRes;
|
||||
import com.srs.survey.domain.dto.XwReturnRes;
|
||||
import com.srs.survey.domain.vo.SurItineraryStatisticsVo;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@@ -29,17 +30,25 @@ public interface ISurItineraryService extends IService<SurItinerary> {
|
||||
|
||||
public Map<String,Object> listFdyStuLeave(SurItinerary param);
|
||||
|
||||
public List<Map<String, Object>> listXwSubmitRes(Long surveyId , Long deptId);
|
||||
|
||||
public List<Map<String, Object>> listSubmitRes(Long surveyId);
|
||||
|
||||
public List<Map<String, Object>> countWillLeave(Long surveyId);
|
||||
|
||||
|
||||
public List<Map<String, Object>> countXwWillLeave(Long surveyId,Long deptId);
|
||||
|
||||
public List<Map<String, Object>> countFdyClassWillLeave(Long surveyId,String fdyNo);
|
||||
|
||||
public List<Map<String, Object>> listReturnRes1(Long surveyId);
|
||||
|
||||
public List<Map<String, Object>> listXwReturnRes1(Long surveyId,Long deptId);
|
||||
|
||||
public List<LeaveRes> listLeaveRes(Long surveyId);
|
||||
|
||||
public List<XwReturnRes> listXwReturnRes(SurItinerary param);
|
||||
|
||||
public List<ReturnRes> listReturnRes(Long surveyId);
|
||||
|
||||
public AjaxResult getStuCampus();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.srs.survey.service.impl;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
@@ -8,6 +7,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.srs.common.core.domain.AjaxResult;
|
||||
import com.srs.common.core.domain.entity.SysUser;
|
||||
import com.srs.common.utils.WeChatUtil;
|
||||
@@ -29,6 +29,7 @@ import com.srs.dormitory.mapper.SrsDormitoryStudentMapper;
|
||||
import com.srs.survey.domain.SurSurvey;
|
||||
import com.srs.survey.domain.dto.LeaveRes;
|
||||
import com.srs.survey.domain.dto.ReturnRes;
|
||||
import com.srs.survey.domain.dto.XwReturnRes;
|
||||
import com.srs.survey.domain.vo.SurItineraryStatisticsVo;
|
||||
import com.srs.survey.mapper.SurSurveyMapper;
|
||||
import com.srs.system.mapper.SysUserMapper;
|
||||
@@ -40,7 +41,6 @@ import com.srs.survey.domain.SurItinerary;
|
||||
import com.srs.survey.service.ISurItineraryService;
|
||||
|
||||
import static com.srs.common.utils.DateUtils.getNowDate;
|
||||
import static com.srs.common.utils.PageUtils.startPage;
|
||||
import static com.srs.common.utils.SecurityUtils.*;
|
||||
|
||||
/**
|
||||
@@ -408,6 +408,11 @@ public class SurItineraryServiceImpl extends ServiceImpl<SurItineraryMapper,SurI
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> listXwReturnRes1(Long surveyId,Long deptId){
|
||||
return surItineraryMapper.listXwReturnRes1(surveyId,deptId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> listReturnRes1(Long surveyId){
|
||||
List<Map<String, Object>> list = surItineraryMapper.listReturnRes1(surveyId);
|
||||
@@ -483,12 +488,63 @@ public class SurItineraryServiceImpl extends ServiceImpl<SurItineraryMapper,SurI
|
||||
return surItineraryMapper.countWillLeave(surveyId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> countXwWillLeave(Long surveyId,Long deptId){
|
||||
return surItineraryMapper.countXwWillLeave(surveyId,deptId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> countFdyClassWillLeave(Long surveyId,String fdyNo){
|
||||
return surItineraryMapper.countFdyClassWillLeave(surveyId,fdyNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> listXwSubmitRes(Long surveyId , Long deptId){
|
||||
SurSurvey surSurvey = surSurveyMapper.selectById(surveyId);
|
||||
List<String> counts;
|
||||
if(surSurvey != null){
|
||||
String countDate = surSurvey.countDate;
|
||||
if(countDate!= null && !countDate.isEmpty()){
|
||||
counts = List.of(countDate.split(","));
|
||||
} else {
|
||||
counts = new ArrayList<>();
|
||||
}
|
||||
} else {
|
||||
counts = new ArrayList<>();
|
||||
}
|
||||
|
||||
List<Map<String, Object>> list = surItineraryMapper.listXwSubmitRes(surveyId,deptId);
|
||||
|
||||
list.forEach(map->{
|
||||
for (int i = 0 ; i < counts.size() ; i++) {
|
||||
String countD = counts.get(i);
|
||||
if( map.get("class_id") != null){
|
||||
String dateStr = countD+" 12:00:00";
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime date = LocalDateTime.parse(dateStr, formatter);
|
||||
|
||||
LocalDateTime prevDate = date.minusDays(1);
|
||||
|
||||
Long class_id = Long.parseLong(map.get("class_id").toString());
|
||||
MPJLambdaWrapper<SurItinerary> queryWrapper = new MPJLambdaWrapper<SurItinerary>();
|
||||
queryWrapper.leftJoin(ViewStuInfo.class, ViewStuInfo::getStuNo, SurItinerary::getStuNo);
|
||||
queryWrapper.eq(ViewStuInfo::getClassId, class_id);
|
||||
queryWrapper.eq(SurItinerary::getSurveyId, surveyId);
|
||||
queryWrapper.isNotNull("home_gps_time");
|
||||
queryWrapper.le("home_gps_time", date);
|
||||
if(i != 0){
|
||||
queryWrapper.gt("home_gps_time", prevDate);
|
||||
}
|
||||
long count = surItineraryMapper.selectJoinCount(queryWrapper);
|
||||
map.put(countD+" 12:00:00前", count);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> listSubmitRes(Long surveyId){
|
||||
SurSurvey surSurvey = surSurveyMapper.selectById(surveyId);
|
||||
@@ -539,6 +595,12 @@ public class SurItineraryServiceImpl extends ServiceImpl<SurItineraryMapper,SurI
|
||||
return surItineraryMapper.listLeaveRes(surveyId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<XwReturnRes> listXwReturnRes(SurItinerary param){
|
||||
return surItineraryMapper.listXwReturnRes(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReturnRes> listReturnRes(Long surveyId){
|
||||
return surItineraryMapper.listReturnRes(surveyId);
|
||||
|
||||
@@ -167,7 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
|
||||
<select id="listView" parameterType="SurItinerary" resultType="SurItinerary">
|
||||
select d.survey_name, a.*,b.class_name,b.teacher_name,c.employee_id,f.campus_name,f.park_name,f.building_name,f.room_no
|
||||
select d.survey_name, a.*,b.class_name,b.teacher_name,c.employee_id,f.campus_name,f.park_name,f.building_name,f.room_no,b.dept_name
|
||||
from sur_itinerary as a
|
||||
left join view_stu_info as b on a.stu_no = b.stu_no
|
||||
left join cph_teacher as c on b.teacher_id = c.teacher_id
|
||||
@@ -205,57 +205,57 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by a.return_school_id desc
|
||||
</select>
|
||||
|
||||
<select id="listReturnRes" parameterType="Long" resultType="ReturnRes">
|
||||
<select id="listXwReturnRes" parameterType="SurItinerary" resultType="XwReturnRes">
|
||||
select res1.*,( res1.yingfanxiao - res1.yifanxiao ) as weifanxiao,
|
||||
(
|
||||
select count(1) from sur_itinerary as a
|
||||
left join view_stu_info as b on a.stu_no = b.stu_no
|
||||
where a.absent_school_type = "路上" and a.survey_id = #{surveyId} and b.dept_name = res1.dept_name and b.grade_name = res1.grade_name
|
||||
where a.absent_school_type = "路上" and a.survey_id = #{surveyId} and b.class_id = res1.class_id
|
||||
) as lushang,
|
||||
(
|
||||
select count(1) from sur_itinerary as a
|
||||
left join view_stu_info as b on a.stu_no = b.stu_no
|
||||
where a.absent_school_type = "病假" and a.survey_id = #{surveyId} and b.dept_name = res1.dept_name and b.grade_name = res1.grade_name
|
||||
where a.absent_school_type = "病假" and a.survey_id = #{surveyId} and b.class_id = res1.class_id
|
||||
) as bingjia,
|
||||
(
|
||||
select count(1) from sur_itinerary as a
|
||||
left join view_stu_info as b on a.stu_no = b.stu_no
|
||||
where a.absent_school_type = "无票" and a.survey_id = #{surveyId} and b.dept_name = res1.dept_name and b.grade_name = res1.grade_name
|
||||
where a.absent_school_type = "无票" and a.survey_id = #{surveyId} and b.class_id = res1.class_id
|
||||
) as wupiao,
|
||||
(
|
||||
select count(1) from sur_itinerary as a
|
||||
left join view_stu_info as b on a.stu_no = b.stu_no
|
||||
where a.absent_school_type = "无课请事假延长" and a.survey_id = #{surveyId} and b.dept_name = res1.dept_name and b.grade_name = res1.grade_name
|
||||
where a.absent_school_type = "无课请事假延长" and a.survey_id = #{surveyId} and b.class_id = res1.class_id
|
||||
) as wuke,
|
||||
(
|
||||
select count(1) from sur_itinerary as a
|
||||
left join view_stu_info as b on a.stu_no = b.stu_no
|
||||
where a.absent_school_type = "事假" and a.survey_id = #{surveyId} and b.dept_name = res1.dept_name and b.grade_name = res1.grade_name
|
||||
where a.absent_school_type = "事假" and a.survey_id = #{surveyId} and b.dept_name = b.class_id = res1.class_id
|
||||
) as shijia,
|
||||
(
|
||||
select count(1) from sur_itinerary as a
|
||||
left join view_stu_info as b on a.stu_no = b.stu_no
|
||||
where a.absent_school_type = "红白事" and a.survey_id = #{surveyId} and b.dept_name = res1.dept_name and b.grade_name = res1.grade_name
|
||||
where a.absent_school_type = "红白事" and a.survey_id = #{surveyId} and b.class_id = res1.class_id
|
||||
) as hongbaishi,
|
||||
(
|
||||
select count(1) from sur_itinerary as a
|
||||
left join view_stu_info as b on a.stu_no = b.stu_no
|
||||
where a.absent_school_type = "考试" and a.survey_id = #{surveyId} and b.dept_name = res1.dept_name and b.grade_name = res1.grade_name
|
||||
where a.absent_school_type = "考试" and a.survey_id = #{surveyId} and b.class_id = res1.class_id
|
||||
) as kaoshi,
|
||||
(
|
||||
select count(1) from sur_itinerary as a
|
||||
left join view_stu_info as b on a.stu_no = b.stu_no
|
||||
where a.absent_school_type = "参赛" and a.survey_id = #{surveyId} and b.dept_name = res1.dept_name and b.grade_name = res1.grade_name
|
||||
where a.absent_school_type = "参赛" and a.survey_id = #{surveyId} and b.class_id = res1.class_id
|
||||
) as cansai,
|
||||
(
|
||||
select count(1) from sur_itinerary as a
|
||||
left join view_stu_info as b on a.stu_no = b.stu_no
|
||||
where a.absent_school_type = "兵检或役前训练" and a.survey_id = #{surveyId} and b.dept_name = res1.dept_name and b.grade_name = res1.grade_name
|
||||
where a.absent_school_type = "兵检或役前训练" and a.survey_id = #{surveyId} and b.class_id = res1.class_id
|
||||
) as bingjian,
|
||||
(
|
||||
select count(1) from sur_itinerary as a
|
||||
left join view_stu_info as b on a.stu_no = b.stu_no
|
||||
where a.absent_school_type = "退学或休学" and a.survey_id = #{surveyId} and b.dept_name = res1.dept_name and b.grade_name = res1.grade_name
|
||||
where a.absent_school_type = "退学或休学" and a.survey_id = #{surveyId} and b.class_id = res1.class_id
|
||||
) as tuixue
|
||||
|
||||
from
|
||||
@@ -263,24 +263,109 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select r1.*,
|
||||
(select count(1) from sur_itinerary as tt1
|
||||
left join view_stu_info as tt2 on tt1.stu_no = tt2.stu_no
|
||||
where tt1.`status` = "2" and tt1.reach_school_status = "是" and tt1.survey_id = #{surveyId} and tt2.dept_name = r1.dept_name and tt2.grade_name = r1.grade_name
|
||||
) as yifanxiao
|
||||
where tt1.`status` = "2" and tt1.reach_school_status = "是" and tt1.survey_id = #{surveyId} and tt2.class_id = r1.class_id) as yifanxiao
|
||||
from
|
||||
(
|
||||
select a.dept_name,a.grade_name,count(1) as stu_num,
|
||||
(select count(1) from view_stu_info as tt1 where tt1.`status` = "05" and tt1.dept_name = a.dept_name and tt1.grade_name = a.grade_name ) as shixi,
|
||||
select a.class_id,a.class_name,count(1) as stu_num,
|
||||
(select count(1) from view_stu_info as tt1 where tt1.`status` = "05" and tt1.class_id = a.class_id ) as shixi,
|
||||
(select count(1) from srs_dormitory_student as tt1
|
||||
left join view_stu_info as tt2 on tt1.stu_no = tt2.stu_no
|
||||
where tt2.`status` = "01" and tt2.dept_name = a.dept_name and tt2.grade_name = a.grade_name ) as yingfanxiao
|
||||
where tt2.`status` = "01" and tt2.class_id = a.class_id ) as yingfanxiao
|
||||
from view_stu_info as a
|
||||
left join srs_grade as b on a.grade_id = b.grade_id
|
||||
where b.grade_status in (1,3) and a.dept_name is not null and a.`status` = "01"
|
||||
GROUP BY a.dept_name,a.grade_name
|
||||
order by a.dept_name,a.grade_name
|
||||
where b.grade_status in (1,3) and a.dept_id = #{deptId} and a.`status` = "01"
|
||||
GROUP BY a.class_id,a.class_name
|
||||
order by a.class_name
|
||||
) as r1
|
||||
) as res1
|
||||
</select>
|
||||
|
||||
<select id="listReturnRes" parameterType="Long" resultType="ReturnRes">
|
||||
SELECT
|
||||
res1.dept_name,
|
||||
res1.grade_name,
|
||||
res1.stu_num,
|
||||
res1.shixi,
|
||||
res1.yingfanxiao,
|
||||
res1.yifanxiao,
|
||||
(res1.yingfanxiao - res1.yifanxiao) AS weifanxiao,
|
||||
COALESCE(agg.lushang, 0) AS lushang,
|
||||
COALESCE(agg.bingjia, 0) AS bingjia,
|
||||
COALESCE(agg.wupiao, 0) AS wupiao,
|
||||
COALESCE(agg.wuke, 0) AS wuke,
|
||||
COALESCE(agg.shijia, 0) AS shijia,
|
||||
COALESCE(agg.hongbaishi, 0) AS hongbaishi,
|
||||
COALESCE(agg.kaoshi, 0) AS kaoshi,
|
||||
COALESCE(agg.cansai, 0) AS cansai,
|
||||
COALESCE(agg.bingjian, 0) AS bingjian,
|
||||
COALESCE(agg.tuixue, 0) AS tuixue
|
||||
FROM (
|
||||
SELECT
|
||||
r1.dept_name,
|
||||
r1.grade_name,
|
||||
r1.stu_num,
|
||||
r1.shixi,
|
||||
r1.yingfanxiao,
|
||||
COALESCE((SELECT COUNT(1)
|
||||
FROM sur_itinerary AS tt1
|
||||
LEFT JOIN view_stu_info AS tt2 ON tt1.stu_no = tt2.stu_no
|
||||
WHERE tt1.`status` = "2"
|
||||
AND tt1.reach_school_status = "是"
|
||||
AND tt1.survey_id = #{surveyId}
|
||||
AND tt2.dept_name = r1.dept_name
|
||||
AND tt2.grade_name = r1.grade_name
|
||||
), 0) AS yifanxiao
|
||||
FROM (
|
||||
SELECT
|
||||
a.dept_name,
|
||||
a.grade_name,
|
||||
COUNT(1) AS stu_num,
|
||||
COALESCE((SELECT COUNT(1)
|
||||
FROM view_stu_info AS tt1
|
||||
WHERE tt1.`status` = "05"
|
||||
AND tt1.dept_name = a.dept_name
|
||||
AND tt1.grade_name = a.grade_name
|
||||
), 0) AS shixi,
|
||||
COALESCE((SELECT COUNT(1)
|
||||
FROM srs_dormitory_student AS tt1
|
||||
LEFT JOIN view_stu_info AS tt2 ON tt1.stu_no = tt2.stu_no
|
||||
WHERE tt2.`status` = "01"
|
||||
AND tt2.dept_name = a.dept_name
|
||||
AND tt2.grade_name = a.grade_name
|
||||
), 0) AS yingfanxiao
|
||||
FROM view_stu_info AS a
|
||||
LEFT JOIN srs_grade AS b ON a.grade_id = b.grade_id
|
||||
WHERE b.grade_status IN (1, 3)
|
||||
AND a.dept_name IS NOT NULL
|
||||
AND a.`status` = "01"
|
||||
GROUP BY a.dept_name, a.grade_name
|
||||
ORDER BY a.dept_name, a.grade_name
|
||||
) AS r1
|
||||
) AS res1
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
b.dept_name,
|
||||
b.grade_name,
|
||||
COUNT(CASE WHEN a.absent_school_type = "路上" THEN 1 END) AS lushang,
|
||||
COUNT(CASE WHEN a.absent_school_type = "病假" THEN 1 END) AS bingjia,
|
||||
COUNT(CASE WHEN a.absent_school_type = "无票" THEN 1 END) AS wupiao,
|
||||
COUNT(CASE WHEN a.absent_school_type = "无课请事假延长" THEN 1 END) AS wuke,
|
||||
COUNT(CASE WHEN a.absent_school_type = "事假" THEN 1 END) AS shijia,
|
||||
COUNT(CASE WHEN a.absent_school_type = "红白事" THEN 1 END) AS hongbaishi,
|
||||
COUNT(CASE WHEN a.absent_school_type = "考试" THEN 1 END) AS kaoshi,
|
||||
COUNT(CASE WHEN a.absent_school_type = "参赛" THEN 1 END) AS cansai,
|
||||
COUNT(CASE WHEN a.absent_school_type = "兵检或役前训练" THEN 1 END) AS bingjian,
|
||||
COUNT(CASE WHEN a.absent_school_type = "退学或休学" THEN 1 END) AS tuixue
|
||||
FROM sur_itinerary AS a
|
||||
LEFT JOIN view_stu_info AS b ON a.stu_no = b.stu_no
|
||||
WHERE a.survey_id = #{surveyId}
|
||||
GROUP BY b.dept_name, b.grade_name
|
||||
) AS agg ON res1.dept_name = agg.dept_name
|
||||
AND res1.grade_name = agg.grade_name
|
||||
ORDER BY res1.dept_name, res1.grade_name;
|
||||
|
||||
</select>
|
||||
|
||||
<select id="listLeaveRes" parameterType="Long" resultType="LeaveRes">
|
||||
select a.dept_name,count(1) as stu_num,
|
||||
(select count(1)
|
||||
@@ -304,6 +389,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
group by a.dept_name
|
||||
</select>
|
||||
|
||||
<select id="listXwSubmitRes" resultType="map">
|
||||
WITH base_class AS (
|
||||
SELECT
|
||||
f1.class_id
|
||||
FROM view_stu_info AS f1
|
||||
LEFT JOIN srs_grade AS f2 ON f1.grade_id = f2.grade_id
|
||||
WHERE f1.status IN ('01','05','06') AND f2.grade_status IN (1,3) and f1.dept_id = #{deptId}
|
||||
GROUP BY f1.class_id
|
||||
),
|
||||
stu_stat AS (
|
||||
SELECT
|
||||
a.class_id,
|
||||
COUNT(*) AS stu_num
|
||||
FROM view_stu_info a
|
||||
LEFT JOIN srs_grade b ON a.grade_id = b.grade_id
|
||||
WHERE b.grade_status IN (1,3) AND a.status IN ('01','05','06') and a.dept_id = #{deptId}
|
||||
GROUP BY a.class_id
|
||||
),
|
||||
itinerary_stat AS (
|
||||
SELECT
|
||||
b.class_id,
|
||||
COUNT(*) AS submit_num,
|
||||
SUM(a.is_home = '是') AS home_num,
|
||||
SUM(a.is_leave = 0) AS stay_num
|
||||
FROM sur_itinerary a
|
||||
left join view_stu_info as b on a.stu_no = b.stu_no
|
||||
WHERE a.survey_id = #{surveyId} and b.dept_id = #{deptId}
|
||||
GROUP BY b.class_id
|
||||
)
|
||||
SELECT
|
||||
c.class_name,c.class_id,
|
||||
COALESCE(its.submit_num, 0) AS submit_num,
|
||||
COALESCE(its.home_num, 0) AS home_num,
|
||||
COALESCE(its.stay_num, 0) AS stay_num,
|
||||
COALESCE(ss.stu_num, 0) AS stu_num
|
||||
FROM base_class bd
|
||||
LEFT JOIN itinerary_stat its ON bd.class_id = its.class_id
|
||||
LEFT JOIN stu_stat ss ON bd.class_id = ss.class_id
|
||||
left join srs_class as c on bd.class_id = c.class_id;
|
||||
</select>
|
||||
|
||||
<select id="listSubmitRes" parameterType="Long" resultType="map">
|
||||
WITH base_dept AS (
|
||||
SELECT
|
||||
@@ -356,6 +482,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
GROUP BY more_dept_name
|
||||
</select>
|
||||
|
||||
<select id="listXwReturnRes1" resultType="map">
|
||||
WITH base_class AS (
|
||||
SELECT
|
||||
f1.class_id
|
||||
FROM view_stu_info AS f1
|
||||
LEFT JOIN srs_grade AS f2 ON f1.grade_id = f2.grade_id
|
||||
WHERE f1.status IN ('01','05','06') AND f2.grade_status IN (1,3) and f1.dept_id = #{deptId}
|
||||
GROUP BY f1.class_id
|
||||
),
|
||||
stu_stat AS (
|
||||
SELECT
|
||||
a.class_id,
|
||||
COUNT(*) AS stu_num,
|
||||
SUM(a.status = '05') AS shixi,
|
||||
SUM(a.status in ('01','06')) AS yingfanxiao
|
||||
FROM view_stu_info a
|
||||
LEFT JOIN srs_grade b ON a.grade_id = b.grade_id
|
||||
WHERE b.grade_status IN (1,3) AND a.status IN ('01','05','06') and a.dept_id = #{deptId}
|
||||
GROUP BY a.class_id
|
||||
),
|
||||
itinerary_stat AS (
|
||||
SELECT
|
||||
b.class_id,
|
||||
COUNT(*) AS submit_num,
|
||||
SUM(a.status = '2' AND a.reach_school_status = '是') AS yifanxiao,
|
||||
SUM(a.absent_school_type = '路上') AS lushang,
|
||||
SUM(a.absent_school_type = '病假') AS bingjia,
|
||||
SUM(a.absent_school_type = '无票') AS wupiao,
|
||||
SUM(a.absent_school_type = '无课请事假延长') AS wuke,
|
||||
SUM(a.absent_school_type = '事假') AS shijia,
|
||||
SUM(a.absent_school_type = '红白事') AS hongbaishi,
|
||||
SUM(a.absent_school_type = '考试') AS kaoshi,
|
||||
SUM(a.absent_school_type = '参赛') AS cansai,
|
||||
SUM(a.absent_school_type = '兵检或役前训练') AS bingjian,
|
||||
SUM(a.absent_school_type = '退学或休学') AS tuixue
|
||||
FROM sur_itinerary a
|
||||
left join view_stu_info as b on a.stu_no = b.stu_no
|
||||
WHERE a.survey_id = #{surveyId} and b.dept_id = #{deptId}
|
||||
GROUP BY b.class_id
|
||||
)
|
||||
SELECT
|
||||
bd.class_id,c.class_name,
|
||||
COALESCE(its.submit_num, 0) AS submit_num,
|
||||
COALESCE(ss.stu_num, 0) AS stu_num,
|
||||
COALESCE(ss.shixi, 0) AS shixi,
|
||||
COALESCE(ss.yingfanxiao, 0) AS yingfanxiao,
|
||||
COALESCE(its.yifanxiao, 0) AS yifanxiao,
|
||||
COALESCE(ss.yingfanxiao - its.yifanxiao, 0) AS weifanxiao,
|
||||
COALESCE(its.lushang, 0) AS lushang,
|
||||
COALESCE(its.bingjia, 0) AS bingjia,
|
||||
COALESCE(its.wupiao, 0) AS wupiao,
|
||||
COALESCE(its.wuke, 0) AS wuke,
|
||||
COALESCE(its.shijia, 0) AS shijia,
|
||||
COALESCE(its.hongbaishi, 0) AS hongbaishi,
|
||||
COALESCE(its.kaoshi, 0) AS kaoshi,
|
||||
COALESCE(its.cansai, 0) AS cansai,
|
||||
COALESCE(its.bingjian, 0) AS bingjian,
|
||||
COALESCE(its.tuixue, 0) AS tuixue
|
||||
FROM base_class bd
|
||||
LEFT JOIN stu_stat ss ON bd.class_id = ss.class_id
|
||||
LEFT JOIN itinerary_stat its ON bd.class_id = its.class_id
|
||||
left join srs_class as c on bd.class_id = c.class_id
|
||||
</select>
|
||||
|
||||
|
||||
<select id="listReturnRes1" parameterType="Long" resultType="map">
|
||||
WITH base_dept AS (
|
||||
@@ -429,4 +619,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
CALL test_survey_class_leave_statistics(#{surveyId}, #{fdyNo});
|
||||
</select>
|
||||
|
||||
<select id="countXwWillLeave" statementType="CALLABLE" resultType="map">
|
||||
CALL test_survey_xw_leave_statistics(#{surveyId}, #{deptId});
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user