package com.red.circle.game.fruit.infrastructure.database.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.red.circle.framework.mybatis.dao.BaseDAO;
import com.red.circle.game.fruit.infrastructure.database.entity.GameFruitDaysRecord;
import com.red.circle.game.fruit.inner.model.cmd.PageDaysRecordQryCmd;
import com.red.circle.game.fruit.inner.model.dto.PageGameFruitDaysRecordDTO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 每日游戏记录 DAO 接口.
 * </p>
 *
 * @author lisizhe on  2023-11-30 19:18
 */
public interface GameFruitDaysRecordDAO extends BaseDAO<GameFruitDaysRecord> {

  IPage<PageGameFruitDaysRecordDTO> pageGameFruitDaysRecord(IPage<GameFruitDaysRecord> page,
      @Param("cmd") PageDaysRecordQryCmd cmd);

  @Select("SELECT * FROM game_fruit_days_record WHERE `date` = #{date} AND `sys_origin` = #{sysOrigin}")
  GameFruitDaysRecord getToDayForUpdate(@Param("date") String date, @Param("sysOrigin") String sysOrigin);
}
