<?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.sale.mapper.serviceContract.ServiceContractMapper">
    <select id="getPage" resultType="com.fjhx.sale.entity.serviceContract.vo.ServiceContractVo">
        SELECT
            sc.*,
            sum(cc.money) claimAmount,
            cr.status ServiceStatus
        FROM
            service_contract sc
                LEFT JOIN claim_contract cc on sc.id = cc.contract_id
                left join service_contract_record cr on sc.id = cr.service_contract_id
            ${ew.customSqlSegment}
    </select>

</mapper>
