lius
2023-06-30 3e1a770800cc7d5462672588d77b85f3afb8fbda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?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="org.jeecg.modules.mdc.mapper.MdcEfficiencyReportMapper">
 
    <!--查询利用率数据-->
    <select id="efficiencyList" resultType="org.jeecg.modules.mdc.dto.MdcEfficiencyDto">
        SELECT
            t2.equipment_id equipmentId,
            t2.equipment_name equipmentName,
            t2.equipment_type equipmentType,
            t1.the_date,
            t1.process_long processLong,
            t1.process_long / 86400 utilizationRate,
            CASE
                WHEN t1.open_long > 0 THEN
                t1.process_long / t1.open_long ELSE 0
            END startRate,
            t1.open_long / 86400 openRate,
            t1.open_long openLong,
            t1.wait_long waitLong,
            t1.close_long closeLong
        FROM
            mdc_equipment t2
            LEFT JOIN mdc_equipment_statistical_info t1 ON t1.equipment_id = t2.equipment_id
        WHERE
            t1.the_date &lt;= #{ vo.endTime }
            AND t1.the_date &gt;= #{ vo.startTime }
        <if test="vo.equipmentIdList != null and vo.equipmentIdList.size() > 0 ">
            AND t2.equipment_id IN
            <foreach collection="vo.equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
                #{ id }
            </foreach>
        </if>
        ORDER BY
            t1.the_date
    </select>
</mapper>