package com.hai.dao;

import com.hai.entity.HighOrderPre;
import com.hai.entity.HighOrderPreExample;
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 HighOrderPreMapper extends HighOrderPreMapperExt {
    @SelectProvider(type=HighOrderPreSqlProvider.class, method="countByExample")
    long countByExample(HighOrderPreExample example);

    @DeleteProvider(type=HighOrderPreSqlProvider.class, method="deleteByExample")
    int deleteByExample(HighOrderPreExample example);

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

    @Insert({
        "insert into high_order_pre (company_id, merchant_id, ",
        "merchant_store_id, agent_id, ",
        "pre_order_no, order_id, ",
        "order_no, child_order_id, ",
        "pay_real_price, goods_type, ",
        "goods_id, goods_name, ",
        "pre_time, pre_user_id, ",
        "pre_user_name, pre_user_phone, ",
        "pre_user_remark, `status`, ",
        "status_fail_desc, status_cancel_desc, ",
        "reach_time, reach_address, ",
        "op_user_id, op_user_name, ",
        "create_time, update_time, ",
        "ext_1, ext_2, ext_3, ",
        "ext_4, ext_5)",
        "values (#{companyId,jdbcType=BIGINT}, #{merchantId,jdbcType=BIGINT}, ",
        "#{merchantStoreId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ",
        "#{preOrderNo,jdbcType=VARCHAR}, #{orderId,jdbcType=BIGINT}, ",
        "#{orderNo,jdbcType=VARCHAR}, #{childOrderId,jdbcType=BIGINT}, ",
        "#{payRealPrice,jdbcType=DECIMAL}, #{goodsType,jdbcType=INTEGER}, ",
        "#{goodsId,jdbcType=BIGINT}, #{goodsName,jdbcType=VARCHAR}, ",
        "#{preTime,jdbcType=TIMESTAMP}, #{preUserId,jdbcType=BIGINT}, ",
        "#{preUserName,jdbcType=VARCHAR}, #{preUserPhone,jdbcType=VARCHAR}, ",
        "#{preUserRemark,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
        "#{statusFailDesc,jdbcType=VARCHAR}, #{statusCancelDesc,jdbcType=VARCHAR}, ",
        "#{reachTime,jdbcType=TIMESTAMP}, #{reachAddress,jdbcType=VARCHAR}, ",
        "#{opUserId,jdbcType=BIGINT}, #{opUserName,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
        "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, ",
        "#{ext4,jdbcType=VARCHAR}, #{ext5,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(HighOrderPre record);

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

    @SelectProvider(type=HighOrderPreSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
        @Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT),
        @Result(column="merchant_store_id", property="merchantStoreId", jdbcType=JdbcType.BIGINT),
        @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
        @Result(column="pre_order_no", property="preOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT),
        @Result(column="pay_real_price", property="payRealPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="goods_type", property="goodsType", jdbcType=JdbcType.INTEGER),
        @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT),
        @Result(column="goods_name", property="goodsName", jdbcType=JdbcType.VARCHAR),
        @Result(column="pre_time", property="preTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="pre_user_id", property="preUserId", jdbcType=JdbcType.BIGINT),
        @Result(column="pre_user_name", property="preUserName", jdbcType=JdbcType.VARCHAR),
        @Result(column="pre_user_phone", property="preUserPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="pre_user_remark", property="preUserRemark", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="status_fail_desc", property="statusFailDesc", jdbcType=JdbcType.VARCHAR),
        @Result(column="status_cancel_desc", property="statusCancelDesc", jdbcType=JdbcType.VARCHAR),
        @Result(column="reach_time", property="reachTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="reach_address", property="reachAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT),
        @Result(column="op_user_name", property="opUserName", 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),
        @Result(column="ext_4", property="ext4", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_5", property="ext5", jdbcType=JdbcType.VARCHAR)
    })
    List<HighOrderPre> selectByExample(HighOrderPreExample example);

    @Select({
        "select",
        "id, company_id, merchant_id, merchant_store_id, agent_id, pre_order_no, order_id, ",
        "order_no, child_order_id, pay_real_price, goods_type, goods_id, goods_name, ",
        "pre_time, pre_user_id, pre_user_name, pre_user_phone, pre_user_remark, `status`, ",
        "status_fail_desc, status_cancel_desc, reach_time, reach_address, op_user_id, ",
        "op_user_name, create_time, update_time, ext_1, ext_2, ext_3, ext_4, ext_5",
        "from high_order_pre",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
        @Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT),
        @Result(column="merchant_store_id", property="merchantStoreId", jdbcType=JdbcType.BIGINT),
        @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
        @Result(column="pre_order_no", property="preOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT),
        @Result(column="pay_real_price", property="payRealPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="goods_type", property="goodsType", jdbcType=JdbcType.INTEGER),
        @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT),
        @Result(column="goods_name", property="goodsName", jdbcType=JdbcType.VARCHAR),
        @Result(column="pre_time", property="preTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="pre_user_id", property="preUserId", jdbcType=JdbcType.BIGINT),
        @Result(column="pre_user_name", property="preUserName", jdbcType=JdbcType.VARCHAR),
        @Result(column="pre_user_phone", property="preUserPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="pre_user_remark", property="preUserRemark", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="status_fail_desc", property="statusFailDesc", jdbcType=JdbcType.VARCHAR),
        @Result(column="status_cancel_desc", property="statusCancelDesc", jdbcType=JdbcType.VARCHAR),
        @Result(column="reach_time", property="reachTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="reach_address", property="reachAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT),
        @Result(column="op_user_name", property="opUserName", 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),
        @Result(column="ext_4", property="ext4", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_5", property="ext5", jdbcType=JdbcType.VARCHAR)
    })
    HighOrderPre selectByPrimaryKey(Long id);

    @UpdateProvider(type=HighOrderPreSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") HighOrderPre record, @Param("example") HighOrderPreExample example);

    @UpdateProvider(type=HighOrderPreSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") HighOrderPre record, @Param("example") HighOrderPreExample example);

    @UpdateProvider(type=HighOrderPreSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(HighOrderPre record);

    @Update({
        "update high_order_pre",
        "set company_id = #{companyId,jdbcType=BIGINT},",
          "merchant_id = #{merchantId,jdbcType=BIGINT},",
          "merchant_store_id = #{merchantStoreId,jdbcType=BIGINT},",
          "agent_id = #{agentId,jdbcType=BIGINT},",
          "pre_order_no = #{preOrderNo,jdbcType=VARCHAR},",
          "order_id = #{orderId,jdbcType=BIGINT},",
          "order_no = #{orderNo,jdbcType=VARCHAR},",
          "child_order_id = #{childOrderId,jdbcType=BIGINT},",
          "pay_real_price = #{payRealPrice,jdbcType=DECIMAL},",
          "goods_type = #{goodsType,jdbcType=INTEGER},",
          "goods_id = #{goodsId,jdbcType=BIGINT},",
          "goods_name = #{goodsName,jdbcType=VARCHAR},",
          "pre_time = #{preTime,jdbcType=TIMESTAMP},",
          "pre_user_id = #{preUserId,jdbcType=BIGINT},",
          "pre_user_name = #{preUserName,jdbcType=VARCHAR},",
          "pre_user_phone = #{preUserPhone,jdbcType=VARCHAR},",
          "pre_user_remark = #{preUserRemark,jdbcType=VARCHAR},",
          "`status` = #{status,jdbcType=INTEGER},",
          "status_fail_desc = #{statusFailDesc,jdbcType=VARCHAR},",
          "status_cancel_desc = #{statusCancelDesc,jdbcType=VARCHAR},",
          "reach_time = #{reachTime,jdbcType=TIMESTAMP},",
          "reach_address = #{reachAddress,jdbcType=VARCHAR},",
          "op_user_id = #{opUserId,jdbcType=BIGINT},",
          "op_user_name = #{opUserName,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},",
          "ext_4 = #{ext4,jdbcType=VARCHAR},",
          "ext_5 = #{ext5,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(HighOrderPre record);
}