package org.jeecg.modules.system.app.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.system.app.entity.StatisticsInfo;
import org.jeecg.modules.system.app.vo.statistics.FindByStatisticsChartVO;

import java.util.List;

/**
 * @Description: 首页统计表
 * @Author: jeecg-boot
 * @Date:   2025-08-18
 * @Version: V1.0
 */
public interface StatisticsInfoMapper extends BaseMapper<StatisticsInfo> {

    @Select("select * from nm_statistics_info where org_code =#{orgCode} and date_daily =#{dateDaily}")
    StatisticsInfo findByOrgCode(@Param("orgCode") String orgCode ,@Param("dateDaily")  Integer dateDaily);

    @Select("select * from nm_statistics_info where org_code =#{orgCode} order by  date_daily desc limit 1")
    StatisticsInfo findByCode(@Param("orgCode")String orgCode);

    List<FindByStatisticsChartVO> findByOrgCodeAndDay(@Param("orgCode")String orgCode,@Param("dateAsInt") int dateAsInt,@Param("firstDayInt") int firstDayInt);

    List<FindByStatisticsChartVO> findByShopMoneyList(@Param("orgCode")String orgCode,@Param("startTime") int startTime,@Param("endTime")  int endTime);
}
