package com.github.wxiaoqi.security.admin.mapper;

import com.github.wxiaoqi.security.admin.entity.CompanyInfoOrder;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;
import tk.mybatis.mapper.common.Mapper;

import java.math.BigDecimal;

public interface CompanyInfoOrderMapper extends Mapper<CompanyInfoOrder>, SelectByIdListMapper<CompanyInfoOrder,Long> {


    @Select("SELECT IFNULL(SUM(real_amount),0) FROM company_info_order WHERE branch_apply_id=#{branchApplyId} and pay_status =1")
    BigDecimal payAmount(Long branchApplyId);
}