修改--每日任务重daily_sys添加统计资源位被购买总数

This commit is contained in:
haotian 2025-04-14 17:17:33 +08:00
parent bc04b99b4c
commit 463f7dba2c
5 changed files with 26 additions and 0 deletions

View File

@ -538,6 +538,9 @@ public class dailySysServer {
System.out.println("昨天收入总额为:"+tIncome+" 昨天退款总额为:"+tRefund);
// 资源位被购买总数
Long dBought = dailySourceService.getdBought(oneDayAgo);
// 昨天的统计数据
DailySys dailySys1 = new DailySys();
dailySys1.setDate(oneDayAgo);
@ -550,6 +553,7 @@ public class dailySysServer {
dailySys1.settRefund(tRefund);
dailySys1.settInteractions(tInteractions);
dailySys1.settShares(tShares);
dailySys1.setdBought(dBought);
//----------------------------------------------测试注释-------------------------------------------------------
// 插入数据, 这里默认不会重复插入
int back = dailySysService.insertDailySys(dailySys1);

View File

@ -78,4 +78,9 @@ public interface DailySourceMapper
* */
public DailySource getDailySourceBySourceIdAndDate(@Param("sourceId") Long sourceId, @Param("date") LocalDate date);
/**
* 返回每天资源位被购买的数量
* */
public Long getdBought(@Param("date") LocalDate date);
}

View File

@ -76,4 +76,9 @@ public interface IDailySourceService
* 根据资源位id和日期查询资源位每天统计
* */
public DailySource getDailySourceBySourceIdAndDate(Long sourceId, LocalDate date);
/**
* 返回每天资源位被购买的数量
* */
public Long getdBought(LocalDate date);
}

View File

@ -118,4 +118,12 @@ public class DailySourceServiceImpl implements IDailySourceService
public DailySource getDailySourceBySourceIdAndDate(Long sourceId, LocalDate date){
return dailySourceMapper.getDailySourceBySourceIdAndDate(sourceId,date);
}
/**
* 返回每天资源位被购买的数量
* */
@Override
public Long getdBought(LocalDate date){
return dailySourceMapper.getdBought(date);
}
}

View File

@ -68,6 +68,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select * from daily_source
where source_id = #{sourceId} and date = #{date}
</select>
<select id="getdBought" resultType="java.lang.Long">
select sum(bought) from daily_source
where date = #{date}
</select>
<insert id="insertDailySource" parameterType="DailySource" useGeneratedKeys="true" keyProperty="dailySourceId">
insert into daily_source