package com.hfkj.dao;

import com.hfkj.entity.BsGasOrderReceipt;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * mapper扩展类
 */
public interface BsGasOrderReceiptMapperExt {

    @Update({
            "<script>" +
             "<foreach collection='list' item='item' separator=';'>",
            " update bs_gas_order_receipt",
            " set apply_no = #{item.applyNo,jdbcType=VARCHAR},",
            " user_receipt_id = #{item.userReceiptId,jdbcType=BIGINT},",
            " company_name = #{item.companyName,jdbcType=VARCHAR},",
            " tax_no = #{item.taxNo,jdbcType=VARCHAR},",
            " contacts_phone = #{item.contactsPhone,jdbcType=VARCHAR},",
            " email = #{item.email,jdbcType=VARCHAR},",
            " agent_id = #{item.agentId,jdbcType=BIGINT},",
            " agent_name = #{item.agentName,jdbcType=VARCHAR},",
            " agent_staff_id = #{item.agentStaffId,jdbcType=BIGINT},",
            " agent_staff_name = #{item.agentStaffName,jdbcType=VARCHAR},",
            " mer_no = #{item.merNo,jdbcType=VARCHAR},",
            " mer_name = #{item.merName,jdbcType=VARCHAR},",
            " order_no = #{item.orderNo,jdbcType=VARCHAR},",
            " order_child_no = #{item.orderChildNo,jdbcType=VARCHAR},",
            " oil_no = #{item.oilNo,jdbcType=VARCHAR},",
            " amount = #{item.amount,jdbcType=DECIMAL},",
            " `status` = #{item.status,jdbcType=INTEGER},",
            " fail_remark = #{item.failRemark,jdbcType=VARCHAR},",
            " create_time = #{item.createTime,jdbcType=TIMESTAMP},",
            " update_time = #{item.updateTime,jdbcType=TIMESTAMP},",
            " ext_1 = #{item.ext1,jdbcType=VARCHAR},",
            " ext_2 = #{item.ext2,jdbcType=VARCHAR},",
            " ext_3 = #{item.ext3,jdbcType=VARCHAR}",
            " where id = #{item.id,jdbcType=BIGINT}",
            "</foreach>",
            "</script>"
    })
    void batchUpdate(@Param("list") List<BsGasOrderReceipt> data);
}
