<?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.mes.mapper.production.ProductionReportingDetailMapper">
    <select id="getPage" resultType="com.fjhx.mes.entity.production.vo.ProductionReportingDetailVo">
        SELECT prd.id,
               prd.production_processes_id,
               prd.production_task_id,
               prd.quantity,
               prd.create_user,
               prd.create_time,
               prd.update_user,
               prd.update_time,
               po.`code` AS orderCode,
               pp.`name` AS processesName,
               prd.company_id,
               prd.user_id,
               pod.product_id
        FROM production_reporting_detail prd
                 LEFT JOIN production_order_detail pod ON prd.production_task_id = pod.id
                 LEFT JOIN production_order po ON pod.produce_order_id = po.id
                 LEFT JOIN production_processes pp ON prd.production_processes_id = pp.id
            ${ew.customSqlSegment}
    </select>

</mapper>
