培训统计数据

pg_adapter
20918 8 months ago
parent 8fea070430
commit 7d323d2fc8

@ -11,6 +11,7 @@ import com.ruoyi.system.domain.TdTrain;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.system.service.ITdTrainService;
import com.ruoyi.web.controller.manager.SysAreaManager;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -94,4 +95,11 @@ public class SysTrainnumController extends BaseController {
return prefix + "/detail";
}
@ApiOperation("培训统计数据")
@PostMapping("/countList")
@ResponseBody
public AjaxResult countList() {
return AjaxResult.success(tdTrainService.selectCountList());
}
}

@ -0,0 +1,24 @@
package com.ruoyi.system.domain.count;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel(value="培训统计", description="培训统计")
public class TrainCountDTO implements Serializable {
@ApiModelProperty(value = "总数")
private Integer total;
@ApiModelProperty(value = "待审核")
private Integer dsh;
@ApiModelProperty(value = "审核通过")
private Integer shtg;
@ApiModelProperty(value = "审核未通过")
private Integer shwtg;
}

@ -4,6 +4,8 @@ import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.TdTrain;
import com.ruoyi.system.domain.count.TrainCountDTO;
import com.ruoyi.system.domain.userexam.dto.response.UserExamCountDTO;
/**
* Mapper
@ -60,4 +62,6 @@ public interface TdTrainMapper extends BaseMapper<TdTrain>
* @return
*/
public int deleteTdTrainByIDs(String[] IDs);
public TrainCountDTO selectCountList();
}

@ -4,6 +4,8 @@ import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.system.domain.TdTrain;
import com.ruoyi.system.domain.count.TrainCountDTO;
import com.ruoyi.system.domain.userexam.dto.response.UserExamCountDTO;
/**
* Service
@ -61,4 +63,10 @@ public interface ITdTrainService extends IService<TdTrain>
*/
public int deleteTdTrainByID(Long ID);
/**
*
* @return
*/
public TrainCountDTO selectCountList();
}

@ -8,6 +8,7 @@ import java.util.function.Function;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.count.TrainCountDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TdTrainMapper;
@ -98,7 +99,10 @@ public class TdTrainServiceImpl extends ServiceImpl<TdTrainMapper,TdTrain> imple
{
return tdTrainMapper.deleteTdTrainByID(ID);
}
@Override
public TrainCountDTO selectCountList() {
return tdTrainMapper.selectCountList();
}
@Override
public boolean saveBatch(Collection<TdTrain> entityList, int batchSize) {

@ -145,4 +145,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<select id="selectCountList" resultType="com.ruoyi.system.domain.count.TrainCountDTO">
SELECT
count(1) as total,
SUM (CASE WHEN TRAIN_STATE = 2 THEN 1 ELSE 0 END) AS dsh,
SUM (CASE WHEN TRAIN_STATE = 0 THEN 1 ELSE 0 END) AS shtg,
SUM (CASE WHEN TRAIN_STATE = 1 THEN 1 ELSE 0 END) AS shwtg
from td_train
</select>
</mapper>
Loading…
Cancel
Save