|
|
@@ -137,6 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="companyId != null">company_id,</if>
|
|
|
<if test="courseId != null">course_id,</if>
|
|
|
<if test="uuId != null">uu_id,</if>
|
|
|
+ <if test="project != null">project,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="userId != null">#{userId},</if>
|
|
|
@@ -149,6 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="companyId != null">#{companyId},</if>
|
|
|
<if test="courseId != null">#{courseId},</if>
|
|
|
<if test="uuId != null">#{uuId},</if>
|
|
|
+ <if test="project != null">#{project},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
@@ -165,6 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="companyId != null">company_id,</if>
|
|
|
<if test="courseId != null">course_id,</if>
|
|
|
<if test="uuId != null">uu_id,</if>
|
|
|
+ <if test="project != null">project,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="userId != null">#{userId},</if>
|
|
|
@@ -177,6 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="companyId != null">#{companyId},</if>
|
|
|
<if test="courseId != null">#{courseId},</if>
|
|
|
<if test="uuId != null">#{uuId},</if>
|
|
|
+ <if test="project != null">#{project},</if>
|
|
|
</trim>
|
|
|
on duplicate key update
|
|
|
<trim suffixOverrides=",">
|
|
|
@@ -247,26 +251,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</insert>
|
|
|
|
|
|
<select id="selectTrafficNew" resultType="com.fs.course.vo.FsCourseTrafficLogListVO">
|
|
|
- select company_id,project,course_id,SUM(internet_traffic) AS total_internet_traffic
|
|
|
- ,DATE_FORMAT(create_time, '%Y-%m-%d') AS `month` from fs_course_traffic_log
|
|
|
+ select a.company_id,
|
|
|
+ <if test="tabType!=null and tabType=='project'">
|
|
|
+ b.project,
|
|
|
+ </if>
|
|
|
+
|
|
|
+ a.course_id,SUM(a.internet_traffic) AS total_internet_traffic
|
|
|
+ ,DATE_FORMAT(a.create_time, '%Y-%m-%d') AS `month` from fs_course_traffic_log a
|
|
|
+ <if test="tabType!=null and tabType=='project'">
|
|
|
+ left join fs_user_course b on a.course_id = b.course_id
|
|
|
+ </if>
|
|
|
<where>
|
|
|
<if test="startDate != null and endDate != null">
|
|
|
- and DATE_FORMAT(create_time, '%Y-%m-%d') between #{startDate} AND #{endDate}
|
|
|
+ and DATE_FORMAT(a.create_time, '%Y-%m-%d') between #{startDate} AND #{endDate}
|
|
|
</if>
|
|
|
<if test="companyId !=null">
|
|
|
- and company_id = #{companyId}
|
|
|
+ and a.company_id = #{companyId}
|
|
|
</if>
|
|
|
<if test="courseId != null">
|
|
|
- and course_id = ${courseId}
|
|
|
+ and a.course_id = ${courseId}
|
|
|
</if>
|
|
|
<if test="project != null">
|
|
|
- and project = ${project}
|
|
|
+ and b.project = ${project}
|
|
|
</if>
|
|
|
<if test="common == null">
|
|
|
- AND company_id IS not NULL
|
|
|
+ AND a.company_id IS not NULL
|
|
|
</if>
|
|
|
<if test="common != null ">
|
|
|
- AND company_id IS NULL
|
|
|
+ AND a.company_id IS NULL
|
|
|
</if>
|
|
|
</where>
|
|
|
|
|
|
@@ -274,7 +286,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
group by company_id,`month`,course_id,project
|
|
|
</if>
|
|
|
<if test="tabType!=null and tabType=='project'">
|
|
|
- group by project,`month`
|
|
|
+ group by b.project,`month`
|
|
|
</if>
|
|
|
<if test="tabType!=null and tabType=='course'">
|
|
|
group by course_id,`month`
|