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

import cn.superdesk.uniorder.dao.entity.operationCenter.OperationCenterPayment;
import cn.superdesk.uniorder.dao.entity.operationCenter.OperationCenterPaymentExample;
import java.util.List;
import java.util.Map;

import cn.superdesk.uniorder.dto.param.operationCenter.operators.OperationCenterPaymentCustomerParam;
import cn.superdesk.uniorder.dto.param.operationCenter.payment.OperationCenterPayParam;
import cn.superdesk.uniorder.dto.vo.operationCenter.base.OperationCenterVo;
import cn.superdesk.uniorder.dto.vo.operationCenter.payment.OperationCenterPaymentVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface OperationCenterPaymentMapper {
    long countByExample(OperationCenterPaymentExample example);

    int deleteByExample(OperationCenterPaymentExample example);

    int deleteByPrimaryKey(Long id);

    int insert(OperationCenterPayment record);

    int insertSelective(OperationCenterPayment record);

    List<OperationCenterPayment> selectByExample(OperationCenterPaymentExample example);

    OperationCenterPayment selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") OperationCenterPayment record, @Param("example") OperationCenterPaymentExample example);

    int updateByExample(@Param("record") OperationCenterPayment record, @Param("example") OperationCenterPaymentExample example);

    int updateByPrimaryKeySelective(OperationCenterPayment record);

    int updateByPrimaryKey(OperationCenterPayment record);

    List<OperationCenterPaymentVo> getOperationCenterPaymentList(OperationCenterPayParam param);

    @Select("SELECT t.id code,t.`name`  FROM tb_operation_center_payment t  where deleted = 0 and enabled=1 and ( " +
            "t.associate_type = 2 or t.id in (SELECT payment_id FROM unified_payment_customer WHERE customer_id=#{customerId})  )")
    List<OperationCenterVo> getPaymentByCustomerId(Long customerId);

    OperationCenterPaymentCustomerParam linkCustomerByPaymentId(String paymentId);


    OperationCenterPayment getPaymentByConditions(Map<String,Object> conditions);
}