Files
klp-oa/klp-pocket/src/main/resources/mapper/pocket/AcidOeeAcidMapper.xml
2026-03-19 18:17:08 +08:00

26 lines
1.1 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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.klp.pocket.acid.mapper.AcidOeeAcidMapper">
<!-- 查询卷级生产节拍min/吨):(END_DATE - START_DATE)/EXIT_WEIGHT -->
<select id="selectCoilCycleMinPerTon" resultType="java.math.BigDecimal">
SELECT
TIMESTAMPDIFF(MINUTE, e.START_DATE, e.END_DATE) / e.EXIT_WEIGHT AS cycle_min_per_ton
FROM klptcm1_pdo_excoil e
WHERE 1 = 1
<if test="startDate != null and startDate != ''">
AND DATE(e.INSDATE) &gt;= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
AND DATE(e.INSDATE) &lt;= #{endDate}
</if>
AND e.START_DATE IS NOT NULL
AND e.END_DATE IS NOT NULL
AND e.END_DATE &gt; e.START_DATE
AND e.EXIT_WEIGHT IS NOT NULL
AND e.EXIT_WEIGHT &gt; 0
AND TIMESTAMPDIFF(MINUTE, e.START_DATE, e.END_DATE) &gt; 0
</select>
</mapper>