添加听课统计功能
This commit is contained in:
parent
08016760da
commit
697fe4637b
|
@ -0,0 +1,238 @@
|
|||
package org.jeecg.modules.kc.tktj.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.kc.tktj.entity.KcTingke;
|
||||
import org.jeecg.modules.kc.tktj.service.IKcTingkeService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: kc_tingke
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-03-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="kc_tingke")
|
||||
@RestController
|
||||
@RequestMapping("/kcTingke/kcTingke")
|
||||
@Slf4j
|
||||
public class KcTingkeController extends JeecgController<KcTingke, IKcTingkeService> {
|
||||
@Autowired
|
||||
private IKcTingkeService kcTingkeService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param kcTingke
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "kc_tingke-分页列表查询")
|
||||
@ApiOperation(value="kc_tingke-分页列表查询", notes="kc_tingke-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<KcTingke>> queryPageList(KcTingke kcTingke,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<KcTingke> queryWrapper = QueryGenerator.initQueryWrapper(kcTingke, req.getParameterMap());
|
||||
queryWrapper.ge(StringUtils.isNotBlank(kcTingke.getStartTime()),"tk.skrq",kcTingke.getStartTime());
|
||||
queryWrapper.le(StringUtils.isNotBlank(kcTingke.getEndTime()),"tk.skrq",kcTingke.getEndTime()+" 23:59:59");
|
||||
|
||||
queryWrapper.eq(StringUtils.isNotBlank(kcTingke.getTksf()),"au.assesscode",kcTingke.getTksf());
|
||||
queryWrapper.eq(StringUtils.isNotBlank(kcTingke.getSzdw()),"tk.tkdw",kcTingke.getSzdw());
|
||||
queryWrapper.eq(StringUtils.isNotBlank(kcTingke.getKkdw()),"au.dwmc",kcTingke.getKkdw());
|
||||
queryWrapper.eq(StringUtils.isNotBlank(kcTingke.getKcxz()),"tk.kcxz",kcTingke.getKcxz());
|
||||
|
||||
Page<KcTingke> page = new Page<KcTingke>(pageNo, pageSize);
|
||||
IPage<KcTingke> pageList = kcTingkeService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param kcTingke
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "kc_tingke-添加")
|
||||
@ApiOperation(value="kc_tingke-添加", notes="kc_tingke-添加")
|
||||
@RequiresPermissions("kcTingke:kc_tingke:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody KcTingke kcTingke) {
|
||||
kcTingkeService.save(kcTingke);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param kcTingke
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "kc_tingke-编辑")
|
||||
@ApiOperation(value="kc_tingke-编辑", notes="kc_tingke-编辑")
|
||||
@RequiresPermissions("kcTingke:kc_tingke:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody KcTingke kcTingke) {
|
||||
kcTingkeService.updateById(kcTingke);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "kc_tingke-通过id删除")
|
||||
@ApiOperation(value="kc_tingke-通过id删除", notes="kc_tingke-通过id删除")
|
||||
@RequiresPermissions("kcTingke:kc_tingke:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
kcTingkeService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "kc_tingke-批量删除")
|
||||
@ApiOperation(value="kc_tingke-批量删除", notes="kc_tingke-批量删除")
|
||||
@RequiresPermissions("kcTingke:kc_tingke:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.kcTingkeService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "kc_tingke-通过id查询")
|
||||
@ApiOperation(value="kc_tingke-通过id查询", notes="kc_tingke-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<KcTingke> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
KcTingke kcTingke = kcTingkeService.getById(id);
|
||||
if(kcTingke==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(kcTingke);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param kcTingke
|
||||
*/
|
||||
@RequiresPermissions("kcTingke:kc_tingke:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, KcTingke kcTingke) {
|
||||
return super.exportXls(request, kcTingke, KcTingke.class, "kc_tingke");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("kcTingke:kc_tingke:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, KcTingke.class);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="kc_tingke-分页列表查询", notes="kc_tingke-分页列表查询")
|
||||
@GetMapping(value = "/getTkmxlist")
|
||||
public Result<IPage<KcTingke>> getTkmxlist(KcTingke kcTingke,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<KcTingke> queryWrapper = QueryGenerator.initQueryWrapper(kcTingke, req.getParameterMap());
|
||||
queryWrapper.ge(StringUtils.isNotBlank(kcTingke.getStartTime()),"tk.tingketime",kcTingke.getStartTime());
|
||||
queryWrapper.le(StringUtils.isNotBlank(kcTingke.getEndTime()),"tk.tingketime",kcTingke.getEndTime()+" 23:59:59");
|
||||
queryWrapper.like(StringUtils.isNotBlank(kcTingke.getJsxm()),"cn",kcTingke.getJsxm());
|
||||
queryWrapper.eq(StringUtils.isNotBlank(kcTingke.getSzdw()),"college",kcTingke.getSzdw());
|
||||
queryWrapper.eq(StringUtils.isNotBlank(kcTingke.getTksf()),"sf.assesscode",kcTingke.getTksf());
|
||||
|
||||
// AND ( cn LIKE '%jiaoshi%' )
|
||||
// AND c.college = '国际合作与交流处'
|
||||
// AND assesscode = '1101'
|
||||
// queryWrapper.eq(StringUtils.isNotBlank(kcTingke.getTksf()),"assesscode",kcTingke.getTksf());
|
||||
// queryWrapper.eq(StringUtils.isNotBlank(kcTingke.getSzdw()),"tkdw",kcTingke.getSzdw());
|
||||
// queryWrapper.eq(StringUtils.isNotBlank(kcTingke.getKkdw()),"dwmc",kcTingke.getKkdw());
|
||||
// queryWrapper.eq(StringUtils.isNotBlank(kcTingke.getKcxz()),"kcxz",kcTingke.getKcxz());
|
||||
|
||||
Page<KcTingke> page = new Page<KcTingke>(pageNo, pageSize);
|
||||
IPage<KcTingke> pageList = kcTingkeService.getTkmxlist(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/getKkdwlist")
|
||||
public Result<IPage<KcTingke>> getKkdwlist(KcTingke kcTingke,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Page<KcTingke> page = new Page<KcTingke>(pageNo, pageSize);
|
||||
if(StringUtils.isNotBlank(kcTingke.getEndTime())){
|
||||
kcTingke.setEndTime(kcTingke.getEndTime()+" 23:59:59");
|
||||
}
|
||||
IPage<KcTingke> pageList = kcTingkeService.getKkdwlist(page, kcTingke);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 听课周统计 echarts
|
||||
* @param kcTingke
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getTkztjList")
|
||||
public Result<List<KcTingke>> getTkztjList(KcTingke kcTingke) {
|
||||
List<KcTingke> pageList = kcTingkeService.getTkztjList(kcTingke);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 听课覆盖率统计 echarts
|
||||
* @param kcTingke
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getTkfglList")
|
||||
public Result<List<KcTingke>> getTkfglList(KcTingke kcTingke) {
|
||||
List<KcTingke> pageList = kcTingkeService.getTkfglList(kcTingke);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,172 @@
|
|||
package org.jeecg.modules.kc.tktj.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: kc_tingke
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-03-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("kc_tingke")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="kc_tingke对象", description="kc_tingke")
|
||||
public class KcTingke implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**听课时间*/
|
||||
@Excel(name = "听课时间", width = 15)
|
||||
@ApiModelProperty(value = "听课时间")
|
||||
private java.lang.String tingketime;
|
||||
/**检查时间*/
|
||||
@Excel(name = "检查时间", width = 15)
|
||||
@ApiModelProperty(value = "检查时间")
|
||||
private java.lang.String jianchatime;
|
||||
/**课程表id*/
|
||||
@Excel(name = "课程表id", width = 15)
|
||||
@ApiModelProperty(value = "课程表id")
|
||||
private java.lang.String kechengbiaoid;
|
||||
/**用户id*/
|
||||
@Excel(name = "用户id", width = 15)
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private java.lang.String userid;
|
||||
/**用户名*/
|
||||
@Excel(name = "用户名", width = 15)
|
||||
@ApiModelProperty(value = "用户名")
|
||||
private java.lang.String username;
|
||||
/**用户单位名称*/
|
||||
@Excel(name = "用户单位名称", width = 15)
|
||||
@ApiModelProperty(value = "用户单位名称")
|
||||
private java.lang.String userdwmc;
|
||||
/**usertksf1*/
|
||||
@Excel(name = "usertksf1", width = 15)
|
||||
@ApiModelProperty(value = "usertksf1")
|
||||
private java.lang.String usertksf1;
|
||||
/**usertksf2*/
|
||||
@Excel(name = "usertksf2", width = 15)
|
||||
@ApiModelProperty(value = "usertksf2")
|
||||
private java.lang.String usertksf2;
|
||||
/**usertksfcode*/
|
||||
@Excel(name = "usertksfcode", width = 15)
|
||||
@ApiModelProperty(value = "usertksfcode")
|
||||
private java.lang.String usertksfcode;
|
||||
/**usertkyq*/
|
||||
@Excel(name = "usertkyq", width = 15)
|
||||
@ApiModelProperty(value = "usertkyq")
|
||||
private java.lang.Integer usertkyq;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**创建时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private java.util.Date createTime;
|
||||
/**修改人*/
|
||||
@ApiModelProperty(value = "修改人")
|
||||
private java.lang.String updateBy;
|
||||
/**修改时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private java.util.Date updateTime;
|
||||
/**所属部门编码*/
|
||||
@ApiModelProperty(value = "所属部门编码")
|
||||
private java.lang.String sysOrgCode;
|
||||
|
||||
@TableField(exist = false)
|
||||
private java.lang.String tksf1;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String tkyq;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sjtksl;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String mltksl;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String tkdw;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String startTime;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String endTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private java.lang.String college;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String tksf;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String kkdw;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String kcmc;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String kcxz;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String skjs;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String zc;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String jc;
|
||||
|
||||
@TableField(exist = false)
|
||||
private java.lang.String kkdwid;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String kkkts;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String tkkts;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String tkrcs;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String pkrcs;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String pkkts;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String bdwpkrcs;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String bdwtkrcs;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String bdwtks;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String bdwpks;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String kssl;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String assesscode;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String dwjc;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String ljtkv;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String avgtkv;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String jrtkv;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String jravgtkv;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String xsid;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String skrq;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String szdw;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String jsxm;
|
||||
|
||||
// private java.lang.String tingketime;
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package org.jeecg.modules.kc.tktj.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.kc.tktj.entity.KcTingke;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: kc_tingke
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-03-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface KcTingkeMapper extends BaseMapper<KcTingke> {
|
||||
|
||||
IPage<KcTingke> getTkmxlist(Page<KcTingke> page,@Param(Constants.WRAPPER) QueryWrapper<KcTingke> queryWrapper);
|
||||
|
||||
IPage<KcTingke> getKkdwlist(Page<KcTingke> page, KcTingke kcTingke);
|
||||
|
||||
List<KcTingke> getTkztjList(KcTingke kcTingke);
|
||||
|
||||
List<KcTingke> getTkfglList(KcTingke kcTingke);
|
||||
}
|
|
@ -0,0 +1,340 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.kc.tktj.mapper.KcTingkeMapper">
|
||||
|
||||
<select id="selectPage" resultType="org.jeecg.modules.kc.tktj.entity.KcTingke">
|
||||
SELECT tk.userid, tk.username, tksf1, tkyq, sjtksl, mltksl, tkdw
|
||||
FROM ( SELECT tk.userid, tk.username, count( tk.id ) sjtksl,
|
||||
count( CASE WHEN kt.kkdw = '马列教研室' THEN 1 END ) mltksl,
|
||||
college AS tkdw , kt.skrq,kt.kcxz
|
||||
FROM kc_tingke tk, kc_ketangbiao kt, kc_casusers cu
|
||||
WHERE tk.kechengbiaoid = kt.id AND tk.userid = cu.`user` AND tk.tingketime > 1
|
||||
GROUP BY tk.userid, tk.username, college
|
||||
) tk LEFT JOIN (
|
||||
SELECT usercode, username, GROUP_CONCAT( assess1 SEPARATOR ',' ) tksf1, GROUP_CONCAT( assess2 SEPARATOR ',' ) tksf2, max( tkyq ) tkyq,assesscode,dwmc
|
||||
FROM kc_assessuser
|
||||
WHERE 1 = 1
|
||||
GROUP BY usercode, username
|
||||
) au ON tk.userid = au.usercode
|
||||
${ew.customSqlSegment}
|
||||
|
||||
ORDER BY
|
||||
sjtksl DESC
|
||||
</select>
|
||||
|
||||
<select id="getTkmxlist" resultType="org.jeecg.modules.kc.tktj.entity.KcTingke">
|
||||
SELECT tk.id, tk.user as userid, tk.cn as username, tk.college, sf.assess1 as tksf , tk.kkdw, tk.kcmc, tk.kcxz, tk.skjs, tk.week as zc, tk.hh as jc, tk.tingketime
|
||||
FROM
|
||||
( SELECT k.*, t.tingketime, c.USER, c.college, c.cn
|
||||
FROM kc_ketangbiao k, kc_tingke t, kc_casusers c
|
||||
WHERE k.id = t.kechengbiaoid AND t.userid = c.USER
|
||||
) tk
|
||||
LEFT JOIN kc_assessuser sf ON tk.USER = sf.usercode
|
||||
|
||||
${ew.customSqlSegment}
|
||||
ORDER BY
|
||||
tingketime DESC
|
||||
</select>
|
||||
|
||||
<select id="getKkdwlist" parameterType="org.jeecg.modules.kc.tktj.entity.KcTingke" resultType="org.jeecg.modules.kc.tktj.entity.KcTingke">
|
||||
SELECT
|
||||
tk.kkdw,
|
||||
tk.kkdwid,
|
||||
IFNULL( kkkts, 0 ) kkkts,
|
||||
IFNULL( tkkts, 0 ) tkkts,
|
||||
IFNULL( tkrcs, 0 ) tkrcs,
|
||||
IFNULL( pkrcs, 0 ) pkrcs,
|
||||
IFNULL( pkkts, 0 ) pkkts,
|
||||
IFNULL( bdwpkrcs, 0 ) bdwpkrcs,
|
||||
IFNULL( bdwtkrcs, 0 ) bdwtkrcs,
|
||||
IFNULL( bdwtks, 0 ) bdwtks,
|
||||
ifnull( bdwpks, 0 ) bdwpks
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
kt.kkdw,
|
||||
kt.kkdwid,
|
||||
kkkts,
|
||||
tkkts,
|
||||
tkrcs,
|
||||
bdwtks,
|
||||
bdwtkrcs
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
kt.kkdw,
|
||||
kt.kkdwid,
|
||||
count( kt.id ) kkkts
|
||||
FROM
|
||||
kc_ketangbiao kt
|
||||
<where>
|
||||
<if test="kcTingke.startTime != null and kcTingke.startTime != ''">
|
||||
and kt.skrq >= #{kcTingke.startTime}
|
||||
</if>
|
||||
<if test="kcTingke.endTime != null and kcTingke.endTime != ''">
|
||||
and kt.skrq <= #{kcTingke.endTime}
|
||||
</if>
|
||||
<if test="kcTingke.szdw != null and kcTingke.szdw != ''">
|
||||
AND kkdw = #{kcTingke.szdw}
|
||||
</if>
|
||||
<if test="kcTingke.kkdw != null and kcTingke.kkdw != ''">
|
||||
AND kkdw = #{kcTingke.kkdw}
|
||||
</if>
|
||||
<if test="kcTingke.kcxz != null and kcTingke.kcxz != ''">
|
||||
AND kcxz = #{kcTingke.kcxz}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
kt.kkdw,
|
||||
kt.kkdwid
|
||||
) kt
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
tk.kkdwid,
|
||||
tkrcs,
|
||||
tkkts,
|
||||
IFNULL( bdwtkrcs, 0 ) - IFNULL( bdwdxtkrcs, 0 ) bdwtkrcs,
|
||||
IFNULL( bdwtks, 0 ) - IFNULL( bdwdxtkkts, 0 ) bdwtks
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
kt.kkdwid,
|
||||
count( DISTINCT CASE WHEN tk.tingketime > 0 THEN kt.id END ) tkkts,
|
||||
count( CASE WHEN tk.tingketime > 0 THEN kt.id END ) tkrcs,
|
||||
count( DISTINCT CASE WHEN cu.college = kt.kkdw THEN kt.id END ) bdwtks,
|
||||
count( DISTINCT CASE WHEN cu.college = kt.kkdw THEN tk.id END ) bdwtkrcs
|
||||
FROM
|
||||
kc_ketangbiao kt,
|
||||
kc_tingke tk,
|
||||
kc_casusers cu
|
||||
WHERE
|
||||
kt.id = tk.kechengbiaoid
|
||||
AND tk.userid = cu.USER
|
||||
<if test="kcTingke.startTime != null and kcTingke.startTime != ''">
|
||||
and kt.skrq >= #{kcTingke.startTime}
|
||||
</if>
|
||||
<if test="kcTingke.endTime != null and kcTingke.endTime != ''">
|
||||
and kt.skrq <= #{kcTingke.endTime}
|
||||
</if>
|
||||
<if test="kcTingke.szdw != null and kcTingke.szdw != ''">
|
||||
AND kkdw = #{kcTingke.szdw}
|
||||
</if>
|
||||
<if test="kcTingke.kkdw != null and kcTingke.kkdw != ''">
|
||||
AND kkdw = #{kcTingke.kkdw}
|
||||
</if>
|
||||
<if test="kcTingke.kcxz != null and kcTingke.kcxz != ''">
|
||||
AND kcxz = #{kcTingke.kcxz}
|
||||
</if>
|
||||
GROUP BY
|
||||
kt.kkdwid
|
||||
) tk
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
kkdwid,
|
||||
kkdw,
|
||||
count( DISTINCT kt.id ) bdwdxtkkts,
|
||||
count( DISTINCT tk.id ) bdwdxtkrcs
|
||||
FROM
|
||||
kc_ketangbiao kt,
|
||||
kc_tingke tk,
|
||||
kc_assessuser au
|
||||
WHERE
|
||||
kt.kkdw = au.dwmc
|
||||
AND kt.id = tk.kechengbiaoid
|
||||
AND tk.userid = au.usercode
|
||||
AND assess2 = '校督学'
|
||||
<if test="kcTingke.startTime != null and kcTingke.startTime != ''">
|
||||
and kt.skrq >= #{kcTingke.startTime}
|
||||
</if>
|
||||
<if test="kcTingke.endTime != null and kcTingke.endTime != ''">
|
||||
and kt.skrq <= #{kcTingke.endTime}
|
||||
</if>
|
||||
<if test="kcTingke.tksf != null and kcTingke.tksf != ''">
|
||||
AND assess2 = #{kcTingke.tksf}
|
||||
</if>
|
||||
<if test="kcTingke.szdw != null and kcTingke.szdw != ''">
|
||||
AND kkdw = #{kcTingke.szdw}
|
||||
</if>
|
||||
<if test="kcTingke.kkdw != null and kcTingke.kkdw != ''">
|
||||
AND kkdw = #{kcTingke.kkdw}
|
||||
</if>
|
||||
<if test="kcTingke.kcxz != null and kcTingke.kcxz != ''">
|
||||
AND kcxz = #{kcTingke.kcxz}
|
||||
</if>
|
||||
GROUP BY
|
||||
kkdwid,
|
||||
kkdw
|
||||
) bdw ON tk.kkdwid = bdw.kkdwid
|
||||
) tk ON kt.kkdwid = tk.kkdwid
|
||||
) tk
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
ev.kkdwid,
|
||||
pkrcs,
|
||||
pkkts,
|
||||
IFNULL( bdwpkrcs, 0 ) - IFNULL( bdwdxpkrcs, 0 ) bdwpkrcs,
|
||||
IFNULL( bdwpks, 0 ) - IFNULL( bdwdxpkkts, 0 ) bdwpks
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
kt.kkdwid,
|
||||
count( ev.id ) pkrcs,
|
||||
count( DISTINCT kt.id ) pkkts,
|
||||
count( DISTINCT CASE WHEN cu.college = kt.kkdw THEN ev.id END ) bdwpkrcs,
|
||||
count( DISTINCT CASE WHEN cu.college = kt.kkdw THEN kt.id END ) bdwpks
|
||||
FROM
|
||||
kc_ketangbiao kt,
|
||||
kc_evaluation ev,
|
||||
kc_casusers cu
|
||||
WHERE
|
||||
kt.id = ev.minkcid
|
||||
AND ev.upuserid = cu.USER
|
||||
<if test="kcTingke.startTime != null and kcTingke.startTime != ''">
|
||||
and kt.skrq >= #{kcTingke.startTime}
|
||||
</if>
|
||||
<if test="kcTingke.endTime != null and kcTingke.endTime != ''">
|
||||
and kt.skrq <= #{kcTingke.endTime}
|
||||
</if>
|
||||
<if test="kcTingke.szdw != null and kcTingke.szdw != ''">
|
||||
AND kkdw = #{kcTingke.szdw}
|
||||
</if>
|
||||
<if test="kcTingke.kkdw != null and kcTingke.kkdw != ''">
|
||||
AND kkdw = #{kcTingke.kkdw}
|
||||
</if>
|
||||
<if test="kcTingke.kcxz != null and kcTingke.kcxz != ''">
|
||||
AND kcxz = #{kcTingke.kcxz}
|
||||
</if>
|
||||
GROUP BY
|
||||
kt.kkdwid
|
||||
) ev
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
kkdwid,
|
||||
kkdw,
|
||||
count( DISTINCT kt.id ) bdwdxpkkts,
|
||||
count( DISTINCT ev.id ) bdwdxpkrcs
|
||||
FROM
|
||||
kc_ketangbiao kt,
|
||||
kc_evaluation ev,
|
||||
kc_assessuser au
|
||||
WHERE
|
||||
kt.kkdw = au.dwmc
|
||||
AND kt.id = ev.minkcid
|
||||
AND ev.upuserid = au.usercode
|
||||
<if test="kcTingke.startTime != null and kcTingke.startTime != ''">
|
||||
and kt.skrq >= #{kcTingke.startTime}
|
||||
</if>
|
||||
<if test="kcTingke.endTime != null and kcTingke.endTime != ''">
|
||||
and kt.skrq <= #{kcTingke.endTime}
|
||||
</if>
|
||||
<if test="kcTingke.tksf != null and kcTingke.tksf != ''">
|
||||
AND assess2 = #{kcTingke.tksf}
|
||||
</if>
|
||||
<if test="kcTingke.szdw != null and kcTingke.szdw != ''">
|
||||
AND kkdw = #{kcTingke.szdw}
|
||||
</if>
|
||||
<if test="kcTingke.kkdw != null and kcTingke.kkdw != ''">
|
||||
AND kkdw = #{kcTingke.kkdw}
|
||||
</if>
|
||||
<if test="kcTingke.kcxz != null and kcTingke.kcxz != ''">
|
||||
AND kcxz = #{kcTingke.kcxz}
|
||||
</if>
|
||||
GROUP BY
|
||||
kkdwid,
|
||||
kkdw
|
||||
) bdw ON ev.kkdwid = bdw.kkdwid
|
||||
) ev ON tk.kkdwid = ev.kkdwid
|
||||
ORDER BY
|
||||
tk.kkdwid
|
||||
</select>
|
||||
|
||||
<select id="getTkztjList" resultType="org.jeecg.modules.kc.tktj.entity.KcTingke">
|
||||
SELECT t2.skrq, t2.kssl, ifnull( t1.tkkts, 0 ) tkkts, ifnull( t1.tkrcs, 0 ) tkrcs
|
||||
FROM
|
||||
( SELECT count( id ) kssl, skrq FROM kc_ketangbiao kt
|
||||
<where>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
and skrq >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
and skrq <= #{endTime}
|
||||
</if>
|
||||
<if test="kcxz != null and kcxz != ''">
|
||||
and kcxz = #{kcxz}
|
||||
</if>
|
||||
<if test="kkdw != null and kkdw != ''">
|
||||
and kt.kkdw = #{kkdw}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY skrq ) t2 LEFT JOIN ( SELECT
|
||||
skrq, count( DISTINCT CASE WHEN tk.tingketime > 0 THEN kt.id END ) tkkts, sum( CASE WHEN tingketime > 0 THEN 1 END ) + 0 tkrcs
|
||||
FROM kc_ketangbiao kt, kc_kkdw dw, kc_tingke tk, kc_assessuser au, kc_casusers cu
|
||||
WHERE kt.kkdw = dw.kkdw AND au.usercode = tk.userid AND kt.id = tk.kechengbiaoid AND tk.userid = cu.USER
|
||||
<if test="startTime != null and startTime != ''">
|
||||
and skrq >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
and skrq <= #{endTime}
|
||||
</if>
|
||||
<if test="tksf != null and tksf != ''">
|
||||
AND assesscode = #{tksf}
|
||||
</if>
|
||||
<if test="kcxz != null and kcxz != ''">
|
||||
and kcxz = #{kcxz}
|
||||
</if>
|
||||
<if test="kkdw != null and kkdw != ''">
|
||||
and kt.kkdw = #{kkdw}
|
||||
</if>
|
||||
<if test="szdw != null and szdw != ''">
|
||||
and cu.college = #{szdw}
|
||||
</if>
|
||||
|
||||
GROUP BY skrq ) t1 ON t2.skrq = t1.skrq ORDER BY t2.skrq
|
||||
</select>
|
||||
|
||||
<select id="getTkfglList" resultType="org.jeecg.modules.kc.tktj.entity.KcTingke">
|
||||
SELECT xsmc AS dwjc, ifnull( ljtkv, 0 ) ljtkv, ifnull( avgtkv, 0 ) avgtkv, ifnull( jrtkv, 0 ) jrtkv, ifnull( jravgtkv, 0 ) jravgtkv, xsid
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
dw.xsmc,
|
||||
format( count( CASE WHEN tingkecishu > 0 THEN 1 END )/ count( kt.id )* 100, 2 ) AS ljtkv,
|
||||
format(
|
||||
count( CASE WHEN tingkecishu > 0 AND skrq = #{endTime} THEN 1 END )/ count( CASE WHEN skrq = #{endTime} THEN kt.id END )* 100,
|
||||
2
|
||||
) AS jrtkv,
|
||||
dw.xsid
|
||||
FROM
|
||||
kc_ketangbiao kt,
|
||||
kc_kkdw dw
|
||||
WHERE
|
||||
kt.kkdw = dw.kkdw
|
||||
AND skrq >= #{startTime}
|
||||
and skrq <= #{endTime}
|
||||
<if test="kcxz != null and kcxz != ''">
|
||||
AND kcxz = #{kcxz}
|
||||
</if>
|
||||
GROUP BY
|
||||
dw.xsmc,
|
||||
dw.xsid
|
||||
ORDER BY
|
||||
dw.xsid
|
||||
) t1,
|
||||
(
|
||||
SELECT
|
||||
format( count( CASE WHEN tingkecishu > 0 THEN 1 END )/ count( kt.id )* 100, 2 ) AS avgtkv,
|
||||
format(
|
||||
count( CASE WHEN tingkecishu > 0 AND skrq = #{endTime} THEN 1 END )/ count( CASE WHEN skrq = #{endTime} THEN 1 END )* 100,
|
||||
2
|
||||
) AS jravgtkv
|
||||
FROM
|
||||
kc_ketangbiao kt
|
||||
WHERE
|
||||
skrq >= #{startTime}
|
||||
and skrq <= #{endTime}
|
||||
<if test="kcxz != null and kcxz != ''">
|
||||
AND kcxz = #{kcxz}
|
||||
</if>
|
||||
) t2
|
||||
</select>
|
||||
</mapper>
|
|
@ -0,0 +1,26 @@
|
|||
package org.jeecg.modules.kc.tktj.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.jeecg.modules.kc.tktj.entity.KcTingke;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: kc_tingke
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-03-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IKcTingkeService extends IService<KcTingke> {
|
||||
|
||||
IPage<KcTingke> getTkmxlist(Page<KcTingke> page, QueryWrapper<KcTingke> queryWrapper);
|
||||
|
||||
IPage<KcTingke> getKkdwlist(Page<KcTingke> page, KcTingke kcTingke);
|
||||
|
||||
List<KcTingke> getTkztjList(KcTingke kcTingke);
|
||||
|
||||
List<KcTingke> getTkfglList(KcTingke kcTingke);
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package org.jeecg.modules.kc.tktj.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.jeecg.modules.kc.tktj.entity.KcTingke;
|
||||
import org.jeecg.modules.kc.tktj.mapper.KcTingkeMapper;
|
||||
import org.jeecg.modules.kc.tktj.service.IKcTingkeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: kc_tingke
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-03-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class KcTingkeServiceImpl extends ServiceImpl<KcTingkeMapper, KcTingke> implements IKcTingkeService {
|
||||
|
||||
@Override
|
||||
public IPage<KcTingke> getTkmxlist(Page<KcTingke> page, QueryWrapper<KcTingke> queryWrapper) {
|
||||
return baseMapper.getTkmxlist(page,queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<KcTingke> getKkdwlist(Page<KcTingke> page, KcTingke kcTingke) {
|
||||
return baseMapper.getKkdwlist(page,kcTingke);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KcTingke> getTkztjList(KcTingke kcTingke) {
|
||||
return baseMapper.getTkztjList(kcTingke);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KcTingke> getTkfglList(KcTingke kcTingke) {
|
||||
return baseMapper.getTkfglList(kcTingke);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue