This commit is contained in:
parent
f12332f282
commit
98f721ecd7
|
@ -61,5 +61,10 @@ public class SysEvaluationConclusion {
|
||||||
*/
|
*/
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预警状态
|
||||||
|
*/
|
||||||
|
private Integer warnStatus;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,14 @@ public class SysEvaluationConclusionVo implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Integer situation;
|
private Integer situation;
|
||||||
|
|
||||||
private String SituationName;
|
/**
|
||||||
|
* 预警状态
|
||||||
|
*/
|
||||||
|
private Integer warnStatus;
|
||||||
|
|
||||||
|
private String situationName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package org.dromara.scale.mapper;
|
package org.dromara.scale.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
@ -10,7 +8,7 @@ import org.dromara.scale.domain.vo.ArchiveVo;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ArchiveMapper {
|
public interface ArchiveMapper {
|
||||||
Page<ArchiveVo> selectArchiveVoPage(@Param("page") Page<ArchiveVo> page, @Param(Constants.WRAPPER) Wrapper<ArchiveVo> queryWrapper);
|
Page<ArchiveVo> selectArchiveVoPage(@Param("page") Page<ArchiveVo> page, @Param("query") ArchiveVo vo);
|
||||||
|
|
||||||
Page<ArchiveStatisticVo> selectStatisticVoPage(@Param("page") Page<ArchiveStatisticVo> page, @Param("userId") Long userId);
|
Page<ArchiveStatisticVo> selectStatisticVoPage(@Param("page") Page<ArchiveStatisticVo> page, @Param("userId") Long userId);
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
package org.dromara.scale.service.impl;
|
package org.dromara.scale.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.scale.domain.vo.ArchiveStatisticVo;
|
import org.dromara.scale.domain.vo.ArchiveStatisticVo;
|
||||||
|
@ -28,11 +25,11 @@ public class ArchiveServiceImpl implements IArchiveService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<ArchiveVo> queryPageList(ArchiveVo vo, PageQuery pageQuery) {
|
public TableDataInfo<ArchiveVo> queryPageList(ArchiveVo vo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<ArchiveVo> lqw = Wrappers.lambdaQuery();
|
//LambdaQueryWrapper<ArchiveVo> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.eq(ArchiveVo::getUserType, "student");
|
//lqw.eq(ArchiveVo::getUserType, "student");
|
||||||
lqw.like(StringUtils.isNotEmpty(vo.getNickName()), ArchiveVo::getNickName, vo.getNickName());
|
//lqw.like(StringUtils.isNotEmpty(vo.getNickName()), ArchiveVo::getNickName, vo.getNickName());
|
||||||
lqw.like(StringUtils.isNotEmpty(vo.getPhonenumber()), ArchiveVo::getPhonenumber, vo.getPhonenumber());
|
//lqw.like(StringUtils.isNotEmpty(vo.getPhonenumber()), ArchiveVo::getPhonenumber, vo.getPhonenumber());
|
||||||
Page<ArchiveVo> result = archiveMapper.selectArchiveVoPage(pageQuery.build(), lqw);
|
Page<ArchiveVo> result = archiveMapper.selectArchiveVoPage(pageQuery.build(), vo);
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ public class SysEvaluationRecordServiceImpl implements ISysEvaluationRecordServi
|
||||||
EvaluationRecordWordData wordData = new EvaluationRecordWordData();
|
EvaluationRecordWordData wordData = new EvaluationRecordWordData();
|
||||||
|
|
||||||
String name = configService.selectConfigByKey("sys.school.name");
|
String name = configService.selectConfigByKey("sys.school.name");
|
||||||
wordData.setScaleName(name);
|
wordData.setSchoolName(name);
|
||||||
|
|
||||||
SysEvaluationRecord sysEvaluationRecord = baseMapper.selectById(recordId);
|
SysEvaluationRecord sysEvaluationRecord = baseMapper.selectById(recordId);
|
||||||
Date createTime = sysEvaluationRecord.getCreateTime();
|
Date createTime = sysEvaluationRecord.getCreateTime();
|
||||||
|
|
|
@ -167,26 +167,22 @@ public class WebServiceImpl implements IWebService {
|
||||||
update.setStatus(StatusEnum.IN_USE.getValue());
|
update.setStatus(StatusEnum.IN_USE.getValue());
|
||||||
update.setUpdateTime(new Date());
|
update.setUpdateTime(new Date());
|
||||||
recordMapper.updateById(update);
|
recordMapper.updateById(update);
|
||||||
|
//判断一个人是否完成所有量表
|
||||||
int undoneNum = recordMapper.selectUndoneNumByBatchNoAndUserId(batchNo, loginUser.getUserId());
|
int undoneNum = recordMapper.selectUndoneNumByBatchNoAndUserId(batchNo, loginUser.getUserId());
|
||||||
if (undoneNum <= 1) {
|
if (undoneNum == 0) {
|
||||||
publishMapper.addCompleteNum(batchNo);
|
publishMapper.addCompleteNum(batchNo);
|
||||||
}
|
}
|
||||||
Integer riskLevel = -1;
|
|
||||||
//选择风险等级最高
|
//选择风险等级最高
|
||||||
for (SysEvaluationConclusionVo ec : list) {
|
Optional<SysEvaluationConclusionVo> max = list.stream().filter(e -> e.getWarnStatus() == 1)
|
||||||
if (ec.getSituation() > riskLevel) {
|
.max(Comparator.comparingInt(SysEvaluationConclusionVo::getSituation));
|
||||||
riskLevel = ec.getSituation();
|
if (max.isPresent()) {
|
||||||
}
|
|
||||||
}
|
|
||||||
List<Integer> used = warnMapper.selectUseConfig();
|
|
||||||
if (used.contains(riskLevel)) {
|
|
||||||
SysWarnRecord wre = new SysWarnRecord();
|
SysWarnRecord wre = new SysWarnRecord();
|
||||||
wre.setBatchNo(batchNo);
|
wre.setBatchNo(batchNo);
|
||||||
wre.setUserId(loginUser.getUserId());
|
wre.setUserId(loginUser.getUserId());
|
||||||
wre.setDeptId(loginUser.getDeptId());
|
wre.setDeptId(loginUser.getDeptId());
|
||||||
wre.setWarnTime(new Date());
|
wre.setWarnTime(new Date());
|
||||||
wre.setSituation(riskLevel);
|
wre.setSituation(max.get().getSituation());
|
||||||
warnRecordService.insertByBo(wre);
|
warnRecordService.insertByBo(wre);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,11 +213,13 @@ public class WebServiceImpl implements IWebService {
|
||||||
|
|
||||||
List<SysScaleFactorVo> scaleFactorList = scaleFactorService.getScaleEvalItemList(scaleId);
|
List<SysScaleFactorVo> scaleFactorList = scaleFactorService.getScaleEvalItemList(scaleId);
|
||||||
List<SysEvaluationConclusionVo> list = new ArrayList<>(scaleFactorList.size());
|
List<SysEvaluationConclusionVo> list = new ArrayList<>(scaleFactorList.size());
|
||||||
|
List<Integer> used = warnMapper.selectUseConfig();
|
||||||
for (SysScaleFactorVo scaleFactor : scaleFactorList) {
|
for (SysScaleFactorVo scaleFactor : scaleFactorList) {
|
||||||
Long factorId = scaleFactor.getFactorId();
|
Long factorId = scaleFactor.getFactorId();
|
||||||
AtomicReference<BigDecimal> totalSocre = new AtomicReference<>(BigDecimal.ZERO);
|
AtomicReference<BigDecimal> totalSocre = new AtomicReference<>(BigDecimal.ZERO);
|
||||||
|
|
||||||
SysEvaluationConclusionVo evalConclusion = new SysEvaluationConclusionVo();
|
SysEvaluationConclusionVo evalConclusion = new SysEvaluationConclusionVo();
|
||||||
|
evalConclusion.setFactorName(scaleFactor.getFactorName());
|
||||||
evalConclusion.setFactorId(factorId);
|
evalConclusion.setFactorId(factorId);
|
||||||
evalConclusion.setRecordId(recordId);
|
evalConclusion.setRecordId(recordId);
|
||||||
evalConclusion.setStatus(StatusEnum.DISABLED.getValue());
|
evalConclusion.setStatus(StatusEnum.DISABLED.getValue());
|
||||||
|
@ -263,6 +261,8 @@ public class WebServiceImpl implements IWebService {
|
||||||
evalConclusion.setEvalDesc(factorRangeList.get(0).getEvalDesc());
|
evalConclusion.setEvalDesc(factorRangeList.get(0).getEvalDesc());
|
||||||
evalConclusion.setEvalPropose(factorRangeList.get(0).getEvalPropose());
|
evalConclusion.setEvalPropose(factorRangeList.get(0).getEvalPropose());
|
||||||
evalConclusion.setFactorRangeId(factorRangeList.get(0).getRangeId());
|
evalConclusion.setFactorRangeId(factorRangeList.get(0).getRangeId());
|
||||||
|
evalConclusion.setSituation(factorRangeList.get(0).getSituation());
|
||||||
|
evalConclusion.setSituationName(SituationEnum.getNameByCode(factorRangeList.get(0).getSituation()));
|
||||||
} else {
|
} else {
|
||||||
for (SysScaleFactorRangeVo range : factorRangeList) {
|
for (SysScaleFactorRangeVo range : factorRangeList) {
|
||||||
if (Objects.nonNull(range.getMinValue()) && Objects.nonNull(range.getMaxValue())) {
|
if (Objects.nonNull(range.getMinValue()) && Objects.nonNull(range.getMaxValue())) {
|
||||||
|
@ -294,6 +294,7 @@ public class WebServiceImpl implements IWebService {
|
||||||
evalConclusion.setFactorRangeId(range.getRangeId());
|
evalConclusion.setFactorRangeId(range.getRangeId());
|
||||||
evalConclusion.setSituation(range.getSituation());
|
evalConclusion.setSituation(range.getSituation());
|
||||||
evalConclusion.setSituationName(SituationEnum.getNameByCode(range.getSituation()));
|
evalConclusion.setSituationName(SituationEnum.getNameByCode(range.getSituation()));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} //else {
|
} //else {
|
||||||
|
@ -304,6 +305,9 @@ public class WebServiceImpl implements IWebService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (used.contains(evalConclusion.getSituation())) {
|
||||||
|
evalConclusion.setWarnStatus(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//处理维度问题及status
|
//处理维度问题及status
|
||||||
//量表
|
//量表
|
||||||
|
|
|
@ -11,10 +11,17 @@
|
||||||
u.sex,
|
u.sex,
|
||||||
u.phonenumber,
|
u.phonenumber,
|
||||||
u.address,
|
u.address,
|
||||||
d.dept_name
|
d.dept_name,
|
||||||
|
u.user_type
|
||||||
from sys_user u
|
from sys_user u
|
||||||
left join sys_dept d on d.dept_id = u.dept_id
|
left join sys_dept d on d.dept_id = u.dept_id
|
||||||
${ew.getCustomSqlSegment}
|
where u.user_type = 'student'
|
||||||
|
<if test="query.nickName != null and query.nickName != ''">
|
||||||
|
and u.nick_name like CONCAT('%', #{query.nickName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="query.phonenumber != null and query.phonenumber != ''">
|
||||||
|
and u.phonenumber like CONCAT('%', #{query.phonenumber}, '%')
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectStatisticVoPage" resultType="org.dromara.scale.domain.vo.ArchiveStatisticVo">
|
<select id="selectStatisticVoPage" resultType="org.dromara.scale.domain.vo.ArchiveStatisticVo">
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
select d.dept_name,
|
select d.dept_name,
|
||||||
parent.dept_name as `parentName`,
|
parent.dept_name as `parentName`,
|
||||||
count(if(er.status = 1, 1, null)) as `value`,
|
count(if(er.status = 1, 1, null)) as `value`,
|
||||||
count(if(er.status = 0, 1, null)) as `spareValue`
|
count(if(er.status = -1, 1, null)) as `spareValue`
|
||||||
from sys_evaluation_record er
|
from sys_evaluation_record er
|
||||||
left join sys_dept d on d.dept_id = er.dept_id
|
left join sys_dept d on d.dept_id = er.dept_id
|
||||||
left join sys_dept parent on parent.dept_id = d.parent_id
|
left join sys_dept parent on parent.dept_id = d.parent_id
|
||||||
|
@ -19,18 +19,21 @@
|
||||||
<select id="selectStatisticWarn" resultType="org.dromara.scale.domain.vo.StatisticWarnVo">
|
<select id="selectStatisticWarn" resultType="org.dromara.scale.domain.vo.StatisticWarnVo">
|
||||||
select d.dept_name,
|
select d.dept_name,
|
||||||
parent.dept_name as `parentName`,
|
parent.dept_name as `parentName`,
|
||||||
count(if(sfr.situation = 1, 1, null)) as `noneNum`,
|
count(if(t.situation = 1, 1, null)) as `noneNum`,
|
||||||
count(if(sfr.situation = 2, 1, null)) as `lowNum`,
|
count(if(t.situation = 2, 1, null)) as `lowNum`,
|
||||||
count(if(sfr.situation = 3, 1, null)) as `middleNum`,
|
count(if(t.situation = 3, 1, null)) as `middleNum`,
|
||||||
count(if(sfr.situation = 4, 1, null)) as `highNum`,
|
count(if(t.situation = 4, 1, null)) as `highNum`,
|
||||||
count(if(sfr.situation = 5, 1, null)) as `majorNum`
|
count(if(t.situation = 5, 1, null)) as `majorNum`
|
||||||
|
from (select er.dept_id, MAX(ec.situation) as situation
|
||||||
from sys_evaluation_record er
|
from sys_evaluation_record er
|
||||||
left join sys_dept d on d.dept_id = er.dept_id and er.status = 1
|
left join sys_evaluation_conclusion ec
|
||||||
left join sys_dept parent on parent.dept_id = d.parent_id
|
on ec.record_id = er.record_id and ec.status = 1
|
||||||
left join sys_evaluation_conclusion ec on ec.record_id = er.record_id and ec.status = 1
|
where er.status = 1
|
||||||
left join sys_scale_factor_range sfr on sfr.range_id = ec.factor_range_id
|
and er.batch_no = #{batchNo}
|
||||||
where er.batch_no = #{batchNo}
|
|
||||||
and er.scale_id = #{scaleId}
|
and er.scale_id = #{scaleId}
|
||||||
|
group by er.record_id) t
|
||||||
|
left join sys_dept d on d.dept_id = t.dept_id
|
||||||
|
left join sys_dept parent on parent.dept_id = d.parent_id
|
||||||
group by d.dept_id
|
group by d.dept_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -50,15 +53,20 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectStatisticWarn4All" resultType="org.dromara.scale.domain.vo.StatisticWarnVo">
|
<select id="selectStatisticWarn4All" resultType="org.dromara.scale.domain.vo.StatisticWarnVo">
|
||||||
select count(if(sfr.situation = 1, 1, null)) as `noneNum`,
|
select count(if(t.situation = 1, 1, null)) as `noneNum`,
|
||||||
count(if(sfr.situation = 2, 1, null)) as `lowNum`,
|
count(if(t.situation = 2, 1, null)) as `lowNum`,
|
||||||
count(if(sfr.situation = 3, 1, null)) as `middleNum`,
|
count(if(t.situation = 3, 1, null)) as `middleNum`,
|
||||||
count(if(sfr.situation = 4, 1, null)) as `highNum`,
|
count(if(t.situation = 4, 1, null)) as `highNum`,
|
||||||
count(if(sfr.situation = 5, 1, null)) as `majorNum`
|
count(if(t.situation = 5, 1, null)) as `majorNum`
|
||||||
from sys_evaluation_conclusion ec
|
from (select MAX(ec.situation) as situation
|
||||||
left join sys_scale_factor_range sfr on sfr.range_id = ec.factor_range_id
|
from sys_evaluation_record er
|
||||||
left join sys_evaluation_record er on er.record_id = ec.record_id
|
left join sys_evaluation_conclusion ec
|
||||||
where ec.status = 1 and er.create_time >= #{startTime}
|
on ec.record_id = er.record_id and ec.status = 1
|
||||||
|
where er.status = 1
|
||||||
|
<if test="startTime != null">
|
||||||
|
and er.create_time >= #{startTime}
|
||||||
|
</if>
|
||||||
|
group by er.record_id) t
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectUserNum" resultType="int">
|
<select id="selectUserNum" resultType="int">
|
||||||
|
@ -97,7 +105,9 @@
|
||||||
from sys_dept parent
|
from sys_dept parent
|
||||||
left join sys_dept d on d.parent_id = parent.dept_id
|
left join sys_dept d on d.parent_id = parent.dept_id
|
||||||
left join sys_scale_publish sp on FIND_IN_SET(d.dept_id, sp.dept_ids)
|
left join sys_scale_publish sp on FIND_IN_SET(d.dept_id, sp.dept_ids)
|
||||||
<if test="startTime != null"> and sp.create_time >= #{startTime}</if>
|
<if test="startTime != null">
|
||||||
|
and sp.create_time >= #{startTime}
|
||||||
|
</if>
|
||||||
where parent.parent_id = 100
|
where parent.parent_id = 100
|
||||||
group by parent.dept_id
|
group by parent.dept_id
|
||||||
order by parent.order_num
|
order by parent.order_num
|
||||||
|
@ -107,8 +117,10 @@
|
||||||
select parent.dept_name as `name`, count(er.record_id) as 'value'
|
select parent.dept_name as `name`, count(er.record_id) as 'value'
|
||||||
from sys_dept parent
|
from sys_dept parent
|
||||||
left join sys_dept d on d.parent_id = parent.dept_id
|
left join sys_dept d on d.parent_id = parent.dept_id
|
||||||
left join sys_evaluation_record er on er.dept_id = d.dept_id
|
left join sys_evaluation_record er on er.dept_id = d.dept_id and er.status = 1
|
||||||
<if test="startTime != null"> and er.create_time >= #{startTime}</if>
|
<if test="startTime != null">
|
||||||
|
and er.create_time >= #{startTime}
|
||||||
|
</if>
|
||||||
where parent.parent_id = 100
|
where parent.parent_id = 100
|
||||||
group by parent.dept_id
|
group by parent.dept_id
|
||||||
order by parent.order_num
|
order by parent.order_num
|
||||||
|
@ -116,33 +128,33 @@
|
||||||
|
|
||||||
<select id="selectConclusion" resultType="org.dromara.scale.domain.vo.StatisticWarnVo">
|
<select id="selectConclusion" resultType="org.dromara.scale.domain.vo.StatisticWarnVo">
|
||||||
select parent.dept_name as `name`,
|
select parent.dept_name as `name`,
|
||||||
count(if(sfr.situation = 1, 1, null)) as `noneNum`,
|
count(if(t.situation = 1, 1, null)) as `noneNum`,
|
||||||
count(if(sfr.situation = 2, 1, null)) as `lowNum`,
|
count(if(t.situation = 2, 1, null)) as `lowNum`,
|
||||||
count(if(sfr.situation = 3, 1, null)) as `middleNum`,
|
count(if(t.situation = 3, 1, null)) as `middleNum`,
|
||||||
count(if(sfr.situation = 4, 1, null)) as `highNum`,
|
count(if(t.situation = 4, 1, null)) as `highNum`,
|
||||||
count(if(sfr.situation = 5, 1, null)) as `majorNum`
|
count(if(t.situation = 5, 1, null)) as `majorNum`
|
||||||
from sys_dept parent
|
from sys_dept parent
|
||||||
left join sys_dept d on d.parent_id = parent.dept_id
|
left join sys_dept d on d.parent_id = parent.dept_id
|
||||||
left join sys_evaluation_record er on er.dept_id = d.dept_id and er.status = 1
|
left join (select er.dept_id, MAX(ec.situation) as situation
|
||||||
|
from sys_evaluation_record er
|
||||||
|
left join sys_evaluation_conclusion ec
|
||||||
|
on ec.record_id = er.record_id and ec.status = 1
|
||||||
|
where er.status = 1
|
||||||
<if test="startTime != null">
|
<if test="startTime != null">
|
||||||
and er.create_time >= #{startTime}
|
and er.create_time >= #{startTime}
|
||||||
</if>
|
</if>
|
||||||
left join sys_evaluation_conclusion ec on ec.record_id = er.record_id and ec.status = 1
|
group by er.record_id) t on t.dept_id = d.dept_id
|
||||||
left join sys_scale_factor_range sfr on sfr.range_id = ec.factor_range_id
|
|
||||||
where parent.parent_id = 100
|
where parent.parent_id = 100
|
||||||
group by parent.dept_id
|
group by parent.dept_id
|
||||||
order by parent.order_num
|
order by parent.order_num
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectPublish" resultType="org.dromara.scale.domain.vo.StatisticPublishVo">
|
<select id="selectPublish" resultType="org.dromara.scale.domain.vo.StatisticPublishVo">
|
||||||
SELECT sp.session_name AS `sessionName`,
|
SELECT session_name AS `sessionName`,
|
||||||
count(IF(er.STATUS = 1, 1, NULL)) AS `value`,
|
complete_num AS `value`,
|
||||||
count(IF(er.STATUS = 1, 1, NULL)) + count(IF(er.STATUS = 0, 1, NULL)) AS `total`,
|
total_num AS `total`,
|
||||||
sp.expire_time as `expireTime`
|
expire_time as `expireTime`
|
||||||
FROM sys_scale_publish sp
|
FROM sys_scale_publish
|
||||||
LEFT JOIN sys_evaluation_record er ON er.batch_no = sp.batch_no
|
|
||||||
group by sp.batch_no
|
|
||||||
order by `expireTime` desc
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectWarnNumByYear" resultType="org.dromara.scale.domain.vo.StatisticNumVo">
|
<select id="selectWarnNumByYear" resultType="org.dromara.scale.domain.vo.StatisticNumVo">
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
s.scale_title,
|
s.scale_title,
|
||||||
s.cover,
|
s.cover,
|
||||||
s.questions_num,
|
s.questions_num,
|
||||||
|
s.scale_time,
|
||||||
o.url as `coverUrl`,
|
o.url as `coverUrl`,
|
||||||
if(er.status = 1, true, false) as `used`,
|
if(er.status = 1, true, false) as `used`,
|
||||||
er.record_id
|
er.record_id
|
||||||
|
@ -115,7 +116,7 @@
|
||||||
select count(*)
|
select count(*)
|
||||||
from sys_evaluation_record
|
from sys_evaluation_record
|
||||||
where batch_no = #{batchNo}
|
where batch_no = #{batchNo}
|
||||||
and user_id= #{userId}
|
and user_id = #{userId}
|
||||||
and status < 1
|
and status = -1
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -15,9 +15,11 @@
|
||||||
from sys_evaluation_record er
|
from sys_evaluation_record er
|
||||||
left join sys_scale s on s.scale_id = er.scale_id
|
left join sys_scale s on s.scale_id = er.scale_id
|
||||||
left join sys_dept d on d.dept_id = er.dept_id
|
left join sys_dept d on d.dept_id = er.dept_id
|
||||||
left join sys_user u on u.dept_id = d.dept_id
|
left join sys_user u on u.user_id = er.user_id
|
||||||
where er.batch_no = #{batchNo}
|
where er.batch_no = #{batchNo}
|
||||||
|
<if test="deptId != null">
|
||||||
and (FIND_IN_SET(#{deptId}, d.ancestors) OR d.dept_id = #{deptId})
|
and (FIND_IN_SET(#{deptId}, d.ancestors) OR d.dept_id = #{deptId})
|
||||||
|
</if>
|
||||||
<if test="scaleId != null">
|
<if test="scaleId != null">
|
||||||
and er.scale_id = #{scaleId}
|
and er.scale_id = #{scaleId}
|
||||||
</if>
|
</if>
|
||||||
|
@ -77,12 +79,13 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectSexNumByBatchNo" resultType="org.dromara.scale.domain.vo.StatisticNumVo">
|
<select id="selectSexNumByBatchNo" resultType="org.dromara.scale.domain.vo.StatisticNumVo">
|
||||||
select count(if(u.sex = '0', 1, null)) as `value`,
|
select count(if(t.sex = '0', 1, null)) as `value`,
|
||||||
count(if(u.sex = '1', 1, null)) as `spareValue`
|
count(if(t.sex = '1', 1, null)) as `spareValue`
|
||||||
|
from (select u.sex
|
||||||
from sys_evaluation_record er
|
from sys_evaluation_record er
|
||||||
left join sys_user u on u.user_id = er.user_id
|
left join sys_user u on u.user_id = er.user_id
|
||||||
where er.batch_no = #{batchNo}
|
where er.batch_no = 1793103701690454017
|
||||||
order by u.user_id
|
group by er.user_id) t
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectCountScalePublish" resultType="int">
|
<select id="selectCountScalePublish" resultType="int">
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue