<?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.jxst.mapper.sales.SalesContractMapper">
    <select id="getPage" resultType="com.fjhx.jxst.entity.sales.vo.SalesContractVo">
        select
            sc.id,
            sc.code,
            sc.customer_id,
            sc.delivery_date,
            sc.pay_method,
            sc.freight_payer,
            sc.remark,
            sc.create_user,
            sc.create_time,
            sc.update_user,
            sc.update_time,
            (SELECT sum(unit_price * quantity) FROM sales_contract_details WHERE sales_contract_id = sc.id) contractAmount,
            sc.flow_id
        from sales_contract sc
            ${ew.customSqlSegment}
    </select>

</mapper>
