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

import cn.superdesk.uniorder.dao.entity.operationCenter.UnifiedCustomerInvoiceTitle;

import java.util.List;
import java.util.Map;

import cn.superdesk.uniorder.dto.param.operationCenter.base.OperationCenterBaseParam;
import cn.superdesk.uniorder.dto.vo.operationCenter.customer.OperationCenterBillStartVo;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

public interface UnifiedBillStartMapper {

    /**
     * 软删除
     */
    int deleteByPrimaryKey(Long id);

    int insert(UnifiedCustomerInvoiceTitle record);

    int insertSelective(UnifiedCustomerInvoiceTitle record);

    UnifiedCustomerInvoiceTitle selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(UnifiedCustomerInvoiceTitle record);

    int updateByPrimaryKey(UnifiedCustomerInvoiceTitle record);

    List<OperationCenterBillStartVo> getBillStartListByCustomerId(OperationCenterBaseParam param);

    @Select("select COUNT(1) from unified_customer_invoice_title where customer_id =#{customerId} and deleted=0")
    int countBillStartByCustomerId(Long customerId);
    @Select("select * from unified_customer_invoice_title where deleted=0 and id=#{id}")
    @ResultMap("BaseResultMap")
    UnifiedCustomerInvoiceTitle getUnifiedBillStartById(Long id);

    /**
     * 修改开票抬头 默认
     */
    int updateBillStartIsDefault(Map<String, Object> conditions);
}