package com.haha.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.haha.entity.ReplenishmentOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 补货单Mapper
 */
@Mapper
public interface ReplenishmentOrderMapper extends BaseMapper<ReplenishmentOrder> {

    /**
     * 查询当天最大单号（用于生成新单号）
     */
    @Select("SELECT MAX(order_no) FROM t_replenishment_order WHERE order_no LIKE CONCAT('RO', DATE_FORMAT(NOW(), '%Y%m%d'), '%')")
    String selectMaxOrderNoToday();
}
