<?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.after.AfterSalesRecordMapper">
    <select id="getPage" resultType="com.fjhx.jxst.entity.after.vo.AfterSalesRecordVo">
        select asr.id,
               asr.product_sn,
               asr.after_sales_person_id,
               asr.remark,
               asr.code,
               asr.product_id,
               asr.status,
               asr.create_user,
               asr.create_time,
               asr.update_user,
               asr.update_time,
               asr.after_sales_remark,
               asr.amount
        from after_sales_record asr
                 LEFT JOIN bytesailing_mes.production_task_detail ptd ON ptd.product_sn = asr.product_sn
                 JOIN bytesailing_mes.production_task pt ON ptd.production_task_id = pt.id
                 JOIN bytesailing_mes.production_plan pp ON pt.production_plan_id = pp.id
                 JOIN bytesailing_mes.work_order wo ON pp.work_order_id = wo.id
                 JOIN sales_contract_details scd ON wo.contract_details_id = scd.id
            ${ew.customSqlSegment}
    </select>

</mapper>
