录音统计
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
package com.rj.mapper;
|
||||
|
||||
import com.rj.entity.AudioManagementStatistics;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 门店录音统计表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 李中华 ,spllzh
|
||||
* @since 2025-08-07
|
||||
*/
|
||||
@Mapper
|
||||
public interface AudioManagementStatisticsMapper extends BaseMapper<AudioManagementStatistics> {
|
||||
|
||||
/**
|
||||
* 按门店统计指定日期的录音数据
|
||||
* @param date 统计日期
|
||||
* @return 门店统计结果列表
|
||||
*/
|
||||
@Select("SELECT " +
|
||||
"dealership_id, " +
|
||||
"dealership_name, " +
|
||||
"SUM(duration * 60) as total_duration_seconds, " +
|
||||
"COUNT(*) as recording_count, " +
|
||||
"AVG(duration * 60) as avg_duration_seconds " +
|
||||
"FROM audio_management " +
|
||||
"WHERE DATE(recording_time) = #{date} " +
|
||||
"AND dealership_id IS NOT NULL " +
|
||||
"AND dealership_id != '' " +
|
||||
"GROUP BY dealership_id, dealership_name")
|
||||
List<Map<String, Object>> getDealershipStatisticsByDate(@Param("date") LocalDate date);
|
||||
|
||||
/**
|
||||
* 按销售人员统计指定日期的录音数据
|
||||
* @param date 统计日期
|
||||
* @return 销售人员统计结果列表
|
||||
*/
|
||||
@Select("SELECT " +
|
||||
"sales_id, " +
|
||||
"sales_name, " +
|
||||
"SUM(duration * 60) as total_duration_seconds, " +
|
||||
"COUNT(*) as recording_count, " +
|
||||
"AVG(duration * 60) as avg_duration_seconds " +
|
||||
"FROM audio_management " +
|
||||
"WHERE DATE(recording_time) = #{date} " +
|
||||
"AND sales_id IS NOT NULL " +
|
||||
"AND sales_id != '' " +
|
||||
"GROUP BY sales_id, sales_name")
|
||||
List<Map<String, Object>> getSalesStatisticsByDate(@Param("date") LocalDate date);
|
||||
|
||||
/**
|
||||
* 按项目统计指定日期的录音数据
|
||||
* @param date 统计日期
|
||||
* @return 项目统计结果列表
|
||||
*/
|
||||
@Select("SELECT " +
|
||||
"project_id, " +
|
||||
"project_name, " +
|
||||
"SUM(duration * 60) as total_duration_seconds, " +
|
||||
"COUNT(*) as recording_count, " +
|
||||
"AVG(duration * 60) as avg_duration_seconds " +
|
||||
"FROM audio_management " +
|
||||
"WHERE DATE(recording_time) = #{date} " +
|
||||
"AND project_id IS NOT NULL " +
|
||||
"AND project_id != '' " +
|
||||
"GROUP BY project_id, project_name")
|
||||
List<Map<String, Object>> getProjectStatisticsByDate(@Param("date") LocalDate date);
|
||||
|
||||
/**
|
||||
* 检查指定日期的统计数据是否已存在
|
||||
* @param date 统计日期
|
||||
* @return 统计记录数量
|
||||
*/
|
||||
@Select("SELECT COUNT(*) FROM audio_management_statistics WHERE statistics_date = #{date}")
|
||||
int countByStatisticsDate(@Param("date") LocalDate date);
|
||||
|
||||
/**
|
||||
* 删除指定日期的统计数据
|
||||
* @param date 统计日期
|
||||
* @return 删除的记录数
|
||||
*/
|
||||
int deleteByStatisticsDate(@Param("date") LocalDate date);
|
||||
}
|
||||
Reference in New Issue
Block a user