Parcourir la source

流量统计优化

yys il y a 1 jour
Parent
commit
2b9c03fbc2

+ 7 - 7
fs-service/src/main/resources/mapper/course/FsCourseTrafficLogMapper.xml

@@ -263,16 +263,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
         <where>
             <if test="startDate != null and endDate != null">
-                and DATE_FORMAT(a.create_time, '%Y-%m-%d') between #{startDate} AND #{endDate}
+                and a.create_time &gt;= #{startDate} AND a.create_time &lt; DATE_ADD(#{endDate}, INTERVAL 1 DAY)
             </if>
             <if test="companyId !=null">
                 and a.company_id = #{companyId}
             </if>
             <if test="courseId != null">
-                and a.course_id = ${courseId}
+                and a.course_id = #{courseId}
             </if>
             <if test="project != null">
-                and b.project = ${project}
+                and b.project = #{project}
             </if>
             <if test="common == null">
                 AND a.company_id IS not NULL
@@ -283,19 +283,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
 
         <if test="tabType==null or tabType==''">
-            group by company_id,`month`,course_id,project
+            group by a.company_id,`month`,a.course_id,a.project
         </if>
         <if test="tabType!=null and tabType=='project'">
             group by b.project,`month`
         </if>
         <if test="tabType!=null and tabType=='course'">
-            group by course_id,`month`
+            group by a.course_id,`month`
         </if>
         <if test="tabType!=null and tabType=='company'">
-            group by company_id,`month`
+            group by a.company_id,`month`
         </if>
         <if test="tabType!=null and tabType=='common'">
-            group by course_id,`month`
+            group by a.course_id,`month`
         </if>
     </select>