package com.bailuntec.mapper;

import com.bailuntec.domain.entity.DcMidTransit;
import com.bailuntec.domain.example.DcMidTransitExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

public interface DcMidTransitMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_mid_transit
     *
     * @mbg.generated
     */
    long countByExample(DcMidTransitExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_mid_transit
     *
     * @mbg.generated
     */
    int deleteByExample(DcMidTransitExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_mid_transit
     *
     * @mbg.generated
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_mid_transit
     *
     * @mbg.generated
     */
    int insert(DcMidTransit record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_mid_transit
     *
     * @mbg.generated
     */
    int insertSelective(DcMidTransit record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_mid_transit
     *
     * @mbg.generated
     * @project https://github.com/itfsw/mybatis-generator-plugin
     */
    DcMidTransit selectOneByExample(DcMidTransitExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_mid_transit
     *
     * @mbg.generated
     */
    List<DcMidTransit> selectByExample(DcMidTransitExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_mid_transit
     *
     * @mbg.generated
     */
    DcMidTransit selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_mid_transit
     *
     * @mbg.generated
     */
    int updateByExampleSelective(@Param("record") DcMidTransit record, @Param("example") DcMidTransitExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_mid_transit
     *
     * @mbg.generated
     */
    int updateByExample(@Param("record") DcMidTransit record, @Param("example") DcMidTransitExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_mid_transit
     *
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(DcMidTransit record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_mid_transit
     *
     * @mbg.generated
     */
    int updateByPrimaryKey(DcMidTransit record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_mid_transit
     *
     * @mbg.generated
     * @project https://github.com/itfsw/mybatis-generator-plugin
     */
    int upsert(DcMidTransit record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_mid_transit
     *
     * @mbg.generated
     * @project https://github.com/itfsw/mybatis-generator-plugin
     */
    int upsertSelective(DcMidTransit record);

    void calculateTransferTransit();

    void calculatePurchaseTransit();

    void insertMidDailyTransit();

    void calculateOutStock();

    @Select("select @@tx_isolation;")
    String printTransactionLevel();

    void updateOldTransferToZero(@Param("transferModified") LocalDateTime transferModified);
    void updateOldPurchaseToZero(@Param("purchaseModified") LocalDateTime purchaseModified);
    void updateOldOutStockToZero(@Param("outStockModified") LocalDateTime outStockModified);

    LocalDateTime selectMaxOutStockModified();
    LocalDateTime selectMaxTransferModified();
    LocalDateTime selectMaxPurchaseModified();
    LocalDateTime selectMaxUnshippedModified();

    void updateOldUnshippedToZero(@Param("unshippedModified") LocalDateTime unshippedModified);

    void calculateUnshipped();
}