fix:团队统计修改

This commit is contained in:
old burden 2026-04-21 16:33:53 +08:00
parent 7b4395761c
commit 28e51137c5
2 changed files with 9 additions and 8 deletions

View File

@ -20,7 +20,6 @@ import com.ruoyi.ai.domain.AiVideoReportData;
import com.ruoyi.ai.service.IAiVideoReportDataService; import com.ruoyi.ai.service.IAiVideoReportDataService;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.StringUtils;
/** /**
* AI视频生成统计数据作为其他统计报的数据源Controller * AI视频生成统计数据作为其他统计报的数据源Controller
@ -42,10 +41,6 @@ public class AiVideoReportDataController extends BaseController
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(AiVideoReportData aiVideoReportData) public TableDataInfo list(AiVideoReportData aiVideoReportData)
{ {
if (StringUtils.isEmpty(aiVideoReportData.getStatDate()) || aiVideoReportData.getDeptId() == null)
{
return getDataTable(java.util.Collections.emptyList());
}
startPage(); startPage();
List<AiVideoReportData> list = aiVideoReportDataService.selectTeamDailyConsumeList( List<AiVideoReportData> list = aiVideoReportDataService.selectTeamDailyConsumeList(
aiVideoReportData.getStatDate(), aiVideoReportData.getDeptId()); aiVideoReportData.getStatDate(), aiVideoReportData.getDeptId());

View File

@ -84,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTeamDailyConsumeList" resultMap="AiVideoReportDataResult"> <select id="selectTeamDailyConsumeList" resultMap="AiVideoReportDataResult">
select select
concat(substr(vrd.date_key, 1, 4), '-', substr(vrd.date_key, 5, 2), '-', substr(vrd.date_key, 7, 2)) as date_key, concat(substr(substr(vrd.date_key, 1, 8), 1, 4), '-', substr(substr(vrd.date_key, 1, 8), 5, 2), '-', substr(substr(vrd.date_key, 1, 8), 7, 2)) as date_key,
vrd.dept_id, vrd.dept_id,
d.dept_name, d.dept_name,
sum(vrd.recharge_score) as recharge_score, sum(vrd.recharge_score) as recharge_score,
@ -93,8 +93,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sum(vrd.use_tokens) as use_tokens sum(vrd.use_tokens) as use_tokens
from ai_video_report_data vrd from ai_video_report_data vrd
left join sys_dept d on d.dept_id = vrd.dept_id left join sys_dept d on d.dept_id = vrd.dept_id
where vrd.date_key like concat(#{statDate}, '%') <where>
<if test="statDate != null and statDate != ''">
and vrd.date_key like concat(#{statDate}, '%')
</if>
<if test="deptId != null">
and vrd.dept_id = #{deptId} and vrd.dept_id = #{deptId}
</if>
</where>
group by substr(vrd.date_key, 1, 8), vrd.dept_id, d.dept_name group by substr(vrd.date_key, 1, 8), vrd.dept_id, d.dept_name
order by substr(vrd.date_key, 1, 8) desc, vrd.dept_id desc order by substr(vrd.date_key, 1, 8) desc, vrd.dept_id desc
</select> </select>