zhangherong
2025-05-09 f9a9fb9090c2e9e1a4e00374d48181efe2463a56
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcOeeInfoMapper.xml
@@ -27,4 +27,37 @@
        </where>
        ORDER BY the_date DESC, equipment_id ASC
    </select>
    <select id="findByEquIdsAndDate" resultType="org.jeecg.modules.mdc.entity.MdcOeeInfo">
        SELECT
            the_date,
            AVG ( oee ) oee
        FROM
            mdc_oee_info
        <where>
            the_date BETWEEN #{start} AND #{end}
            AND equipment_id IN
            <foreach collection="equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
                #{ id }
            </foreach>
        </where>
        GROUP BY
            the_date
        ORDER BY
            the_date
    </select>
    <select id="findByEquIdAndDate" resultType="org.jeecg.modules.mdc.entity.MdcOeeInfo">
        SELECT * FROM mdc_oee_info WHERE the_date BETWEEN #{start} AND #{end} AND equipment_id = #{equipmentId} ORDER BY the_date
    </select>
    <select id="findByEquIdAndMonth" resultType="java.math.BigDecimal">
        SELECT
            AVG(oee)
        FROM
            mdc_oee_info
        WHERE
            the_date LIKE CONCAT(#{month}, '%')
          AND equipment_id = #{equipmentId}
    </select>
</mapper>