Lius
2024-04-11 db0cd1d60268811918f38a165052f94911f18e1e
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcHomeMapper.xml
@@ -102,4 +102,45 @@
        </where>
    </select>
    <select id="getUtilizationByDay" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalInfo">
        SELECT
            the_date,
            SUM ( process_long ) processLong,
            SUM ( open_long ) openLong
        FROM
            mdc_equipment_statistical_info
        <where>
            AND the_date = #{date}
            <if test="equipmentIdList != null and equipmentIdList.size() > 0 ">
                AND equipment_id IN
                <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")">
                    #{id}
                </foreach>
            </if>
        </where>
        GROUP BY
            the_date
    </select>
    <select id="getEquipmentSevenUtilizationStatistics" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalInfo">
        SELECT
            equipment_id,
            SUM ( process_long ) processLong,
            SUM ( open_long ) openLong
        FROM
            mdc_equipment_statistical_info
        <where>
            AND the_date BETWEEN #{start} AND #{end}
            <if test="equipmentIdList != null and equipmentIdList.size() > 0 ">
                AND equipment_id IN
                <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")">
                    #{id}
                </foreach>
            </if>
        </where>
        GROUP BY
            equipment_id
    </select>
</mapper>