package com.hfkj.dao;

import com.hfkj.entity.BsMerLedgerReceiverApply;
import com.hfkj.entity.BsMerLedgerReceiverApplyExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;

/**
 * 
 * 代码由工具生成,请勿修改!!!
 * 如果需要扩展请在其父类进行扩展
 * 
 **/
@Repository
public interface BsMerLedgerReceiverApplyMapper extends BsMerLedgerReceiverApplyMapperExt {
    @SelectProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="countByExample")
    long countByExample(BsMerLedgerReceiverApplyExample example);

    @DeleteProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="deleteByExample")
    int deleteByExample(BsMerLedgerReceiverApplyExample example);

    @Delete({
        "delete from bs_mer_ledger_receiver_apply",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into bs_mer_ledger_receiver_apply (mer_id, mer_ledger_id, ",
        "mer_ledger_receiver_id, receiver_no, ",
        "order_no, apply_id, ",
        "request_body, response_body, ",
        "notify_body, `status`, ",
        "reject_reason, create_time, ",
        "update_time, ext_1, ",
        "ext_2, ext_3)",
        "values (#{merId,jdbcType=BIGINT}, #{merLedgerId,jdbcType=BIGINT}, ",
        "#{merLedgerReceiverId,jdbcType=BIGINT}, #{receiverNo,jdbcType=VARCHAR}, ",
        "#{orderNo,jdbcType=VARCHAR}, #{applyId,jdbcType=VARCHAR}, ",
        "#{requestBody,jdbcType=VARCHAR}, #{responseBody,jdbcType=VARCHAR}, ",
        "#{notifyBody,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
        "#{rejectReason,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
        "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsMerLedgerReceiverApply record);

    @InsertProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insertSelective(BsMerLedgerReceiverApply record);

    @SelectProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_ledger_id", property="merLedgerId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_ledger_receiver_id", property="merLedgerReceiverId", jdbcType=JdbcType.BIGINT),
        @Result(column="receiver_no", property="receiverNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="apply_id", property="applyId", jdbcType=JdbcType.VARCHAR),
        @Result(column="request_body", property="requestBody", jdbcType=JdbcType.VARCHAR),
        @Result(column="response_body", property="responseBody", jdbcType=JdbcType.VARCHAR),
        @Result(column="notify_body", property="notifyBody", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="reject_reason", property="rejectReason", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
    })
    List<BsMerLedgerReceiverApply> selectByExample(BsMerLedgerReceiverApplyExample example);

    @Select({
        "select",
        "id, mer_id, mer_ledger_id, mer_ledger_receiver_id, receiver_no, order_no, apply_id, ",
        "request_body, response_body, notify_body, `status`, reject_reason, create_time, ",
        "update_time, ext_1, ext_2, ext_3",
        "from bs_mer_ledger_receiver_apply",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_ledger_id", property="merLedgerId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_ledger_receiver_id", property="merLedgerReceiverId", jdbcType=JdbcType.BIGINT),
        @Result(column="receiver_no", property="receiverNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="apply_id", property="applyId", jdbcType=JdbcType.VARCHAR),
        @Result(column="request_body", property="requestBody", jdbcType=JdbcType.VARCHAR),
        @Result(column="response_body", property="responseBody", jdbcType=JdbcType.VARCHAR),
        @Result(column="notify_body", property="notifyBody", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="reject_reason", property="rejectReason", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
    })
    BsMerLedgerReceiverApply selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsMerLedgerReceiverApply record, @Param("example") BsMerLedgerReceiverApplyExample example);

    @UpdateProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsMerLedgerReceiverApply record, @Param("example") BsMerLedgerReceiverApplyExample example);

    @UpdateProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsMerLedgerReceiverApply record);

    @Update({
        "update bs_mer_ledger_receiver_apply",
        "set mer_id = #{merId,jdbcType=BIGINT},",
          "mer_ledger_id = #{merLedgerId,jdbcType=BIGINT},",
          "mer_ledger_receiver_id = #{merLedgerReceiverId,jdbcType=BIGINT},",
          "receiver_no = #{receiverNo,jdbcType=VARCHAR},",
          "order_no = #{orderNo,jdbcType=VARCHAR},",
          "apply_id = #{applyId,jdbcType=VARCHAR},",
          "request_body = #{requestBody,jdbcType=VARCHAR},",
          "response_body = #{responseBody,jdbcType=VARCHAR},",
          "notify_body = #{notifyBody,jdbcType=VARCHAR},",
          "`status` = #{status,jdbcType=INTEGER},",
          "reject_reason = #{rejectReason,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(BsMerLedgerReceiverApply record);
}