package com.goafanti.common.dao;

import com.goafanti.common.model.NewOrderChange;
import com.goafanti.common.model.NewOrderChangeExample;
import com.goafanti.order.bo.NewOrderChangeBo;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

public interface NewOrderChangeMapper {

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_change
	 * @mbg.generated  Wed Apr 01 08:39:10 CST 2020
	 */
	long countByExample(NewOrderChangeExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_change
	 * @mbg.generated  Wed Apr 01 08:39:10 CST 2020
	 */
	int deleteByExample(NewOrderChangeExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_change
	 * @mbg.generated  Wed Apr 01 08:39:10 CST 2020
	 */
	int deleteByPrimaryKey(Integer id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_change
	 * @mbg.generated  Wed Apr 01 08:39:10 CST 2020
	 */
	int insert(NewOrderChange record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_change
	 * @mbg.generated  Wed Apr 01 08:39:10 CST 2020
	 */
	int insertSelective(NewOrderChange record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_change
	 * @mbg.generated  Wed Apr 01 08:39:10 CST 2020
	 */
	List<NewOrderChange> selectByExample(NewOrderChangeExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_change
	 * @mbg.generated  Wed Apr 01 08:39:10 CST 2020
	 */
	NewOrderChange selectByPrimaryKey(Integer id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_change
	 * @mbg.generated  Wed Apr 01 08:39:10 CST 2020
	 */
	int updateByExampleSelective(@Param("record") NewOrderChange record,
			@Param("example") NewOrderChangeExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_change
	 * @mbg.generated  Wed Apr 01 08:39:10 CST 2020
	 */
	int updateByExample(@Param("record") NewOrderChange record, @Param("example") NewOrderChangeExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_change
	 * @mbg.generated  Wed Apr 01 08:39:10 CST 2020
	 */
	int updateByPrimaryKeySelective(NewOrderChange record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_change
	 * @mbg.generated  Wed Apr 01 08:39:10 CST 2020
	 */
	int updateByPrimaryKey(NewOrderChange record);

	List<NewOrderChangeBo> selectByorderNo(String orderNo);

	int checkOderNo(String orderNo);

	NewOrderChangeBo selectById(Integer id);

	void addRefundInvoice(@Param("orderNo")String orderNo, @Param("amount")BigDecimal amount);

	void subtractRefundInvoice(@Param("orderNo")String orderNo,@Param("amount")BigDecimal amount);


	List<Map<String, String>> getOrderChange(String orderNo);

	NewOrderChangeBo selectByChangeId(String changeId);

	NewOrderChangeBo selectByorderNoAndStatus(String orderNo);
}