package com.platform.yijia.dao;

import com.platform.yijia.pojo.AppUserInfo;
import com.platform.yijia.pojo.CustomerManage;
import com.platform.yijia.pojo.PayOrder;
import com.platform.yijia.pojo.PayOrderExample;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

public interface PayOrderMapper {

    //查询汇总数据
    List<Map> selectSum(PayOrder payOrder);

    /*
     * 根据用户openId和用户类型userType查询用户订单
     * @param payOrder
     * @return
     */
    List<PayOrder> getOrderListByOpenIdAndUserType(AppUserInfo appUserInfo);

    /*
     *修改订单状态
     */
    int updateOrderStatus(PayOrder payOrder);

    /*
     * 查询客户是否已存在
     * @param customerManage
     * @return
     */
    CustomerManage isExistCustomer(CustomerManage customerManage);

    /*
     * 根据用户登录openId 获取用户信息用于插入客户表
     * @param appUserInfo
     * @return
     */
    List<AppUserInfo> getUserInfoByOpenId(AppUserInfo appUserInfo);

    /*
     *  插入客户
     * @param customerManage
     * @return
     */
    void insertCustomer(CustomerManage customerManage);

    /*
     *  根据手机号更新客户表
     * @param customerManage
     */
    void updateCustomerByPhoneNumber(CustomerManage customerManage);

    /*
     *  生成订单时更新客户表
     * @param customerManage
     * @return
     */
    void updateCustomer(CustomerManage customerManage);

    /*
     * 根据订单号查询订单信息和用户信息  注：此方法在随行付回调校验之后修改状态完成后
     * @param payOrder
     * @return
     */
    Map<String, Object> getOrderInfoAndUserInfoByOrderNo(PayOrder payOrder);

    /***
     * 根据油品名称和油站查询油品调价信息
     * @param map
     * @return
     */
    List<Map> selectOilPriceAdjust(Map<String, Object> map);

    /***
     * 根据油品名称和油站查询油枪编号,油站名称,价格,加油员
     * @param map
     * @return
     */
    List<Map> selectOilGunNoAndOilPrice(Map<String, Object> map);

    //查询加油员
    List<Map> selectPersonelName(Map<String, Object> map);

    //查询班结订单
    List<PayOrder> selectPayOrderList(PayOrder payOrder);

    PayOrder getPayOrderInfoMin(PayOrder payOrder);


    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table pay_order
     *
     * @mbg.generated
     */
    long countByExample(PayOrderExample example);

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

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

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

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

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

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table pay_order
     *
     * @mbg.generated
     */
    PayOrder selectByPrimaryKey(Integer orderId);

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

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

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

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