package org.dromara.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.dromara.system.domain.SystemStatistics;

import java.util.List;
import java.util.Map;


public interface SystemStatisticsMapper extends BaseMapper<SystemStatistics> {


    @Select("SELECT " +
        "DATE_FORMAT(date, '%Y-%m') AS month, " +
        "SUM(login_member_count) AS loginMemberCount, " +
        "SUM(register_member_count) AS registerMemberCount, " +
        "SUM(add_cart_member_count) AS addCartMemberCount, " +
        "SUM(deal_member_count) AS dealMemberCount " +
        "FROM aws_system_statistics " +
        "GROUP BY DATE_FORMAT(date, '%Y-%m') " +
        "ORDER BY DATE_FORMAT(date, '%Y-%m')")
    List<Map<String, Object>> getMonthlyUserVolume();

}
