From 4c262eb9f3862cbc5ad757565a0cfebea7436f14 Mon Sep 17 00:00:00 2001 From: sk1551 <15175617877@163.com> Date: Fri, 25 Sep 2020 16:28:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E8=80=83=E5=8B=A4=E9=83=A8?= =?UTF-8?q?=E5=88=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/project/common/SchoolCommon.java | 2 + .../resources/mybatis/benyi/ByChildMapper.xml | 73 ++++++++++++++++++- 2 files changed, 74 insertions(+), 1 deletion(-) diff --git a/ruoyi/src/main/java/com/ruoyi/project/common/SchoolCommon.java b/ruoyi/src/main/java/com/ruoyi/project/common/SchoolCommon.java index 8d6f20134..5db2c6603 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/common/SchoolCommon.java +++ b/ruoyi/src/main/java/com/ruoyi/project/common/SchoolCommon.java @@ -94,6 +94,8 @@ public class SchoolCommon { return false; } + + /** * 判断当前用户是否拥有班级 **/ diff --git a/ruoyi/src/main/resources/mybatis/benyi/ByChildMapper.xml b/ruoyi/src/main/resources/mybatis/benyi/ByChildMapper.xml index c35e49838..7c2d89141 100644 --- a/ruoyi/src/main/resources/mybatis/benyi/ByChildMapper.xml +++ b/ruoyi/src/main/resources/mybatis/benyi/ByChildMapper.xml @@ -568,10 +568,81 @@ from by_child_checkin_detail where childid=c.id and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-31')) as day31 from by_child c - where c.status='0' + where c.status = '0' and c.classid = #{classid} -- ${dataScope} + + union all + + select '','classid','小计','','', + + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-1') and classid=c.classid) / count(*) as day1, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-2') and classid=c.classid) / count(*) as day2, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-3') and classid=c.classid) / count(*) as day3, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-4') and classid=c.classid) / count(*) as day4, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-5') and classid=c.classid) / count(*) as day5, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-6') and classid=c.classid) / count(*) as day6, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-7') and classid=c.classid) / count(*) as day7, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-8') and classid=c.classid) / count(*) as day8, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-9') and classid=c.classid) / count(*) as day9, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-10') and classid=c.classid) / count(*) as day10, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-11') and classid=c.classid) / count(*) as day11, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-12') and classid=c.classid) / count(*) as day12, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-13') and classid=c.classid) / count(*) as day13, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-14') and classid=c.classid) / count(*) as day14, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-15') and classid=c.classid) / count(*) as day15, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-16') and classid=c.classid) / count(*) as day16, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-17') and classid=c.classid) / count(*) as day17, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-18') and classid=c.classid) / count(*) as day18, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-19') and classid=c.classid) / count(*) as day19, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-20') and classid=c.classid) / count(*) as day20, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-21') and classid=c.classid) / count(*) as day21, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-22') and classid=c.classid) / count(*) as day22, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-23') and classid=c.classid) / count(*) as day23, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-24') and classid=c.classid) / count(*) as day24, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-25') and classid=c.classid) / count(*) as day25, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-26') and classid=c.classid) / count(*) as day26, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-27') and classid=c.classid) / count(*) as day27, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-28') and classid=c.classid) / count(*) as day28, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-29') and classid=c.classid) / count(*) as day29, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-30') and classid=c.classid) / count(*) as day30, + (select count(*) from by_child_checkin_detail where + type='01' and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-31') and classid=c.classid) / count(*) as day31 + + from by_child c + where c.status = '0' + and c.classid = #{classid} \ No newline at end of file