|
@@ -19,14 +19,18 @@
|
|
|
left join teacher t ON t.tenant_id_ = ti.id_ AND t.lock_flag_ = 0
|
|
|
group by ti.id_
|
|
|
</select>
|
|
|
- <select id="indexSum"
|
|
|
- resultType="com.yonge.cooleshow.biz.dal.wrapper.TenantPersonStatWrapper$TenantPersonStatDto">
|
|
|
+ <resultMap id="TenantPersonStatDto" type="com.yonge.cooleshow.biz.dal.wrapper.TenantPersonStatWrapper$TenantPersonStatDto">
|
|
|
+ <result property="studentNum" column="studentNum"/>
|
|
|
+ <result property="teacherNum" column="teacherNum"/>
|
|
|
+ <result property="date" column="date"/>
|
|
|
+ </resultMap>
|
|
|
+ <select id="indexSum" resultMap="TenantPersonStatDto">
|
|
|
SELECT DATE_FORMAT(day_,#{query.format}) date,SUM(student_num_) studentNum,SUM(teacher_num_) teacherNum FROM tenant_person_stat
|
|
|
WHERE tenant_id_ = #{query.tenantId} AND day_ BETWEEN #{query.startTime} AND #{query.endTime}
|
|
|
GROUP BY ${query.groupBy}
|
|
|
</select>
|
|
|
<select id="sumByNow" resultType="com.yonge.cooleshow.biz.dal.wrapper.TenantPersonStatWrapper$TenantPersonStat">
|
|
|
- select COUNT(s.user_id_) studentNum,COUNT(t.user_id_) teacherNum from tenant_info ti
|
|
|
+ select COUNT(distinct s.user_id_) studentNum,COUNT(distinct t.user_id_) teacherNum from tenant_info ti
|
|
|
left join student s ON s.tenant_id_ = ti.id_ AND s.lock_flag_ = 0
|
|
|
left join teacher t ON t.tenant_id_ = ti.id_ AND t.lock_flag_ = 0
|
|
|
where ti.id_ = #{tenantId}
|