优化主键生成;添加一些统计
This commit is contained in:
parent
31fec7c53d
commit
67976e017a
|
@ -93,12 +93,28 @@ public class StatisticController extends BaseController {
|
||||||
return R.ok(statisticService.getUserNum());
|
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")
|
@GetMapping("/intervene/num")
|
||||||
public R<Integer> getInterveneNum() {
|
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());
|
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();
|
StatisticWarnVo selectStatisticWarn4All();
|
||||||
|
|
||||||
int selectUserNum();
|
int selectUserNum();
|
||||||
|
int selectEvaluationNum();
|
||||||
|
int selectWarnNum();
|
||||||
int selectInterveneNum();
|
int selectInterveneNum();
|
||||||
|
|
||||||
List<StatisticNumVo> selectScalePublishNum();
|
List<StatisticNumVo> selectScalePublishNum();
|
||||||
|
List<StatisticNumVo> selectPublishNumByGrade();
|
||||||
|
List<StatisticNumVo> selectEvaluationNumByGrade();
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,10 +26,13 @@ public interface IStatisticService {
|
||||||
StatisticWarnVo getWarn4All();
|
StatisticWarnVo getWarn4All();
|
||||||
|
|
||||||
int getUserNum();
|
int getUserNum();
|
||||||
|
int getEvaluationNum();
|
||||||
|
int getWarnNum();
|
||||||
int getInterveneNum();
|
int getInterveneNum();
|
||||||
|
|
||||||
List<StatisticNumVo> getByMonth(BaseQueryBo query);
|
List<StatisticNumVo> getByMonth(BaseQueryBo query);
|
||||||
|
|
||||||
List<StatisticNumVo> getScalePublishNum();
|
List<StatisticNumVo> getScalePublishNum();
|
||||||
|
List<StatisticNumVo> getPublishAndEvaluationNumByGrade();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,6 +170,16 @@ public class StatisticServiceImpl implements IStatisticService {
|
||||||
return statisticMapper.selectUserNum();
|
return statisticMapper.selectUserNum();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getEvaluationNum() {
|
||||||
|
return statisticMapper.selectEvaluationNum();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getWarnNum() {
|
||||||
|
return statisticMapper.selectWarnNum();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getInterveneNum() {
|
public int getInterveneNum() {
|
||||||
return statisticMapper.selectInterveneNum();
|
return statisticMapper.selectInterveneNum();
|
||||||
|
@ -185,4 +195,18 @@ public class StatisticServiceImpl implements IStatisticService {
|
||||||
public List<StatisticNumVo> getScalePublishNum() {
|
public List<StatisticNumVo> getScalePublishNum() {
|
||||||
return statisticMapper.selectScalePublishNum();
|
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"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.dromara.scale.mapper.StatisticMapper">
|
<mapper namespace="org.dromara.scale.mapper.StatisticMapper">
|
||||||
|
|
||||||
<select id="selectCompleteAvaluation" resultType="org.dromara.scale.domain.vo.StatisticNumVo">
|
<select id="selectCompleteAvaluation" resultType="org.dromara.scale.domain.vo.StatisticNumVo">
|
||||||
select d.dept_name,
|
select d.dept_name,
|
||||||
parent.dept_name as `parentName`,
|
parent.dept_name as `parentName`,
|
||||||
|
@ -64,7 +63,20 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectUserNum" resultType="int">
|
<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>
|
||||||
|
|
||||||
<select id="selectInterveneNum" resultType="int">
|
<select id="selectInterveneNum" resultType="int">
|
||||||
|
@ -73,12 +85,28 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectScalePublishNum" resultType="org.dromara.scale.domain.vo.StatisticNumVo">
|
<select id="selectScalePublishNum" resultType="org.dromara.scale.domain.vo.StatisticNumVo">
|
||||||
select scale_name as `name`,
|
select scale_name as `name`,
|
||||||
publish_nums as `value`
|
publish_nums as `value`
|
||||||
from sys_scale
|
from sys_scale
|
||||||
where status = 1
|
where status = 1
|
||||||
order by publish_nums desc
|
order by publish_nums desc
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class SysClient extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* id
|
* id
|
||||||
*/
|
*/
|
||||||
@TableId(value = "id")
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.dromara.system.domain;
|
package org.dromara.system.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
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;
|
private Long configId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.dromara.system.domain;
|
package org.dromara.system.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
@ -26,7 +27,7 @@ public class SysDept extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 部门ID
|
* 部门ID
|
||||||
*/
|
*/
|
||||||
@TableId(value = "dept_id")
|
@TableId(value = "dept_id",type = IdType.AUTO)
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.dromara.system.domain;
|
package org.dromara.system.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
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;
|
private Long dictCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.dromara.system.domain;
|
package org.dromara.system.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
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;
|
private Long dictId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.dromara.system.domain;
|
package org.dromara.system.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -24,7 +25,7 @@ public class SysLogininfor implements Serializable {
|
||||||
/**
|
/**
|
||||||
* ID
|
* ID
|
||||||
*/
|
*/
|
||||||
@TableId(value = "info_id")
|
@TableId(value = "info_id",type = IdType.AUTO)
|
||||||
private Long infoId;
|
private Long infoId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.dromara.system.domain;
|
package org.dromara.system.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
@ -27,7 +28,7 @@ public class SysMenu extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 菜单ID
|
* 菜单ID
|
||||||
*/
|
*/
|
||||||
@TableId(value = "menu_id")
|
@TableId(value = "menu_id",type = IdType.AUTO)
|
||||||
private Long menuId;
|
private Long menuId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.dromara.system.domain;
|
package org.dromara.system.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -20,7 +21,7 @@ public class SysNotice extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 公告ID
|
* 公告ID
|
||||||
*/
|
*/
|
||||||
@TableId(value = "notice_id")
|
@TableId(value = "notice_id",type = IdType.AUTO)
|
||||||
private Long noticeId;
|
private Long noticeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.dromara.system.domain;
|
package org.dromara.system.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
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;
|
private Long operId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.dromara.system.domain;
|
package org.dromara.system.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
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;
|
private Long ossConfigId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.dromara.system.domain;
|
package org.dromara.system.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
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;
|
private Long postId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.dromara.system.domain;
|
package org.dromara.system.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
@ -23,7 +24,7 @@ public class SysRole extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 角色ID
|
* 角色ID
|
||||||
*/
|
*/
|
||||||
@TableId(value = "role_id")
|
@TableId(value = "role_id",type = IdType.AUTO)
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class SysUser extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 用户ID
|
||||||
*/
|
*/
|
||||||
@TableId(value = "user_id")
|
@TableId(value = "user_id",type = IdType.AUTO)
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue