<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fjhx.purchase.mapper.pay.PayMapper">
    <select id="getPage" resultType="com.fjhx.purchase.entity.pay.vo.PayVo">
        select *
        from pay p
            ${ew.customSqlSegment}
    </select>

    <select id="getPurchasePayAmount" resultType="java.math.BigDecimal">
        SELECT sum(arw.amount * arw.rate)
        FROM pay pay
                 JOIN bytesailing_account.account_payment ap ON ap.business_id = pay.id
                 JOIN bytesailing_account.account_running_water arw ON arw.business_id = ap.id
            ${ew.customSqlSegment}
    </select>

</mapper>
