班级考勤部分代码

This commit is contained in:
sk1551
2020-09-24 18:03:14 +08:00
parent 279f7b30e7
commit 3db6468b9c
2 changed files with 410 additions and 530 deletions

View File

@ -411,284 +411,158 @@
<select id="selectststicstClassList" parameterType="ByChild"
resultMap="ByChildResult">
select c.id,c.classid,c.name,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-01')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-01')
and type='01')) as day1,
select c.id, c.classid, c.name,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-02')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-02')
and type='01')) as day2,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-1')) as day1,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-03')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-03')
and type='01')) as day3,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-2')) as day2,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-04')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-04')
and type='01')) as day4,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-3')) as day3,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-05')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-05')
and type='01')) as day5,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-4')) as day4,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-06')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-06')
and type='01')) as day6,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-5')) as day5,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-07')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-07')
and type='01')) as day7,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-6')) as day6,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-08')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-08')
and type='01')) as day8,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-7')) as day7,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-09')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-09')
and type='01')) as day9,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-8')) as day8,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-10')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-10')
and type='01')) as day10,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-9')) as day9,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-11')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-11')
and type='01')) as day11,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-10')) as day10,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-12')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-12')
and type='01')) as day12,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-11')) as day11,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-13')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-13')
and type='01')) as day13,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-12')) as day12,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-14')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-14')
and type='01')) as day14,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-13')) as day13,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-15')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-15')
and type='01')) as day15,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-14')) as day14,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-16')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-16')
and type='01')) as day16,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-15')) as day15,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-17')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-17')
and type='01')) as day17,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-16')) as day16,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-18')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-18')
and type='01')) as day18,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-17')) as day17,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-19')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-19')
and type='01')) as day19,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-18')) as day18,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-20')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-20')
and type='01')) as day20,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-19')) as day19,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-21')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-21')
and type='01')) as day21,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-20')) as day20,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-22')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-22')
and type='01')) as day22,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-21')) as day21,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-23')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-23')
and type='01')) as day23,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-22')) as day22,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-24')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-24')
and type='01')) as day24,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-23')) as day23,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-25')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-25')
and type='01')) as day25,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-24')) as day24,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-26')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-26')
and type='01')) as day26,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-27')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-27')
and type='01')) as day27,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-28')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-28')
and type='01')) as day28,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-29')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-29')
and type='01')) as day29,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-30')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-30')
and type='01')) as day30,
((select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-31')
and type='01')/
(select count(*) from by_child_checkin_detail
where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-31')
and type='01')) as day31
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-25')) as day25,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-26')) as day26,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-27')) as day27,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-28')) as day28,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-29')) as day29,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id
and date_format(create_time,'%Y-%m-%d')=concat(#{month},'-30')) as day30,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
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' and c.classid
where c.status='0'
<if test="classid != null and classid != ''">and c.classid = #{classid}</if>
<!-- 数据范围过滤 -->
-- ${dataScope}