优化主键生成;添加一些统计
This commit is contained in:
parent
31fec7c53d
commit
67976e017a
|
@ -93,12 +93,28 @@ public class StatisticController extends BaseController {
|
|||
return R.ok(statisticService.getUserNum());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取总测评数
|
||||
*/
|
||||
@GetMapping("/evaluation/num")
|
||||
public R<Integer> getEvaluationNum() {
|
||||
return R.ok(statisticService.getEvaluationNum());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取总预警数
|
||||
*/
|
||||
@GetMapping("/warn/num")
|
||||
public R<Integer> getWarnNum() {
|
||||
return R.ok(statisticService.getWarnNum());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取总干预数
|
||||
*/
|
||||
@GetMapping("/intervene/num")
|
||||
public R<Integer> getInterveneNum() {
|
||||
return R.ok(statisticService.getUserNum());
|
||||
return R.ok(statisticService.getInterveneNum());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -109,5 +125,11 @@ public class StatisticController extends BaseController {
|
|||
return R.ok(statisticService.getScalePublishNum());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取年级统计,包含年纪下发布次数和测评次数
|
||||
*/
|
||||
@GetMapping("/grade/publish-evaluation")
|
||||
public R<List<StatisticNumVo>> getGrade() {
|
||||
return R.ok(statisticService.getPublishAndEvaluationNumByGrade());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,11 @@ public interface StatisticMapper {
|
|||
StatisticWarnVo selectStatisticWarn4All();
|
||||
|
||||
int selectUserNum();
|
||||
int selectEvaluationNum();
|
||||
int selectWarnNum();
|
||||
int selectInterveneNum();
|
||||
|
||||
List<StatisticNumVo> selectScalePublishNum();
|
||||
List<StatisticNumVo> selectPublishNumByGrade();
|
||||
List<StatisticNumVo> selectEvaluationNumByGrade();
|
||||
}
|
||||
|
|
|
@ -26,10 +26,13 @@ public interface IStatisticService {
|
|||
StatisticWarnVo getWarn4All();
|
||||
|
||||
int getUserNum();
|
||||
|
||||
int getEvaluationNum();
|
||||
int getWarnNum();
|
||||
int getInterveneNum();
|
||||
|
||||
List<StatisticNumVo> getByMonth(BaseQueryBo query);
|
||||
|
||||
List<StatisticNumVo> getScalePublishNum();
|
||||
List<StatisticNumVo> getPublishAndEvaluationNumByGrade();
|
||||
|
||||
}
|
||||
|
|
|
@ -170,6 +170,16 @@ public class StatisticServiceImpl implements IStatisticService {
|
|||
return statisticMapper.selectUserNum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEvaluationNum() {
|
||||
return statisticMapper.selectEvaluationNum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarnNum() {
|
||||
return statisticMapper.selectWarnNum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInterveneNum() {
|
||||
return statisticMapper.selectInterveneNum();
|
||||
|
@ -185,4 +195,18 @@ public class StatisticServiceImpl implements IStatisticService {
|
|||
public List<StatisticNumVo> getScalePublishNum() {
|
||||
return statisticMapper.selectScalePublishNum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StatisticNumVo> getPublishAndEvaluationNumByGrade() {
|
||||
List<StatisticNumVo> publishNum = statisticMapper.selectPublishNumByGrade();
|
||||
List<StatisticNumVo> evaluationNum = statisticMapper.selectEvaluationNumByGrade();
|
||||
for (StatisticNumVo publish : publishNum) {
|
||||
for (StatisticNumVo evaluation : evaluationNum) {
|
||||
if(publish.getName().equals(evaluation.getName())){
|
||||
publish.setSpareValue(evaluation.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
return publishNum;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.scale.mapper.StatisticMapper">
|
||||
|
||||
<select id="selectCompleteAvaluation" resultType="org.dromara.scale.domain.vo.StatisticNumVo">
|
||||
select d.dept_name,
|
||||
parent.dept_name as `parentName`,
|
||||
|
@ -64,7 +63,20 @@
|
|||
</select>
|
||||
|
||||
<select id="selectUserNum" resultType="int">
|
||||
select count(*) from sys_user where status = 1
|
||||
select count(*)
|
||||
from sys_user
|
||||
where del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="selectEvaluationNum" resultType="int">
|
||||
select count(*)
|
||||
from sys_evaluation_record
|
||||
where status = 1
|
||||
</select>
|
||||
|
||||
<select id="selectWarnNum" resultType="int">
|
||||
select count(*)
|
||||
from sys_warn_record
|
||||
</select>
|
||||
|
||||
<select id="selectInterveneNum" resultType="int">
|
||||
|
@ -80,5 +92,21 @@
|
|||
order by publish_nums desc
|
||||
</select>
|
||||
|
||||
<select id="selectPublishNumByGrade" resultType="org.dromara.scale.domain.vo.StatisticNumVo">
|
||||
select parent.dept_name as `name`, count(sp.batch_no) as 'value'
|
||||
from sys_dept parent
|
||||
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)
|
||||
where parent.parent_id = 100
|
||||
group by parent.dept_id
|
||||
</select>
|
||||
|
||||
<select id="selectEvaluationNumByGrade" resultType="org.dromara.scale.domain.vo.StatisticNumVo">
|
||||
select parent.dept_name as `name`, count(er.record_id) as 'value'
|
||||
from sys_dept parent
|
||||
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
|
||||
where parent.parent_id = 100
|
||||
group by parent.dept_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -24,7 +24,7 @@ public class SysClient extends BaseEntity {
|
|||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.dromara.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
@ -20,7 +21,7 @@ public class SysConfig extends BaseEntity {
|
|||
/**
|
||||
* 参数主键
|
||||
*/
|
||||
@TableId(value = "config_id")
|
||||
@TableId(value = "config_id",type = IdType.AUTO)
|
||||
private Long configId;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.dromara.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
@ -26,7 +27,7 @@ public class SysDept extends BaseEntity {
|
|||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@TableId(value = "dept_id")
|
||||
@TableId(value = "dept_id",type = IdType.AUTO)
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.dromara.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
@ -21,7 +22,7 @@ public class SysDictData extends BaseEntity {
|
|||
/**
|
||||
* 字典编码
|
||||
*/
|
||||
@TableId(value = "dict_code")
|
||||
@TableId(value = "dict_code",type = IdType.AUTO)
|
||||
private Long dictCode;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.dromara.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
@ -20,7 +21,7 @@ public class SysDictType extends BaseEntity {
|
|||
/**
|
||||
* 字典主键
|
||||
*/
|
||||
@TableId(value = "dict_id")
|
||||
@TableId(value = "dict_id",type = IdType.AUTO)
|
||||
private Long dictId;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.dromara.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
@ -24,7 +25,7 @@ public class SysLogininfor implements Serializable {
|
|||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "info_id")
|
||||
@TableId(value = "info_id",type = IdType.AUTO)
|
||||
private Long infoId;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.dromara.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
@ -27,7 +28,7 @@ public class SysMenu extends BaseEntity {
|
|||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
@TableId(value = "menu_id")
|
||||
@TableId(value = "menu_id",type = IdType.AUTO)
|
||||
private Long menuId;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.dromara.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
@ -20,7 +21,7 @@ public class SysNotice extends BaseEntity {
|
|||
/**
|
||||
* 公告ID
|
||||
*/
|
||||
@TableId(value = "notice_id")
|
||||
@TableId(value = "notice_id",type = IdType.AUTO)
|
||||
private Long noticeId;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.dromara.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
@ -24,7 +25,7 @@ public class SysOperLog implements Serializable {
|
|||
/**
|
||||
* 日志主键
|
||||
*/
|
||||
@TableId(value = "oper_id")
|
||||
@TableId(value = "oper_id",type = IdType.AUTO)
|
||||
private Long operId;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.dromara.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
@ -19,7 +20,7 @@ public class SysOssConfig extends BaseEntity {
|
|||
/**
|
||||
* 主建
|
||||
*/
|
||||
@TableId(value = "oss_config_id")
|
||||
@TableId(value = "oss_config_id",type = IdType.AUTO)
|
||||
private Long ossConfigId;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.dromara.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
@ -20,7 +21,7 @@ public class SysPost extends BaseEntity {
|
|||
/**
|
||||
* 岗位序号
|
||||
*/
|
||||
@TableId(value = "post_id")
|
||||
@TableId(value = "post_id",type = IdType.AUTO)
|
||||
private Long postId;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.dromara.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
@ -23,7 +24,7 @@ public class SysRole extends BaseEntity {
|
|||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@TableId(value = "role_id")
|
||||
@TableId(value = "role_id",type = IdType.AUTO)
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
|
|
|
@ -24,7 +24,7 @@ public class SysUser extends BaseEntity {
|
|||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@TableId(value = "user_id")
|
||||
@TableId(value = "user_id",type = IdType.AUTO)
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue