教培定时器

dev
zhangyanli 2024-03-26 08:38:04 +08:00
parent 577643bec6
commit f06f50a620
3 changed files with 193 additions and 8 deletions

View File

@ -0,0 +1,24 @@
package com.zcloud.mapper.datasource.task;
import com.zcloud.entity.PageData;
import java.util.List;
/**
* 线-
* luoxiaobao
* 2021-12-20
* www.zcloudchina.com
*/
public interface StudyTaskMapper {
/**
* @param pd
* @throws Exception
*/
List<PageData> getDeptExamine(PageData pd);
List<PageData> getUserExamine(PageData pd);
}

View File

@ -0,0 +1,169 @@
<?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="com.zcloud.mapper.datasource.task.StudyTaskMapper">
<!--表名 -->
<sql id="tableName">
BUS_STUDYTASK
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.STUDY_NAME,
f.TRAINTYPE,
f.POSTTYPE,
f.PEIXUE_START_TIME,
f.PEIXUE_END_TIME,
f.KJ_STATE,
f.GJ_STATE,
f.STAGEEXAMPAPER_ID,
f.STUDY_USER_ID,
f.STUDY_CURRICULUM_ID,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE,
f.CORPINFO_ID,
f.STATE,
f.COURSEWARE_COUNT,
f.SUM_CLASSHOUR,
f.STUDYTASK_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
STUDY_NAME,
TRAINTYPE,
POSTTYPE,
PEIXUE_START_TIME,
PEIXUE_END_TIME,
KJ_STATE,
GJ_STATE,
STAGEEXAMPAPER_ID,
STUDY_USER_ID,
STUDY_CURRICULUM_ID,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
ISDELETE,
CORPINFO_ID,
STATE,
COURSEWARE_COUNT,
SUM_CLASSHOUR,
STUDYTASK_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{STUDY_NAME},
#{TRAINTYPE},
#{POSTTYPE},
#{PEIXUE_START_TIME},
#{PEIXUE_END_TIME},
#{KJ_STATE},
#{GJ_STATE},
#{STAGEEXAMPAPER_ID},
#{STUDY_USER_ID},
#{STUDY_CURRICULUM_ID},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{ISDELETE},
#{CORPINFO_ID},
#{STATE},
#{COURSEWARE_COUNT},
#{SUM_CLASSHOUR},
#{STUDYTASK_ID}
</sql>
<!-- 绩效得分 -->
<select id="getDeptExamine" parameterType="pd" resultType="pd" >
SELECT
d.DEPARTMENT_ID,
ifnull(un.user_count,0) as user_count,
ifnull(st.NUM,0) as st_count
FROM
OA_DEPARTMENT d
LEFT JOIN (
SELECT
count( distinct f.USER_ID) NUM,
u.DEPARTMENT_ID
FROM
bus_stagestudentrelation f
LEFT JOIN BUS_STUDYTASK t ON t.STUDYTASK_ID = f.STUDYTASK_ID
LEFT JOIN SYS_USER u ON u.USER_ID = f.USER_ID
WHERE
(
t.PEIXUE_START_TIME BETWEEN #{STARTTIME} and #{ENDTIME}
or
t.PEIXUE_END_TIME BETWEEN #{STARTTIME} and #{ENDTIME}
or
(t.PEIXUE_START_TIME &lt;= #{STARTTIME} and t.PEIXUE_END_TIME &gt;= #{ENDTIME})
)
group by u.DEPARTMENT_ID
) st on st.DEPARTMENT_ID=d.DEPARTMENT_ID
LEFT JOIN
( SELECT count( 1 ) as user_count,u.DEPARTMENT_ID FROM SYS_USER u WHERE u.ISDELETE = 0 group by u.DEPARTMENT_ID) un on un.DEPARTMENT_ID = d.DEPARTMENT_ID
where
d.ISDELETE = 0
</select>
<select id="getUserExamine" parameterType="pd" resultType="pd" >
SELECT
u.USER_ID,
ifnull(st.NUM,0) as st_count,
ifnull(pa.NUM,0) as pass_count
FROM
SYS_USER u
LEFT JOIN (
SELECT
count( distinct f.USER_ID) NUM,
f.USER_ID
FROM
bus_stagestudentrelation f
LEFT JOIN BUS_STUDYTASK t ON t.STUDYTASK_ID = f.STUDYTASK_ID
WHERE
(
t.PEIXUE_START_TIME BETWEEN #{STARTTIME} and #{ENDTIME}
or
t.PEIXUE_END_TIME BETWEEN #{STARTTIME} and #{ENDTIME}
or
(t.PEIXUE_START_TIME &lt;= #{STARTTIME} and t.PEIXUE_END_TIME &gt;= #{ENDTIME})
)
group by f.USER_ID
) st on st.USER_ID=u.USER_ID
LEFT JOIN (
SELECT
count( distinct f.USER_ID) NUM,
f.USER_ID
FROM
bus_stagestudentrelation f
LEFT JOIN BUS_STUDYTASK t ON t.STUDYTASK_ID = f.STUDYTASK_ID
LEFT JOIN BUS_STAGEEXAMPAPER p ON t.STUDYTASK_ID = p.STUDYTASK_ID
WHERE
(
t.PEIXUE_START_TIME BETWEEN #{STARTTIME} and #{ENDTIME}
or
t.PEIXUE_END_TIME BETWEEN #{STARTTIME} and #{ENDTIME}
or
(t.PEIXUE_START_TIME &lt;= #{STARTTIME} and t.PEIXUE_END_TIME &gt;= #{ENDTIME})
)
and p.PASSSCORE &lt;= f.STAGEEXAMSCORE
group by f.USER_ID
) pa on pa.USER_ID=u.USER_ID
where
u.ISDELETE = 0
</select>
</mapper>

View File

@ -10,12 +10,4 @@
</typeAliases> </typeAliases>
<plugins>
<plugin interceptor="com.zcloud.plugins.PagePlugin">
<property name="dialect" value="mysql"/>
<property name="pageSqlId" value=".*listPage.*"/>
</plugin>
</plugins>
</configuration> </configuration>