You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
3.2 KiB
XML

<?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.op.mes.mapper.H5ApiMapper">
<resultMap type="H5" id="H5Result">
<result property="workOrderCode" column="workorder_code"/>
<result property="lineName" column="machine_name"/>
<result property="productName" column="product_name"/>
<result property="category" column="category"/>
<result property="specifications" column="umrez"/>
<result property="StandardStaffing" column="man_standar"/>
<result property="actualEmployment" column="use_man"/>
<result property="productionDuration" column="work_time"/>
<result property="planProduction" column="plan_production"/>
<result property="production" column="quantity_feedback"/>
<result property="parentOrder" column="parent_order"/>
<result property="standardEfficiency" column="standardEfficiency"/>
<result property="actualEfficiency" column="actualEfficiency"/>
<result property="efficiencyAcRate" column="efficiencyAcRate"/>
</resultMap>
<select id="selectMesLineProdceList" parameterType="H5" resultMap="H5Result">
SELECT
mrws.workorder_code,
mrws.machine_name,
mrws.product_name,
bpa.category,
bp.umrez,
mrws.quantity as plan_production,
mrws.quantity_feedback ,
mlp.use_man as man_standar,
mrws.use_man,
mrws.work_time,
CAST(ROUND(mlp.efficiency / mlp.attr1 / mlp.use_man, 1) AS FLOAT) AS standardEfficiency,
CAST(ROUND(mrws.quantity_feedback / mrws.work_time / mrws.use_man, 1) AS FLOAT) AS actualEfficiency,
mrws.parent_order
FROM
[dbo].[mes_report_work] mrws
LEFT JOIN pro_order_workorder pow ON mrws.workorder_code = pow.workorder_code
LEFT JOIN base_product_attached bpa ON bpa.product_code = RIGHT ( mrws.product_code, 11 )
LEFT JOIN base_product bp ON bp.product_code = mrws.product_code
LEFT JOIN mes_line_product mlp ON mlp.product_code=mrws.product_code AND mlp.line_code=mrws.machine_code
WHERE
CAST(mrws.feedback_time AS DATE) = #{feedbackTime}
AND mrws.del_flag = '0'
ORDER BY mrws.machine_name ASC
</select>
<select id="selectMesLineProsdceLists" parameterType="H5" resultMap="H5Result">
SELECT
mrw.workorder_code,
mrw.machine_name,
mrw.product_code,
SUM ( mrw.quantity ) AS plan_production,
SUM ( mrw.quantity_feedback ) AS quantity_feedback,
mrw.use_man,
SUM ( mrw.work_time ) AS work_time,
mrw.parent_order
FROM
[dbo].[mes_report_work] mrw
LEFT JOIN base_product_attached bpa ON bpa.product_code = RIGHT(mrw.product_code, 11)
LEFT JOIN base_product bp ON bp.product_code = mrw.product_code
<where>
<if test="feedbackTime != null and feedbackTime != ''">
CAST ( mrw.feedback_time AS DATE ) = #{feedbackTime}
</if>
AND mrw.parent_order != '0'
</where>
GROUP BY
mrw.workorder_code,
mrw.machine_name,
mrw.product_code,
mrw.use_man,
mrw.parent_order;
</select>
</mapper>