package cn.superdesk.uniorder.dao.mapper.operationCenter;

import cn.superdesk.uniorder.dao.entity.operationCenter.OperationCenterPaymentBiz;
import cn.superdesk.uniorder.dao.entity.operationCenter.OperationCenterPaymentBizExample;
import cn.superdesk.uniorder.dto.param.operationCenter.payment.OperationCenterPaymentBizParam;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OperationCenterPaymentBizMapper {
    long countByExample(OperationCenterPaymentBizExample example);

    int deleteByExample(OperationCenterPaymentBizExample example);

    int deleteByPrimaryKey(Long id);

    int insert(OperationCenterPaymentBiz record);

    int insertSelective(OperationCenterPaymentBiz record);

    List<OperationCenterPaymentBiz> selectByExample(OperationCenterPaymentBizExample example);

    OperationCenterPaymentBiz selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") OperationCenterPaymentBiz record, @Param("example") OperationCenterPaymentBizExample example);

    int updateByExample(@Param("record") OperationCenterPaymentBiz record, @Param("example") OperationCenterPaymentBizExample example);

    int updateByPrimaryKeySelective(OperationCenterPaymentBiz record);

    int updateByPrimaryKey(OperationCenterPaymentBiz record);
    @Delete("delete  from tb_operation_center_payment_biz where payment_id = #{paymentId}")
    void deleteByPaymentId(Long paymentId);

    @Select("select * from tb_operation_center_payment_biz where payment_id = #{paymentId}")
    @ResultMap("BaseResultMap")
    List<OperationCenterPaymentBiz> getPaymentBizListByPaymentId(Long paymentId);

    List<OperationCenterPaymentBiz> getPaymentBizListByPayment(List<OperationCenterPaymentBizParam> operationCenterPaymentBizParamList,Long payId);

    /**
     * 根据平台code和业务放支付方式id 查询对应的平台支付方式id
     * @param code
     * @param bizOrderPayTypeId
     * @return
     */
    Long selectPlatformPayTypeByPlatformCodeAndBizType(@Param("platformCode") String code,@Param("bizPayTypeId") String bizOrderPayTypeId);
}