|
@@ -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>
|