Lius
2023-12-07 4337640b7ab86136baed2fd6aa959e4828a75cea
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentRunningSectionMapper.xml
@@ -86,10 +86,58 @@
            </if>
            AND (start_time &lt;= #{ vo.endDate } AND end_time &gt;= #{ vo.startDate })
            AND status = '22'
            AND alarm != ''
        </where>
        ORDER BY
            start_time
    </select>
    <!--查询数量-->
    <select id="findAlarmCount" resultType="java.lang.Integer">
        SELECT
            COUNT(*)
        FROM
            mdc_equipment_running_section
        <where>
            AND status = '22'
            AND alarm = #{ alarmCode }
            AND (start_time &lt;= #{ endDate } AND end_time &gt;= #{ startDate })
            AND equipment_id = #{ equipmentId }
        </where>
    </select>
    <!--根据日期查询数量-->
    <select id="findAlarmCountByDate" resultType="java.lang.Integer">
        SELECT
            COUNT(*)
        FROM
            mdc_equipment_running_section
        <where>
            AND status = '22'
            AND alarm = #{ vo.alarmCode }
            AND (start_time &lt;= #{ endDate } AND end_time &gt;= #{ startDate })
            <if test="vo.equipmentIdList != null and vo.equipmentIdList.size() > 0 ">
                AND equipment_id IN
                <foreach collection="vo.equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
                    #{ id }
                </foreach>
            </if>
        </where>
    </select>
    <!--查询时间段内运行数据-->
    <select id="selectRunningData" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection">
        SELECT
            *
        FROM
            mdc_equipment_running_section
        WHERE
            equipment_id = #{ equipmentId }
          AND status = '3'
          AND  (start_time &lt;= #{ endDate } AND end_time &gt;= #{ startDate })
        ORDER BY
            start_time
    </select>
</mapper>