|
@@ -121,11 +121,10 @@
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
<select id="queryRewardCount" resultType="java.lang.Long">
|
|
<select id="queryRewardCount" resultType="java.lang.Long">
|
|
- select count(*) from company_red_package_logs rpl
|
|
|
|
|
|
+ select count(*) from fs_course_red_packet_log rpl
|
|
left join fs_course_watch_log log
|
|
left join fs_course_watch_log log
|
|
on rpl.watch_log_id=log.log_id
|
|
on rpl.watch_log_id=log.log_id
|
|
<where>
|
|
<where>
|
|
- rpl.operate_type=1
|
|
|
|
<if test="startTime != null and endTime != null">
|
|
<if test="startTime != null and endTime != null">
|
|
and rpl.create_time BETWEEN #{startTime} AND #{endTime}
|
|
and rpl.create_time BETWEEN #{startTime} AND #{endTime}
|
|
</if>
|
|
</if>
|
|
@@ -138,11 +137,10 @@
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
<select id="queryRewardMoney" resultType="java.math.BigDecimal">
|
|
<select id="queryRewardMoney" resultType="java.math.BigDecimal">
|
|
- select sum(up_money) from company_red_package_logs rpl
|
|
|
|
|
|
+ select sum(rpl.amount) from fs_course_red_packet_log rpl
|
|
left join fs_course_watch_log log
|
|
left join fs_course_watch_log log
|
|
on rpl.watch_log_id=log.log_id
|
|
on rpl.watch_log_id=log.log_id
|
|
<where>
|
|
<where>
|
|
- rpl.operate_type=1
|
|
|
|
<if test="startTime != null and endTime != null">
|
|
<if test="startTime != null and endTime != null">
|
|
and rpl.create_time BETWEEN #{startTime} AND #{endTime}
|
|
and rpl.create_time BETWEEN #{startTime} AND #{endTime}
|
|
</if>
|
|
</if>
|
|
@@ -280,14 +278,12 @@
|
|
<if test="dataType == 1">
|
|
<if test="dataType == 1">
|
|
rpl.course_id as course_id,
|
|
rpl.course_id as course_id,
|
|
</if>
|
|
</if>
|
|
- SUM(rpl.money) as rewardMoney
|
|
|
|
|
|
+ SUM(rpl.amount) as rewardMoney
|
|
FROM
|
|
FROM
|
|
- company_red_package_logs rpl
|
|
|
|
- left join fs_course_watch_log log
|
|
|
|
- on rpl.watch_log_id=log.log_id
|
|
|
|
|
|
+ fs_course_red_packet_log rpl
|
|
|
|
+ left join fs_course_watch_log log
|
|
|
|
+ on rpl.watch_log_id=log.log_id
|
|
<where>
|
|
<where>
|
|
- rpl.operate_type = 1
|
|
|
|
- AND rpl.status = 1
|
|
|
|
<if test="startTime != null">
|
|
<if test="startTime != null">
|
|
AND rpl.create_time <![CDATA[>=]]> #{startTime}
|
|
AND rpl.create_time <![CDATA[>=]]> #{startTime}
|
|
</if>
|
|
</if>
|
|
@@ -322,8 +318,8 @@
|
|
<if test="type == 2 or type == 3 or type == 4">
|
|
<if test="type == 2 or type == 3 or type == 4">
|
|
DATE_FORMAT(rpl.create_time, '%Y-%m-%d') AS start_date,
|
|
DATE_FORMAT(rpl.create_time, '%Y-%m-%d') AS start_date,
|
|
</if>
|
|
</if>
|
|
- SUM(rpl.money) as rewardMoney
|
|
|
|
- from company_red_package_logs rpl
|
|
|
|
|
|
+ SUM(rpl.amount) as rewardMoney
|
|
|
|
+ from fs_course_red_packet_log rpl
|
|
left join fs_course_watch_log log
|
|
left join fs_course_watch_log log
|
|
on rpl.watch_log_id=log.log_id
|
|
on rpl.watch_log_id=log.log_id
|
|
<where>
|
|
<where>
|
|
@@ -339,13 +335,11 @@
|
|
<if test="companyId != null">
|
|
<if test="companyId != null">
|
|
and log.company_id = ${companyId}
|
|
and log.company_id = ${companyId}
|
|
</if>
|
|
</if>
|
|
- AND rpl.operate_type = 1
|
|
|
|
- AND rpl.status = 1
|
|
|
|
</where>
|
|
</where>
|
|
group by start_date
|
|
group by start_date
|
|
</select>
|
|
</select>
|
|
<select id="getCurrentBalance" resultType="java.math.BigDecimal">
|
|
<select id="getCurrentBalance" resultType="java.math.BigDecimal">
|
|
- select sum(money) from company
|
|
|
|
|
|
+ select sum(money) from company where is_del=0
|
|
</select>
|
|
</select>
|
|
<select id="dealerAggregatedCompanyId" resultType="com.fs.statis.dto.DealerAggregatedDTO">
|
|
<select id="dealerAggregatedCompanyId" resultType="com.fs.statis.dto.DealerAggregatedDTO">
|
|
SELECT
|
|
SELECT
|
|
@@ -381,11 +375,11 @@
|
|
</where>
|
|
</where>
|
|
) AS black_num,
|
|
) AS black_num,
|
|
(select COUNT(*) FROM qw_user
|
|
(select COUNT(*) FROM qw_user
|
|
- <where>
|
|
|
|
- <if test="companyId != null">
|
|
|
|
- company_id = ${companyId}
|
|
|
|
- </if>
|
|
|
|
- </where>
|
|
|
|
|
|
+ <where>
|
|
|
|
+ <if test="companyId != null">
|
|
|
|
+ AND company_id = ${companyId}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
) AS qw_member_num
|
|
) AS qw_member_num
|
|
</select>
|
|
</select>
|
|
<select id="getCurrentBalanceCompanyId" resultType="java.math.BigDecimal">
|
|
<select id="getCurrentBalanceCompanyId" resultType="java.math.BigDecimal">
|
|
@@ -394,6 +388,7 @@
|
|
<if test="companyId != null">
|
|
<if test="companyId != null">
|
|
company_id = #{companyId}
|
|
company_id = #{companyId}
|
|
</if>
|
|
</if>
|
|
|
|
+ AND is_del=0
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|