瀏覽代碼

首页统计

liujunchi 3 年之前
父節點
當前提交
53b0c7c8ad

+ 9 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/HomeController.java

@@ -5,6 +5,7 @@ import com.yonge.cooleshow.biz.dal.service.HomeService;
 import com.yonge.cooleshow.biz.dal.service.MusicSheetService;
 import com.yonge.cooleshow.biz.dal.vo.CourseHomeVo;
 import com.yonge.cooleshow.biz.dal.vo.HomeMusicSheetVo;
+import com.yonge.cooleshow.biz.dal.vo.SubjectHomeVo;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalStudent;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalTeacher;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeUserToDoNum;
@@ -68,4 +69,12 @@ public class HomeController extends BaseController {
         return succeed(homeService.queryCourseHomeData(param));
     }
 
+
+
+    @ApiOperation(value = "获取首页- 内容数据-声部数据")
+    @PostMapping("/subjectHome")
+    // @PreAuthorize("@pcs.hasPermissions('home/courseHome')")
+    public HttpResponseResult<SubjectHomeVo> subjectHome() {
+        return succeed();
+    }
 }

+ 11 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/HomeDao.java

@@ -1,6 +1,7 @@
 package com.yonge.cooleshow.biz.dal.dao;
 
 import com.yonge.cooleshow.biz.dal.dto.req.TotalReq;
+import com.yonge.cooleshow.biz.dal.vo.TagTotalTeacher;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalStudent;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalTeacher;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeUserToDoNum;
@@ -31,6 +32,7 @@ public interface HomeDao {
      * @return: java.util.List<com.yonge.cooleshow.biz.dal.vo.res.HomeTotalTeacher>
      */
     List<HomeTotalTeacher> totalTeacher(@Param("timeType") String timeType, @Param("param") TotalReq param);
+
     /***
      * 统计查询学生信息
      * @author liweifan
@@ -40,4 +42,13 @@ public interface HomeDao {
      * @return: java.util.List<com.yonge.cooleshow.biz.dal.vo.res.HomeTotalStudent>
      */
     List<HomeTotalStudent> totalStudent(@Param("timeType") String timeType, @Param("param") TotalReq param);
+
+    /**
+     * 点亮图标统计
+     *
+     * @param timeType
+     * @param query
+     * @return
+     */
+    List<TagTotalTeacher> tagTeacher(@Param("timeType") String timeType, @Param("param") TotalReq query);
 }

+ 14 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/StudentTime.java

@@ -1,6 +1,5 @@
 package com.yonge.cooleshow.biz.dal.entity;
 
-import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -52,6 +51,20 @@ public class StudentTime implements Serializable {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
     private Date firstMallTime;
 
+    @ApiModelProperty("第一次购买时间 ")
+    @TableField(value = "first_activity_time_")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date firstPayTime;
+
+    public Date getFirstPayTime() {
+        return firstPayTime;
+    }
+
+    public void setFirstPayTime(Date firstPayTime) {
+        this.firstPayTime = firstPayTime;
+    }
+
     public Long getUserId() {
         return userId;
     }

+ 43 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/Teacher.java

@@ -131,6 +131,24 @@ public class Teacher implements Serializable {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
     private Date liveDate;
 
+    @ApiModelProperty("曲目点亮时间 ")
+    @TableField(value = "music_date_")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date musicDate;
+
+    @ApiModelProperty("视频课图标点亮时间 ")
+    @TableField(value = "video_date_")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date videoDate;
+
+    @ApiModelProperty("个人风采图标点亮时间 ")
+    @TableField(value = "style_date_")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date styleDate;
+
     /**
      * 会员等级
      */
@@ -169,6 +187,31 @@ public class Teacher implements Serializable {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
     private Date updateTime;
 
+
+    public Date getMusicDate() {
+        return musicDate;
+    }
+
+    public void setMusicDate(Date musicDate) {
+        this.musicDate = musicDate;
+    }
+
+    public Date getVideoDate() {
+        return videoDate;
+    }
+
+    public void setVideoDate(Date videoDate) {
+        this.videoDate = videoDate;
+    }
+
+    public Date getStyleDate() {
+        return styleDate;
+    }
+
+    public void setStyleDate(Date styleDate) {
+        this.styleDate = styleDate;
+    }
+
     public String getTag() {
         return tag;
     }

+ 64 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/HomeServiceImpl.java

@@ -4,10 +4,12 @@ import com.yonge.cooleshow.biz.dal.dao.CourseScheduleDao;
 import com.yonge.cooleshow.biz.dal.dao.HomeDao;
 import com.yonge.cooleshow.biz.dal.dto.req.TotalReq;
 import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
+import com.yonge.cooleshow.biz.dal.enums.TeacherTagEnum;
 import com.yonge.cooleshow.biz.dal.service.CourseScheduleService;
 import com.yonge.cooleshow.biz.dal.service.HomeService;
 import com.yonge.cooleshow.biz.dal.support.WrapperUtil;
 import com.yonge.cooleshow.biz.dal.vo.CourseHomeVo;
+import com.yonge.cooleshow.biz.dal.vo.TagTotalTeacher;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalStudent;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalTeacher;
 import com.yonge.cooleshow.biz.dal.vo.res.HomeUserToDoNum;
@@ -48,26 +50,84 @@ public class HomeServiceImpl implements HomeService {
     public HttpResponseResult<HomeTotalTeacher> totalTeacher(TotalReq query) {
         //统计查询
         List<HomeTotalTeacher> totalList = baserMapper.totalTeacher(query.getTimeType().getCode(), query);
+
+        // 点亮图标
+        List<TagTotalTeacher> tagList = baserMapper.tagTeacher(query.getTimeType().getCode(), query);
+
+        Map<String, Map<String, List<TagTotalTeacher>>> tagTimeTypeGroup = tagList.stream()
+                                                                         .collect(Collectors.groupingBy(
+                                                                                 TagTotalTeacher::getTimeStr,
+                                                                                 Collectors.groupingBy(
+                                                                                         TagTotalTeacher::getTagType)));
+        Map<String, Map<Long, List<TagTotalTeacher>>> tagTimeUserGroup = tagList.stream()
+                                                                       .collect(Collectors.groupingBy(
+                                                                               TagTotalTeacher::getTimeStr,
+                                                                               Collectors.groupingBy(
+                                                                                       TagTotalTeacher::getUserId)));
+
         Integer registerNum = 0;
         Integer entryNum = 0;
         Integer liveNum = 0;
         Integer musicianNum = 0;
+        Integer tagNum  = 0 ;
+        Integer styleTagNum = 0;
+        Integer videoTagNum = 0;
+        Integer liveTagNum = 0;
+        Integer musicTagNum = 0;
         for (HomeTotalTeacher totalTeacher : totalList) {
             totalTeacher.setRegisterNum(null == totalTeacher.getRegisterNum() ? 0 : totalTeacher.getRegisterNum());
             totalTeacher.setEntryNum(null == totalTeacher.getEntryNum() ? 0 : totalTeacher.getEntryNum());
             totalTeacher.setLiveNum(null == totalTeacher.getLiveNum() ? 0 : totalTeacher.getLiveNum());
             totalTeacher.setMusicianNum(null == totalTeacher.getMusicianNum() ? 0 : totalTeacher.getMusicianNum());
 
+            Map<String, List<TagTotalTeacher>> typeGroup = tagTimeTypeGroup.get(totalTeacher.getTimeStr());
+            if (typeGroup != null) {
+                List<TagTotalTeacher> liveTagList = typeGroup.get(TeacherTagEnum.LIVE.getCode());
+                List<TagTotalTeacher> musicTagList = typeGroup.get(TeacherTagEnum.MUSIC.getCode());
+                List<TagTotalTeacher> styleTagList = typeGroup.get(TeacherTagEnum.STYLE.getCode());
+                List<TagTotalTeacher> videoTagList = typeGroup.get(TeacherTagEnum.VIDEO.getCode());
+                totalTeacher.setLiveTagNum(CollectionUtils.isEmpty(liveTagList) ? 0:liveTagList.size());
+                totalTeacher.setMusicTagNum(CollectionUtils.isEmpty(musicTagList) ? 0:musicTagList.size());
+                totalTeacher.setStyleTagNum(CollectionUtils.isEmpty(styleTagList) ? 0:styleTagList.size());
+                totalTeacher.setVideoTagNum(CollectionUtils.isEmpty(videoTagList) ? 0:videoTagList.size());
+            } else {
+                totalTeacher.setLiveTagNum(0);
+                totalTeacher.setMusicTagNum(0);
+                totalTeacher.setStyleTagNum(0);
+                totalTeacher.setVideoTagNum(0);
+            }
+
+
+            Map<Long, List<TagTotalTeacher>> userGroup = tagTimeUserGroup.get(totalTeacher.getTimeStr());
+
+            if (userGroup != null) {
+
+                totalTeacher.setTagNum(userGroup.size());
+            } else {
+                totalTeacher.setTagNum(0);
+            }
+
+
             registerNum += totalTeacher.getRegisterNum();
             entryNum += totalTeacher.getEntryNum();
             liveNum += totalTeacher.getLiveNum();
             musicianNum += totalTeacher.getMusicianNum();
+            tagNum += totalTeacher.getTagNum();
+            styleTagNum += totalTeacher.getStyleTagNum();
+            videoTagNum += totalTeacher.getVideoTagNum();
+            liveTagNum += totalTeacher.getLiveTagNum();
+            musicTagNum += totalTeacher.getMusicTagNum();
         }
         HomeTotalTeacher total = new HomeTotalTeacher();
         total.setRegisterNum(registerNum);
         total.setEntryNum(entryNum);
         total.setLiveNum(liveNum);
         total.setMusicianNum(musicianNum);
+        total.setTagNum(tagNum);
+        total.setStyleTagNum(styleTagNum);
+        total.setVideoTagNum(videoTagNum);
+        total.setLiveTagNum(liveTagNum);
+        total.setMusicTagNum(musicTagNum);
         total.setInfoList(totalList);
         return HttpResponseResult.succeed(total);
     }
@@ -82,6 +142,7 @@ public class HomeServiceImpl implements HomeService {
         Integer liveNum = 0;
         Integer musicNum = 0;
         Integer shoppingNum = 0;
+        Integer payStudentNum = 0;
 
         for (HomeTotalStudent totalStudent : totalList) {
             totalStudent.setRegisterNum(null == totalStudent.getRegisterNum() ? 0 : totalStudent.getRegisterNum());
@@ -91,6 +152,7 @@ public class HomeServiceImpl implements HomeService {
             totalStudent.setLiveNum(null == totalStudent.getLiveNum() ? 0 : totalStudent.getLiveNum());
             totalStudent.setMusicNum(null == totalStudent.getMusicNum() ? 0 : totalStudent.getMusicNum());
             totalStudent.setShoppingNum(null == totalStudent.getShoppingNum() ? 0 : totalStudent.getShoppingNum());
+            totalStudent.setPayStudentNum(null == totalStudent.getPayStudentNum() ? 0 : totalStudent.getPayStudentNum());
 
             registerNum += totalStudent.getRegisterNum();
             vipNum += totalStudent.getVipNum();
@@ -99,6 +161,7 @@ public class HomeServiceImpl implements HomeService {
             liveNum += totalStudent.getLiveNum();
             musicNum += totalStudent.getMusicNum();
             shoppingNum += totalStudent.getShoppingNum();
+            payStudentNum += totalStudent.getPayStudentNum();
         }
         HomeTotalStudent total = new HomeTotalStudent();
         total.setRegisterNum(registerNum);
@@ -108,6 +171,7 @@ public class HomeServiceImpl implements HomeService {
         total.setLiveNum(liveNum);
         total.setMusicNum(musicNum);
         total.setShoppingNum(shoppingNum);
+        total.setPayStudentNum(payStudentNum);
 
         total.setInfoList(totalList);
         return HttpResponseResult.succeed(total);

+ 7 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/StudentTimeServiceImpl.java

@@ -19,6 +19,7 @@ import com.yonge.cooleshow.biz.dal.dao.StudentTimeDao;
 import com.yonge.cooleshow.biz.dal.service.StudentTimeService;
 import org.springframework.util.CollectionUtils;
 
+import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
@@ -70,6 +71,9 @@ public class StudentTimeServiceImpl extends ServiceImpl<StudentTimeDao, StudentT
             List<UserOrderDetailVo> orderDetilListByOrderNo = orderDetailService.getOrderDetilListByOrderNo(userOrder.getOrderNo());
 
             for (UserOrderDetailVo detailVo : orderDetilListByOrderNo) {
+                if (detailVo.getActualPrice() != null && detailVo.getActualPrice().compareTo(BigDecimal.ZERO) > 0 && studentTime.getFirstPayTime() == null) {
+                    studentTime.setFirstPayTime(now);
+                }
                 if (null == studentTime.getFirstVipTime() && GoodTypeEnum.VIP.equals(detailVo.getGoodType())) {
                     studentTime.setFirstVipTime(now);
                 }
@@ -85,6 +89,9 @@ public class StudentTimeServiceImpl extends ServiceImpl<StudentTimeDao, StudentT
                 if (null == studentTime.getFirstMusicTime() && GoodTypeEnum.MUSIC.equals(detailVo.getGoodType())) {
                     studentTime.setFirstMusicTime(now);
                 }
+                if (null == studentTime.getFirstPayTime() && GoodTypeEnum.ACTI_REGIST.equals(detailVo.getGoodType())) {
+                    studentTime.setFirstPayTime(now);
+                }
             }
 
             StudentTime old = baseMapper.selectById(userOrder.getUserId());

+ 15 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherServiceImpl.java

@@ -472,13 +472,28 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
         }
         if (StringUtil.isEmpty(teacherVo.getTag())) {
             teacherVo.setTag(teacherTagEnum.getCode());
+            setTagTime(teacherTagEnum, teacherVo);
         } else if (teacherVo.getTag().contains(teacherTagEnum.getCode())) {
             return;
         } else {
             teacherVo.setTag(teacherVo.getTag() + "," + teacherTagEnum.getCode());
+            setTagTime(teacherTagEnum, teacherVo);
         }
 
+
         this.updateById(teacherVo);
     }
 
+    private void setTagTime(TeacherTagEnum teacherTagEnum, TeacherVo teacherVo) {
+        if (teacherTagEnum.equals(TeacherTagEnum.LIVE)) {
+            teacherVo.setLiveDate(new Date());
+        } else if (teacherTagEnum.equals(TeacherTagEnum.MUSIC)) {
+            teacherVo.setLiveDate(new Date());
+        }else if (teacherTagEnum.equals(TeacherTagEnum.STYLE)) {
+            teacherVo.setLiveDate(new Date());
+        }else if (teacherTagEnum.equals(TeacherTagEnum.VIDEO)) {
+            teacherVo.setLiveDate(new Date());
+        }
+    }
+
 }

+ 55 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/SubjectHomeVo.java

@@ -0,0 +1,55 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * Description
+ *
+ * @author liujunchi
+ * @date 2022-08-16
+ */
+@ApiModel("内容数据-声部")
+public class SubjectHomeVo {
+
+    @ApiModelProperty("声部id")
+    private Long subjectId;
+
+    @ApiModelProperty("声部名")
+    private String subjectName;
+
+    @ApiModelProperty("乐谱启用数")
+    private Integer enableMusicSheetNum;
+
+    @ApiModelProperty("乐谱数")
+    private Integer musicSheetNum;
+
+
+    @ApiModelProperty("平台乐谱启用数")
+    private Integer enablePlatformMusicSheetNum;
+
+    @ApiModelProperty("平台乐谱数")
+    private Integer musicPlatformSheetNum;
+
+
+    @ApiModelProperty("老师乐谱启用数")
+    private Integer enableTeacherMusicSheetNum;
+
+    @ApiModelProperty("老师乐谱数")
+    private Integer musicTeacherSheetNum;
+
+
+    @ApiModelProperty("陪练课程组")
+    private Integer practiceNum;
+
+    @ApiModelProperty("琴房课课程组")
+    private Integer pianoClassNum;
+
+    @ApiModelProperty("直播课程组")
+    private Integer liveNum;
+
+    @ApiModelProperty("视频课课程组")
+    private Integer videoNum;
+
+
+}

+ 40 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/TagTotalTeacher.java

@@ -0,0 +1,40 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+/**
+ * Description
+ *
+ * @author liujunchi
+ * @date 2022-08-16
+ */
+public class TagTotalTeacher {
+
+    private String timeStr;
+
+    private Long userId;
+
+    private String tagType;
+
+    public String getTimeStr() {
+        return timeStr;
+    }
+
+    public void setTimeStr(String timeStr) {
+        this.timeStr = timeStr;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getTagType() {
+        return tagType;
+    }
+
+    public void setTagType(String tagType) {
+        this.tagType = tagType;
+    }
+}

+ 11 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/res/HomeTotalStudent.java

@@ -30,6 +30,17 @@ public class HomeTotalStudent {
     @ApiModelProperty("详情数据 ")
     private List<HomeTotalStudent> infoList;
 
+    @ApiModelProperty("付费学员数")
+    private Integer payStudentNum;
+
+    public Integer getPayStudentNum() {
+        return payStudentNum;
+    }
+
+    public void setPayStudentNum(Integer payStudentNum) {
+        this.payStudentNum = payStudentNum;
+    }
+
     public Integer getRegisterNum() {
         return registerNum;
     }

+ 55 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/res/HomeTotalTeacher.java

@@ -24,6 +24,61 @@ public class HomeTotalTeacher {
     @ApiModelProperty("详情数据 ")
     private List<HomeTotalTeacher> infoList;
 
+    @ApiModelProperty("点亮徽章")
+    private Integer tagNum;
+
+    @ApiModelProperty("个人风采人数")
+    private Integer styleTagNum;
+
+    @ApiModelProperty("视频课人数")
+    private Integer videoTagNum;
+
+    @ApiModelProperty("直播课人数")
+    private Integer liveTagNum;
+
+    @ApiModelProperty("曲目人数")
+    private Integer musicTagNum;
+
+    public Integer getStyleTagNum() {
+        return styleTagNum;
+    }
+
+    public void setStyleTagNum(Integer styleTagNum) {
+        this.styleTagNum = styleTagNum;
+    }
+
+    public Integer getVideoTagNum() {
+        return videoTagNum;
+    }
+
+    public void setVideoTagNum(Integer videoTagNum) {
+        this.videoTagNum = videoTagNum;
+    }
+
+    public Integer getLiveTagNum() {
+        return liveTagNum;
+    }
+
+    public void setLiveTagNum(Integer liveTagNum) {
+        this.liveTagNum = liveTagNum;
+    }
+
+    public Integer getMusicTagNum() {
+        return musicTagNum;
+    }
+
+    public void setMusicTagNum(Integer musicTagNum) {
+        this.musicTagNum = musicTagNum;
+    }
+
+    public Integer getTagNum() {
+        return tagNum;
+    }
+
+    public void setTagNum(Integer tagNum) {
+        this.tagNum = tagNum;
+    }
+
     public Integer getRegisterNum() {
         return registerNum;
     }

+ 1 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -155,6 +155,7 @@
         from course_schedule as a
         left join course_group as b on a.course_group_id_ = b.id_
         left join subject as s on b.subject_id_ = s.id_
+        left join sys_user su on a.teacher_id_ = su.id_
         where b.teacher_id_ = #{param.teacherId}
         AND a.lock_ = 0
         AND a.type_ = #{param.type}

+ 103 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/HomeMapper.xml

@@ -127,6 +127,7 @@
 			sum(e.liveNum) as liveNum,
 			sum(f.musicNum) as musicNum,
 			sum(g.shoppingNum) as shoppingNum
+		,sum(h.payNum) as payStudentNum
 		from sys_day t
 		left join (
 			select
@@ -159,6 +160,21 @@
 			group by DATE_FORMAT(t.first_vip_time_,'%Y-%m-%d')
 		) b on t.sys_day_ymd_ = b.timeStr
 		left join (
+		select
+			DATE_FORMAT(t.first_pay_time_,'%Y-%m-%d') as timeStr,
+			count(1) as payNum
+		from student_time t
+			<where>
+				<if test="param.startTime !=null">
+					<![CDATA[AND t.first_pay_time_ >= #{param.startTime} ]]>
+				</if>
+				<if test="param.endTime !=null">
+					<![CDATA[AND t.first_pay_time_ < #{param.endTime} ]]>
+				</if>
+			</where>
+			group by DATE_FORMAT(t.first_pay_time_,'%Y-%m-%d')
+		) h on t.sys_day_ymd_ = h.timeStr
+		left join (
 			select
 				DATE_FORMAT(t.first_practice_time_,'%Y-%m-%d') as timeStr,
 				count(1) as practiceNum
@@ -249,4 +265,91 @@
 		</if>
 		order by t.sys_day_
 	</select>
+
+	<select id="tagTeacher" resultType="com.yonge.cooleshow.biz.dal.vo.TagTotalTeacher">
+		SELECT
+
+		<if test="timeType != null and timeType == 'MONTH'">
+			DATE_FORMAT(live_date_,'%Y-%m-%d') as timeStr,
+		</if>
+		<if test="timeType != null and timeType == 'YEAR'">
+			DATE_FORMAT(live_date_,'%Y-%m') as timeStr,
+		</if>
+			user_id_ ,
+			'LIVE' as tagType
+		FROM
+			teacher
+		<where>
+			<if test="param.startTime !=null">
+				<![CDATA[AND live_date_ >= #{param.startTime} ]]>
+			</if>
+			<if test="param.endTime !=null">
+				<![CDATA[AND live_date_ < #{param.endTime} ]]>
+			</if>
+		</where>
+		UNION all
+
+		SELECT
+		<if test="timeType != null and timeType == 'MONTH'">
+			DATE_FORMAT(style_date_,'%Y-%m-%d') as timeStr,
+		</if>
+		<if test="timeType != null and timeType == 'YEAR'">
+			DATE_FORMAT(style_date_,'%Y-%m') as timeStr,
+		</if>
+			user_id_ ,
+			'STYLE' as tagType
+		FROM
+			teacher
+		<where>
+			<if test="param.startTime !=null">
+				<![CDATA[AND style_date_ >= #{param.startTime} ]]>
+			</if>
+			<if test="param.endTime !=null">
+				<![CDATA[AND style_date_ < #{param.endTime} ]]>
+			</if>
+		</where>
+
+		UNION all
+
+		SELECT
+		<if test="timeType != null and timeType == 'MONTH'">
+			DATE_FORMAT(music_date_,'%Y-%m-%d') as timeStr,
+		</if>
+		<if test="timeType != null and timeType == 'YEAR'">
+			DATE_FORMAT(music_date_,'%Y-%m') as timeStr,
+		</if>
+			user_id_ ,
+			'MUSIC' as tagType
+		FROM
+			teacher
+		<where>
+			<if test="param.startTime !=null">
+				<![CDATA[AND music_date_ >= #{param.startTime} ]]>
+			</if>
+			<if test="param.endTime !=null">
+				<![CDATA[AND music_date_ < #{param.endTime} ]]>
+			</if>
+		</where>
+		UNION all
+
+		SELECT
+		<if test="timeType != null and timeType == 'MONTH'">
+			DATE_FORMAT(video_date_,'%Y-%m-%d') as timeStr,
+		</if>
+		<if test="timeType != null and timeType == 'YEAR'">
+			DATE_FORMAT(video_date_,'%Y-%m') as timeStr,
+		</if>
+			user_id_ ,
+			'VIDEO' as tagType
+		FROM
+			teacher
+		<where>
+			<if test="param.startTime !=null">
+				<![CDATA[AND video_date_ >= #{param.startTime} ]]>
+			</if>
+			<if test="param.endTime !=null">
+				<![CDATA[AND video_date_ < #{param.endTime} ]]>
+			</if>
+		</where>
+	</select>
 </mapper>

+ 6 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -22,6 +22,9 @@
         <result column="membership_end_time_" property="membershipEndTime"/>
         <result column="live_flag_" property="liveFlag" />
         <result column="live_date_" property="liveDate" />
+        <result column="music_date_" property="musicDate" />
+        <result column="video_date_" property="videoDate" />
+        <result column="style_date_" property="styleDate" />
         <result column="browse_" property="browse" />
         <result column="memo_" property="memo" />
         <result column="create_time_" property="createTime" />
@@ -46,7 +49,9 @@
         , t.musician_flag_ as "musicianFlag"
         , t.musician_date_ as "musicianDate"
         , t.live_flag_ as "liveFlag"
-        , t.live_date_ as "liveDate"
+        , t.music_date_ as "musicDate"
+        , t.video_date_ as "videoDate"
+        , t.style_date_ as "styleDate"
         , t.member_rank_setting_id_ as "memberRankSettingId"
         , t.membership_start_time_ as "membershipStartTime"
         , t.membership_end_time_ as "membershipEndTime"