学校考勤统计优化
This commit is contained in:
		| @@ -0,0 +1,31 @@ | ||||
| package com.ruoyi.project.benyi.controller; | ||||
|  | ||||
| import com.ruoyi.framework.web.controller.BaseController; | ||||
| import com.ruoyi.framework.web.page.TableDataInfo; | ||||
| import com.ruoyi.project.benyi.domain.ByDatetime; | ||||
| import com.ruoyi.project.benyi.service.IByDatetimeService; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| @RestController | ||||
| @RequestMapping("/benyi/datetime") | ||||
| public class ByDatatimeController extends BaseController { | ||||
|     @Autowired | ||||
|     private IByDatetimeService byDatetimeService; | ||||
|  | ||||
|     /** | ||||
|      * 查询园历管理(本一)列表 | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('benyi:checkindetail:list')") | ||||
|     @GetMapping("/list") | ||||
|     public TableDataInfo list(ByDatetime byDatetime) { | ||||
|         startPage(); | ||||
|         List<ByDatetime> list = byDatetimeService.selectByDatetimeList(byDatetime); | ||||
|         return getDataTable(list); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,76 @@ | ||||
| package com.ruoyi.project.benyi.domain; | ||||
|  | ||||
| import com.fasterxml.jackson.annotation.JsonFormat; | ||||
| import com.ruoyi.framework.web.domain.BaseEntity; | ||||
| import org.apache.commons.lang3.builder.ToStringBuilder; | ||||
| import org.apache.commons.lang3.builder.ToStringStyle; | ||||
|  | ||||
| import java.util.Date; | ||||
|  | ||||
| public class ByDatetime extends BaseEntity { | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|      * 日期 | ||||
|      */ | ||||
|     @JsonFormat(pattern = "yyyy-MM-dd") | ||||
|     private Date day; | ||||
|  | ||||
|     /** | ||||
|      * 排序 | ||||
|      */ | ||||
|     private Long sort; | ||||
|  | ||||
|     /** | ||||
|      * 月总共天数 | ||||
|      */ | ||||
|     private Long dayscount; | ||||
|  | ||||
|     /** | ||||
|      * 月份 | ||||
|      */ | ||||
|     @JsonFormat(pattern = "yyyy-MM") | ||||
|     private Date month; | ||||
|  | ||||
|     public Date getDay() { | ||||
|         return day; | ||||
|     } | ||||
|  | ||||
|     public void setDay(Date day) { | ||||
|         this.day = day; | ||||
|     } | ||||
|  | ||||
|     public Long getSort() { | ||||
|         return sort; | ||||
|     } | ||||
|  | ||||
|     public void setSort(Long sort) { | ||||
|         this.sort = sort; | ||||
|     } | ||||
|  | ||||
|     public Long getDayscount() { | ||||
|         return dayscount; | ||||
|     } | ||||
|  | ||||
|     public void setDayscount(Long dayscount) { | ||||
|         this.dayscount = dayscount; | ||||
|     } | ||||
|  | ||||
|     public Date getMonth() { | ||||
|         return month; | ||||
|     } | ||||
|  | ||||
|     public void setMonth(Date month) { | ||||
|         this.month = month; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String toString() { | ||||
|         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) | ||||
|                 .append("day", getDay()) | ||||
|                 .append("sort", getSort()) | ||||
|                 .append("dayscount", getDayscount()) | ||||
|                 .append("month", getMonth()) | ||||
|                 .toString(); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,15 @@ | ||||
| package com.ruoyi.project.benyi.mapper; | ||||
|  | ||||
| import com.ruoyi.project.benyi.domain.ByDatetime; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| public interface ByDatetimeMapper { | ||||
|     /** | ||||
|      * 查询日期列表 | ||||
|      * | ||||
|      * @param byDatetime 日期 | ||||
|      * @return 日期集合 | ||||
|      */ | ||||
|     public List<ByDatetime> selectByDatetimeList(ByDatetime byDatetime); | ||||
| } | ||||
| @@ -0,0 +1,15 @@ | ||||
| package com.ruoyi.project.benyi.service; | ||||
|  | ||||
| import com.ruoyi.project.benyi.domain.ByDatetime; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| public interface IByDatetimeService { | ||||
|     /** | ||||
|      * 查询日期列表 | ||||
|      * | ||||
|      * @param byDatetime 日期 | ||||
|      * @return 日期集合 | ||||
|      */ | ||||
|     public List<ByDatetime> selectByDatetimeList(ByDatetime byDatetime); | ||||
| } | ||||
| @@ -0,0 +1,26 @@ | ||||
| package com.ruoyi.project.benyi.service.impl; | ||||
|  | ||||
| import com.ruoyi.project.benyi.domain.ByDatetime; | ||||
| import com.ruoyi.project.benyi.mapper.ByDatetimeMapper; | ||||
| import com.ruoyi.project.benyi.service.IByDatetimeService; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| @Service | ||||
| public class ByDatetimeServiceImpl  implements IByDatetimeService { | ||||
|     @Autowired | ||||
|     private ByDatetimeMapper byDatetimeMapper; | ||||
|  | ||||
|     /** | ||||
|      * 查询日期列表 | ||||
|      * | ||||
|      * @param byDatetime 日期 | ||||
|      * @return 日期集合 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<ByDatetime> selectByDatetimeList(ByDatetime byDatetime) { | ||||
|         return byDatetimeMapper.selectByDatetimeList(byDatetime); | ||||
|     } | ||||
| } | ||||
| @@ -241,4 +241,17 @@ public class ByClassController extends BaseController { | ||||
|         return AjaxResult.error("当前用户非幼儿园,无法删除班级"); | ||||
|  | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 查询班级信息列表 | ||||
|      */ | ||||
|     @PreAuthorize("@ss.hasPermi('system:class:list')" + "||@ss.hasPermi('benyi:checkindetail:list')") | ||||
|     @GetMapping("/checklist") | ||||
|     public TableDataInfo checklist(ByClass byClass) { | ||||
|         startPage(); | ||||
|         List<ByClass> list = byClassService.selectststicstSchoolList(byClass); | ||||
|         return getDataTable(list); | ||||
|     } | ||||
|  | ||||
|  | ||||
| } | ||||
| @@ -110,6 +110,297 @@ public class ByClass extends BaseEntity { | ||||
|     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||||
|     private Date createtime; | ||||
|  | ||||
|     public String getMonth() { | ||||
|         return month; | ||||
|     } | ||||
|  | ||||
|     public void setMonth(String month) { | ||||
|         this.month = month; | ||||
|     } | ||||
|  | ||||
|     public float getDay1() { | ||||
|         return day1; | ||||
|     } | ||||
|  | ||||
|     public void setDay1(float day1) { | ||||
|         this.day1 = day1; | ||||
|     } | ||||
|  | ||||
|     public float getDay2() { | ||||
|         return day2; | ||||
|     } | ||||
|  | ||||
|     public void setDay2(float day2) { | ||||
|         this.day2 = day2; | ||||
|     } | ||||
|  | ||||
|     public float getDay3() { | ||||
|         return day3; | ||||
|     } | ||||
|  | ||||
|     public void setDay3(float day3) { | ||||
|         this.day3 = day3; | ||||
|     } | ||||
|  | ||||
|     public float getDay4() { | ||||
|         return day4; | ||||
|     } | ||||
|  | ||||
|     public void setDay4(float day4) { | ||||
|         this.day4 = day4; | ||||
|     } | ||||
|  | ||||
|     public float getDay5() { | ||||
|         return day5; | ||||
|     } | ||||
|  | ||||
|     public void setDay5(float day5) { | ||||
|         this.day5 = day5; | ||||
|     } | ||||
|  | ||||
|     public float getDay6() { | ||||
|         return day6; | ||||
|     } | ||||
|  | ||||
|     public void setDay6(float day6) { | ||||
|         this.day6 = day6; | ||||
|     } | ||||
|  | ||||
|     public float getDay7() { | ||||
|         return day7; | ||||
|     } | ||||
|  | ||||
|     public void setDay7(float day7) { | ||||
|         this.day7 = day7; | ||||
|     } | ||||
|  | ||||
|     public float getDay8() { | ||||
|         return day8; | ||||
|     } | ||||
|  | ||||
|     public void setDay8(float day8) { | ||||
|         this.day8 = day8; | ||||
|     } | ||||
|  | ||||
|     public float getDay9() { | ||||
|         return day9; | ||||
|     } | ||||
|  | ||||
|     public void setDay9(float day9) { | ||||
|         this.day9 = day9; | ||||
|     } | ||||
|  | ||||
|     public float getDay10() { | ||||
|         return day10; | ||||
|     } | ||||
|  | ||||
|     public void setDay10(float day10) { | ||||
|         this.day10 = day10; | ||||
|     } | ||||
|  | ||||
|     public float getDay11() { | ||||
|         return day11; | ||||
|     } | ||||
|  | ||||
|     public void setDay11(float day11) { | ||||
|         this.day11 = day11; | ||||
|     } | ||||
|  | ||||
|     public float getDay12() { | ||||
|         return day12; | ||||
|     } | ||||
|  | ||||
|     public void setDay12(float day12) { | ||||
|         this.day12 = day12; | ||||
|     } | ||||
|  | ||||
|     public float getDay13() { | ||||
|         return day13; | ||||
|     } | ||||
|  | ||||
|     public void setDay13(float day13) { | ||||
|         this.day13 = day13; | ||||
|     } | ||||
|  | ||||
|     public float getDay14() { | ||||
|         return day14; | ||||
|     } | ||||
|  | ||||
|     public void setDay14(float day14) { | ||||
|         this.day14 = day14; | ||||
|     } | ||||
|  | ||||
|     public float getDay15() { | ||||
|         return day15; | ||||
|     } | ||||
|  | ||||
|     public void setDay15(float day15) { | ||||
|         this.day15 = day15; | ||||
|     } | ||||
|  | ||||
|     public float getDay16() { | ||||
|         return day16; | ||||
|     } | ||||
|  | ||||
|     public void setDay16(float day16) { | ||||
|         this.day16 = day16; | ||||
|     } | ||||
|  | ||||
|     public float getDay17() { | ||||
|         return day17; | ||||
|     } | ||||
|  | ||||
|     public void setDay17(float day17) { | ||||
|         this.day17 = day17; | ||||
|     } | ||||
|  | ||||
|     public float getDay18() { | ||||
|         return day18; | ||||
|     } | ||||
|  | ||||
|     public void setDay18(float day18) { | ||||
|         this.day18 = day18; | ||||
|     } | ||||
|  | ||||
|     public float getDay19() { | ||||
|         return day19; | ||||
|     } | ||||
|  | ||||
|     public void setDay19(float day19) { | ||||
|         this.day19 = day19; | ||||
|     } | ||||
|  | ||||
|     public float getDay20() { | ||||
|         return day20; | ||||
|     } | ||||
|  | ||||
|     public void setDay20(float day20) { | ||||
|         this.day20 = day20; | ||||
|     } | ||||
|  | ||||
|     public float getDay21() { | ||||
|         return day21; | ||||
|     } | ||||
|  | ||||
|     public void setDay21(float day21) { | ||||
|         this.day21 = day21; | ||||
|     } | ||||
|  | ||||
|     public float getDay22() { | ||||
|         return day22; | ||||
|     } | ||||
|  | ||||
|     public void setDay22(float day22) { | ||||
|         this.day22 = day22; | ||||
|     } | ||||
|  | ||||
|     public float getDay23() { | ||||
|         return day23; | ||||
|     } | ||||
|  | ||||
|     public void setDay23(float day23) { | ||||
|         this.day23 = day23; | ||||
|     } | ||||
|  | ||||
|     public float getDay24() { | ||||
|         return day24; | ||||
|     } | ||||
|  | ||||
|     public void setDay24(float day24) { | ||||
|         this.day24 = day24; | ||||
|     } | ||||
|  | ||||
|     public float getDay25() { | ||||
|         return day25; | ||||
|     } | ||||
|  | ||||
|     public void setDay25(float day25) { | ||||
|         this.day25 = day25; | ||||
|     } | ||||
|  | ||||
|     public float getDay26() { | ||||
|         return day26; | ||||
|     } | ||||
|  | ||||
|     public void setDay26(float day26) { | ||||
|         this.day26 = day26; | ||||
|     } | ||||
|  | ||||
|     public float getDay27() { | ||||
|         return day27; | ||||
|     } | ||||
|  | ||||
|     public void setDay27(float day27) { | ||||
|         this.day27 = day27; | ||||
|     } | ||||
|  | ||||
|     public float getDay28() { | ||||
|         return day28; | ||||
|     } | ||||
|  | ||||
|     public void setDay28(float day28) { | ||||
|         this.day28 = day28; | ||||
|     } | ||||
|  | ||||
|     public float getDay29() { | ||||
|         return day29; | ||||
|     } | ||||
|  | ||||
|     public void setDay29(float day29) { | ||||
|         this.day29 = day29; | ||||
|     } | ||||
|  | ||||
|     public float getDay30() { | ||||
|         return day30; | ||||
|     } | ||||
|  | ||||
|     public void setDay30(float day30) { | ||||
|         this.day30 = day30; | ||||
|     } | ||||
|  | ||||
|     public float getDay31() { | ||||
|         return day31; | ||||
|     } | ||||
|  | ||||
|     public void setDay31(float day31) { | ||||
|         this.day31 = day31; | ||||
|     } | ||||
|  | ||||
|     private String month; | ||||
|  | ||||
|     private float day1; | ||||
|     private float day2; | ||||
|     private float day3; | ||||
|     private float day4; | ||||
|     private float day5; | ||||
|     private float day6; | ||||
|     private float day7; | ||||
|     private float day8; | ||||
|     private float day9; | ||||
|     private float day10; | ||||
|     private float day11; | ||||
|     private float day12; | ||||
|     private float day13; | ||||
|     private float day14; | ||||
|     private float day15; | ||||
|     private float day16; | ||||
|     private float day17; | ||||
|     private float day18; | ||||
|     private float day19; | ||||
|     private float day20; | ||||
|     private float day21; | ||||
|     private float day22; | ||||
|     private float day23; | ||||
|     private float day24; | ||||
|     private float day25; | ||||
|     private float day26; | ||||
|     private float day27; | ||||
|     private float day28; | ||||
|     private float day29; | ||||
|     private float day30; | ||||
|     private float day31; | ||||
|  | ||||
|  | ||||
|     public void setBjbh(String bjbh) { | ||||
|         this.bjbh = bjbh; | ||||
|     } | ||||
| @@ -181,6 +472,7 @@ public class ByClass extends BaseEntity { | ||||
|     public Long getZbjs() { | ||||
|         return zbjs; | ||||
|     } | ||||
|  | ||||
|     public void setZbjsxm(String zbjsxm) { | ||||
|         this.zbjsxm = zbjsxm; | ||||
|     } | ||||
| @@ -196,6 +488,7 @@ public class ByClass extends BaseEntity { | ||||
|     public Long getPbjs() { | ||||
|         return pbjs; | ||||
|     } | ||||
|  | ||||
|     public void setPbjsxm(String pbjsxm) { | ||||
|         this.pbjsxm = pbjsxm; | ||||
|     } | ||||
| @@ -211,6 +504,7 @@ public class ByClass extends BaseEntity { | ||||
|     public Long getZljs() { | ||||
|         return zljs; | ||||
|     } | ||||
|  | ||||
|     public void setZljsxm(String zljsxm) { | ||||
|         this.zljsxm = zljsxm; | ||||
|     } | ||||
| @@ -254,6 +548,38 @@ public class ByClass extends BaseEntity { | ||||
|                 .append("zljsxm", getZljsxm()) | ||||
|                 .append("isdel", getIsdel()) | ||||
|                 .append("createtime", getCreatetime()) | ||||
|                 .append("month", getMonth()) | ||||
|                 .append("day1", getDay1()) | ||||
|                 .append("day2", getDay2()) | ||||
|                 .append("day3", getDay3()) | ||||
|                 .append("day4", getDay4()) | ||||
|                 .append("day5", getDay5()) | ||||
|                 .append("day6", getDay6()) | ||||
|                 .append("day7", getDay7()) | ||||
|                 .append("day8", getDay8()) | ||||
|                 .append("day9", getDay9()) | ||||
|                 .append("day10", getDay10()) | ||||
|                 .append("day11", getDay11()) | ||||
|                 .append("day12", getDay12()) | ||||
|                 .append("day13", getDay13()) | ||||
|                 .append("day14", getDay14()) | ||||
|                 .append("day15", getDay15()) | ||||
|                 .append("day16", getDay16()) | ||||
|                 .append("day17", getDay17()) | ||||
|                 .append("day18", getDay18()) | ||||
|                 .append("day19", getDay19()) | ||||
|                 .append("day20", getDay20()) | ||||
|                 .append("day21", getDay21()) | ||||
|                 .append("day22", getDay22()) | ||||
|                 .append("day23", getDay23()) | ||||
|                 .append("day24", getDay24()) | ||||
|                 .append("day25", getDay25()) | ||||
|                 .append("day26", getDay26()) | ||||
|                 .append("day27", getDay27()) | ||||
|                 .append("day28", getDay28()) | ||||
|                 .append("day29", getDay29()) | ||||
|                 .append("day30", getDay30()) | ||||
|                 .append("day31", getDay31()) | ||||
|                 .toString(); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -61,4 +61,12 @@ public interface ByClassMapper | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int deleteByClassByIds(String[] bjbhs); | ||||
|  | ||||
|     /** | ||||
|      * 查询班级信息列表 | ||||
|      * | ||||
|      * @param byClass 班级信息 | ||||
|      * @return 班级信息集合 | ||||
|      */ | ||||
|     public List<ByClass> selectststicstSchoolList(ByClass byClass); | ||||
| } | ||||
| @@ -61,4 +61,12 @@ public interface IByClassService | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int deleteByClassById(String bjbh); | ||||
|  | ||||
|     /** | ||||
|      * 查询班级信息列表 | ||||
|      * | ||||
|      * @param byClass 班级信息 | ||||
|      * @return 班级信息集合 | ||||
|      */ | ||||
|     public List<ByClass> selectststicstSchoolList(ByClass byClass); | ||||
| } | ||||
| @@ -16,8 +16,7 @@ import com.ruoyi.project.system.service.IByClassService; | ||||
|  * @date 2020-04-14 | ||||
|  */ | ||||
| @Service | ||||
| public class ByClassServiceImpl implements IByClassService | ||||
| { | ||||
| public class ByClassServiceImpl implements IByClassService { | ||||
|     @Autowired | ||||
|     private ByClassMapper byClassMapper; | ||||
|  | ||||
| @@ -28,8 +27,7 @@ public class ByClassServiceImpl implements IByClassService | ||||
|      * @return 班级信息 | ||||
|      */ | ||||
|     @Override | ||||
|     public ByClass selectByClassById(String bjbh) | ||||
|     { | ||||
|     public ByClass selectByClassById(String bjbh) { | ||||
|         return byClassMapper.selectByClassById(bjbh); | ||||
|     } | ||||
|  | ||||
| @@ -46,8 +44,7 @@ public class ByClassServiceImpl implements IByClassService | ||||
|      */ | ||||
|     @Override | ||||
|     @DataScope(deptAlias = "d") | ||||
|     public List<ByClass> selectByClassList(ByClass byClass) | ||||
|     { | ||||
|     public List<ByClass> selectByClassList(ByClass byClass) { | ||||
|         return byClassMapper.selectByClassList(byClass); | ||||
|     } | ||||
|  | ||||
| @@ -58,8 +55,7 @@ public class ByClassServiceImpl implements IByClassService | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     @Override | ||||
|     public int insertByClass(ByClass byClass) | ||||
|     { | ||||
|     public int insertByClass(ByClass byClass) { | ||||
|         return byClassMapper.insertByClass(byClass); | ||||
|     } | ||||
|  | ||||
| @@ -70,8 +66,7 @@ public class ByClassServiceImpl implements IByClassService | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     @Override | ||||
|     public int updateByClass(ByClass byClass) | ||||
|     { | ||||
|     public int updateByClass(ByClass byClass) { | ||||
|         return byClassMapper.updateByClass(byClass); | ||||
|     } | ||||
|  | ||||
| @@ -82,8 +77,7 @@ public class ByClassServiceImpl implements IByClassService | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     @Override | ||||
|     public int deleteByClassByIds(String[] bjbhs) | ||||
|     { | ||||
|     public int deleteByClassByIds(String[] bjbhs) { | ||||
|         return byClassMapper.deleteByClassByIds(bjbhs); | ||||
|     } | ||||
|  | ||||
| @@ -94,8 +88,19 @@ public class ByClassServiceImpl implements IByClassService | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     @Override | ||||
|     public int deleteByClassById(String bjbh) | ||||
|     { | ||||
|     public int deleteByClassById(String bjbh) { | ||||
|         return byClassMapper.deleteByClassById(bjbh); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 查询班级信息列表 | ||||
|      * | ||||
|      * @param byClass 班级信息 | ||||
|      * @return 班级信息集合 | ||||
|      */ | ||||
|     @Override | ||||
|     @DataScope(deptAlias = "d") | ||||
|     public List<ByClass> selectststicstSchoolList(ByClass byClass) { | ||||
|         return byClassMapper.selectststicstSchoolList(byClass); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										23
									
								
								ruoyi/src/main/resources/mybatis/benyi/ByDatetimeMapper.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								ruoyi/src/main/resources/mybatis/benyi/ByDatetimeMapper.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| <?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.ruoyi.project.benyi.mapper.ByDatetimeMapper"> | ||||
|  | ||||
|     <resultMap type="ByDatetime" id="ByDatetimeResult"> | ||||
|         <result property="day" column="day"/> | ||||
|         <result property="sort" column="sort"/> | ||||
|         <result property="dayscount" column="dayscount"/> | ||||
|         <result property="month" column="month"/> | ||||
|     </resultMap> | ||||
|  | ||||
|  | ||||
|     <select id="selectByDatetimeList" parameterType="ByDatetime" resultMap="ByDatetimeResult"> | ||||
|         select CONCAT(#{month},'-',help_topic_id +1) day,help_topic_id as sort,day(last_day( CONCAT(#{month},'-1'))) | ||||
|         as dayscount | ||||
|         from mysql.help_topic | ||||
|         where help_topic_id < day(last_day(CONCAT(#{month},'-1'))) | ||||
|         order by help_topic_id | ||||
|     </select> | ||||
|  | ||||
| </mapper> | ||||
| @@ -21,6 +21,39 @@ | ||||
|         <result property="zljsxm" column="zljsxm"/> | ||||
|         <result property="isdel" column="isdel"/> | ||||
|         <result property="createtime" column="createtime"/> | ||||
|         <result property="month" column="month"/> | ||||
|         <result property="day1" column="day1"/> | ||||
|         <result property="day2" column="day2"/> | ||||
|         <result property="day3" column="day3"/> | ||||
|         <result property="day4" column="day4"/> | ||||
|         <result property="day5" column="day5"/> | ||||
|         <result property="day6" column="day6"/> | ||||
|         <result property="day7" column="day7"/> | ||||
|         <result property="day8" column="day8"/> | ||||
|         <result property="day9" column="day9"/> | ||||
|         <result property="day10" column="day10"/> | ||||
|         <result property="day11" column="day11"/> | ||||
|         <result property="day12" column="day12"/> | ||||
|         <result property="day13" column="day13"/> | ||||
|         <result property="day14" column="day14"/> | ||||
|         <result property="day15" column="day15"/> | ||||
|         <result property="day16" column="day16"/> | ||||
|         <result property="day17" column="day17"/> | ||||
|         <result property="day18" column="day18"/> | ||||
|         <result property="day19" column="day19"/> | ||||
|         <result property="day20" column="day20"/> | ||||
|         <result property="day21" column="day21"/> | ||||
|         <result property="day22" column="day22"/> | ||||
|         <result property="day23" column="day23"/> | ||||
|         <result property="day24" column="day24"/> | ||||
|         <result property="day25" column="day25"/> | ||||
|         <result property="day26" column="day26"/> | ||||
|         <result property="day27" column="day27"/> | ||||
|         <result property="day28" column="day28"/> | ||||
|         <result property="day29" column="day29"/> | ||||
|         <result property="day30" column="day30"/> | ||||
|         <result property="day31" column="day31"/> | ||||
|  | ||||
|     </resultMap> | ||||
|  | ||||
|     <sql id="selectByClassVo"> | ||||
| @@ -149,4 +182,107 @@ | ||||
|         </foreach> | ||||
|     </delete> | ||||
|  | ||||
|     <select id="selectststicstSchoolList" parameterType="ByClass" | ||||
|             resultMap="ByClassResult"> | ||||
|         select d.bjbh,d.dept_id,d.bjmc, | ||||
|         (select count(*) from by_child where classid=d.bjbh) as childcount, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-01') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day1, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-02') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day2, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-03') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day3, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-04') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day4, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-05') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day5, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-06') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day6, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-07') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day7, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-08') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day8, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-09') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day9, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-10') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day10, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-11') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day11, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-12') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day12, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-13') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day13, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-14') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day14, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-15') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day15, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-16') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day16, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-17') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day17, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-18') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day18, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-19') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day19, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-20') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day20, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-21') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day21, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-22') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day22, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-23') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day23, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-24') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day24, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-25') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day25, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-26') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day26, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-27') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day27, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-28') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day28, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-29') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day29, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-30') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day30, | ||||
|         ((select count(*) from by_child_checkin_detail where classid=d.bjbh and | ||||
|         date_format(create_time,'%Y-%m-%d')=concat(#{month},'-31') and type='01')/(select count(*) from by_child where | ||||
|         classid=d.bjbh)) as day31 | ||||
|         from by_class d | ||||
|         where d.isdel='0' | ||||
|         <!-- 数据范围过滤 --> | ||||
|         ${dataScope} | ||||
|     </select> | ||||
|  | ||||
| </mapper> | ||||
		Reference in New Issue
	
	Block a user