hyingbo
7 天以前 cc0e9036de6e922e8fe254fef01d8de9996024b7
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
38
39
40
41
42
43
44
45
46
47
<?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.MdcNoplanCloseMapper">
 
    <!--分页查询-->
    <select id="pageList" resultType="org.jeecg.modules.mdc.entity.MdcNoplanClose">
        SELECT
            *
        FROM
            mdc_noplan_close
        <where>
            <if test="mdcNoplanClose.equipmentName != null and mdcNoplanClose.equipmentName != '' ">
                AND equipment_name LIKE CONCAT(CONCAT('%',#{mdcNoplanClose.equipmentName}),'%')
            </if>
            <if test="mdcNoplanClose.equipmentId != null and mdcNoplanClose.equipmentId != '' ">
                AND equipment_id LIKE CONCAT(CONCAT('%',#{mdcNoplanClose.equipmentId}),'%')
            </if>
            <if test="mdcNoplanClose.startTime != null ">
                AND end_time &gt;= #{ mdcNoplanClose.startTime }
            </if>
            <if test="mdcNoplanClose.endTime != null ">
                AND start_time &lt;= #{ mdcNoplanClose.endTime }
            </if>
            <if test="mdcNoplanClose.mdcSectionIds != null and mdcNoplanClose.mdcSectionIds.size() > 0 ">
                AND equipment_id IN
                <foreach collection="mdcNoplanClose.mdcSectionIds" item="id" index="index" open="(" close=")" separator=",">
                    #{ id }
                </foreach>
            </if>
        </where>
        ORDER BY start_time ASC
    </select>
 
 
    <select id="findNoplanTimeDuration" resultType="org.jeecg.modules.mdc.entity.MdcNoplanClose">
        SELECT
            *
        FROM
            mdc_noplan_close
        WHERE
            equipment_id = #{ equipmentId }
            AND ( ( start_time BETWEEN #{ startDate } AND #{ endDate } ) OR ( end_time BETWEEN #{ startDate } AND #{ endDate } ) )
            AND noplan_type = #{ noplanType }
        ORDER BY
            start_time ASC
    </select>
</mapper>