package com.casic.missiles.mapper.business;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.casic.missiles.dto.business.originRecord.OriginRecordRequest;
import com.casic.missiles.dto.business.originRecord.OriginRecordResponse;
import com.casic.missiles.model.business.BusinessOriginalRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author wangpeng
 * @since 2023-02-02
 */
public interface BusinessOriginalRecordMapper extends BaseMapper<BusinessOriginalRecord> {
    @Select("SELECT IFNULL(max(RIGHT(original_record_code, 12)), 0) from  business_original_record")
    Long selectMaxCode();

    Page<BusinessOriginalRecord> originListPage(Page<BusinessOriginalRecord> page, @Param("request") OriginRecordRequest request);

    List<OriginRecordResponse> originExportList(@Param("request") OriginRecordRequest request);

}
