Lius
2025-03-12 da82d77c6773f65aadfde810233615b602da655a
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
<?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.MdcDowntimeMapper">
 
    <select id="pageList" resultType="org.jeecg.modules.mdc.entity.MdcDowntime">
        SELECT * FROM mdc_downtime
        <where>
            <if test="mdcDowntimeVo.equipmentId != null and mdcDowntimeVo.equipmentId != ''">
                AND equipment_id = #{ mdcDowntimeVo.equipmentId }
            </if>
            <if test="mdcDowntimeVo.equipmentName != null and mdcDowntimeVo.equipmentName != ''">
                AND equipment_name = #{ mdcDowntimeVo.equipmentName }
            </if>
            <if test="mdcDowntimeVo.startTime != null and mdcDowntimeVo.startTime != '' and mdcDowntimeVo.endTime != null and mdcDowntimeVo.endTime != ''">
                AND the_date BETWEEN #{ mdcDowntimeVo.startTime } AND #{ mdcDowntimeVo.endTime }
            </if>
            <if test="mdcDowntimeVo.equipmentIdList != null and mdcDowntimeVo.equipmentIdList.size() > 0 ">
                AND equipment_id IN
                <foreach collection="mdcDowntimeVo.equipmentIdList" item="equipmentId" index="index" open="(" close=")" separator=",">
                    #{ equipmentId }
                </foreach>
            </if>
        </where>
        ORDER BY create_time DESC
    </select>
</mapper>