瀏覽代碼

Merge branch 'feature/1219_opt' of http://git.dayaedu.com/yonge/cooleshow into feature/1219_opt

刘俊驰 5 月之前
父節點
當前提交
7439abde03

+ 24 - 9
cooleshow-user/user-biz/src/main/resources/config/mybatis/HomeMapper.xml

@@ -529,50 +529,65 @@
 	<select id="teacherIncomeList"
 			resultType="com.yonge.cooleshow.biz.dal.wrapper.TeacherIndexWrapper$TeacherIncome">
 		select uo.user_id_ userId,
-		<if test="param.type != 'MUSIC'">
+		<if test="param.type != 'MUSIC' and param.type != 'VIDEO'">
 			cg.course_num_ bizQuantity,
 		</if>
+		<if test="param.type == 'VIDEO'">
+			1 bizQuantity,
+		</if>
 		<if test="param.type == 'MUSIC'">
 			1 bizQuantity,
 		</if>
 		ttar.trans_amount_ amount,uo.create_time_ orderTime,
-		<if test="param.type != 'MUSIC'">
+		<if test="param.type != 'MUSIC' and param.type != 'VIDEO'">
 			cg.id_ bizId,cg.name_ bizName,cg.background_pic_ bizCover
 		</if>
+		<if test="param.type == 'VIDEO'">
+			cg.id_ bizId,cg.lesson_name_ bizName,cg.lesson_cover_url_ bizCover
+		</if>
 		<if test="param.type == 'MUSIC'">
 			cg.cbs_music_sheet_id_ bizId,'' bizName,'' bizCover
 		</if>
 		from tenant_teacher_account_record ttar
 		left join user_order uo ON uo.order_no_ = ttar.order_no_
-		<if test="param.type != 'MUSIC'">
+		<if test="param.type != 'MUSIC' and param.type != 'VIDEO'">
 			left join course_group cg ON cg.id_ = ttar.biz_id_
 		</if>
+		<if test="param.type == 'VIDEO'">
+			left join video_lesson_group cg ON cg.id_ = ttar.biz_id_
+		</if>
 		<if test="param.type == 'MUSIC'">
 			left join music_sheet cg ON cg.id_ = ttar.biz_id_
 		</if>
 		where uo.status_ = 'PAID' AND ttar.in_or_out_ = 'IN'
-		AND uo.create_time_ BETWEEN #{param.startTime} AND #{param.endTime} AND ttar.teacher_id_ = #{param.teacherId}
+		AND DATE_FORMAT(uo.create_time_,'%Y-%m-%d') BETWEEN #{param.startTime} AND #{param.endTime} AND ttar.teacher_id_ = #{param.teacherId}
 		AND ttar.biz_type_ = #{param.type}
 		UNION ALL
 		select uo.user_id_ userId,COUNT(ucar.id_) bizQuantity,SUM(ucar.trans_amount_) amount,
 		       uo.create_time_ orderTime,
-		<if test="param.type != 'MUSIC'">
+		<if test="param.type != 'MUSIC' and param.type != 'VIDEO'">
 			cg.id_ bizId,cg.name_ bizName,cg.background_pic_ bizCover
 		</if>
+		<if test="param.type == 'VIDEO'">
+			cg.id_ bizId,cg.lesson_name_ bizName,cg.lesson_cover_url_ bizCover
+		</if>
 		<if test="param.type == 'MUSIC'">
 			cg.cbs_music_sheet_id_ bizId,'' bizName,'' bizCover
 		</if>
 		from user_cash_account_record ucar
 		left join user_order uo ON uo.order_no_ = ucar.order_no_
-		<if test="param.type != 'MUSIC'">
+		<if test="param.type != 'MUSIC' and param.type != 'VIDEO'">
 			left join course_schedule cs ON cs.id_ = ucar.biz_id_
 			left join course_group cg ON cg.id_ = cs.course_group_id_
 		</if>
+		<if test="param.type == 'VIDEO'">
+			left join video_lesson_group cg ON cg.id_ = ucar.biz_id_
+		</if>
 		<if test="param.type == 'MUSIC'">
 			left join music_sheet cg ON cg.id_ = ucar.biz_id_
 		</if>
 		where uo.status_ = 'PAID' AND ucar.in_or_out_ = 'IN'
-		AND uo.create_time_ BETWEEN #{param.startTime} AND #{param.endTime} AND ucar.account_id_ = #{param.teacherId}
+		AND DATE_FORMAT(uo.create_time_,'%Y-%m-%d') BETWEEN #{param.startTime} AND #{param.endTime} AND ucar.account_id_ = #{param.teacherId}
 		AND ucar.biz_type_ = #{param.type}
 		group by ucar.order_no_
 		order by orderTime desc
@@ -583,14 +598,14 @@
 			from tenant_teacher_account_record ttar
 			left join user_order uo ON uo.order_no_ = ttar.order_no_
 			where uo.status_ = 'PAID' AND ttar.in_or_out_ = 'IN'
-			  AND uo.create_time_ BETWEEN #{param.startTime} AND #{param.endTime} AND ttar.teacher_id_ = #{param.teacherId}
+			  AND DATE_FORMAT(uo.create_time_,'%Y-%m-%d') BETWEEN #{param.startTime} AND #{param.endTime} AND ttar.teacher_id_ = #{param.teacherId}
 			  AND ttar.biz_type_ = #{param.type}
 			UNION ALL
 			select SUM(ucar.trans_amount_) amount
 			from user_cash_account_record ucar
 			left join user_order uo ON uo.order_no_ = ucar.order_no_
 			where uo.status_ = 'PAID' AND ucar.in_or_out_ = 'IN'
-			  AND uo.create_time_ BETWEEN #{param.startTime} AND #{param.endTime} AND ucar.account_id_ = #{param.teacherId}
+			  AND DATE_FORMAT(uo.create_time_,'%Y-%m-%d') BETWEEN #{param.startTime} AND #{param.endTime} AND ucar.account_id_ = #{param.teacherId}
 			  AND ucar.biz_type_ = #{param.type}
 			) a
 	</select>

+ 14 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/UserOrderDetailMapper.xml

@@ -152,6 +152,7 @@
     </select>
     <select id="liveBuyTotal"
             resultType="com.yonge.cooleshow.biz.dal.wrapper.TeacherIndexWrapper$CourseExposureTotal">
+        select c.type,SUM(c.exposureNum) exposureNum,c.date from (
         select uod.good_type_ type,COUNT(distinct uod.order_no_) exposureNum,
                DATE_FORMAT(uod.create_time_,#{groupBy}) 'date' from user_order_detail uod
         left join user_order uo ON uo.order_no_ = uod.order_no_
@@ -161,7 +162,19 @@
         <if test="param.type != null and param.type != ''">
             and uod.good_type_ = #{param.type}
         </if>
-        group by DATE_FORMAT(uod.create_time_,#{groupBy}) order by 'date'
+        group by DATE_FORMAT(uod.create_time_,#{groupBy})
+        UNION ALL
+        select uod.good_type_ type,COUNT(distinct uod.order_no_) exposureNum,
+        DATE_FORMAT(uod.create_time_,#{groupBy}) 'date' from user_order_detail uod
+        left join user_order uo ON uo.order_no_ = uod.order_no_
+        left join video_lesson_group cg On cg.id_ = uod.biz_id_
+        where cg.teacher_id_ = #{param.teacherId} AND uo.status_ = 'PAID'
+        AND DATE_FORMAT(uod.create_time_, '%Y-%m-%d') BETWEEN #{param.startTime} AND #{param.endTime}
+        <if test="param.type != null and param.type != ''">
+            and uod.good_type_ = #{param.type}
+        </if>
+        group by DATE_FORMAT(uod.create_time_,#{groupBy})) c
+        group by c.date ORDER BY c.date
     </select>
     <select id="videoBuyTotal"
             resultType="com.yonge.cooleshow.biz.dal.wrapper.TeacherIndexWrapper$CourseExposureTotal">