Lius
2025-02-18 3423bb9ee5b25d270a00763b69ed73970d790f63
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
48
49
50
<?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.MdcRepairInfoMapper">
 
    <!--分页列表-->
    <select id="pageList" resultType="org.jeecg.modules.mdc.entity.MdcRepairInfo">
        SELECT
            *
        FROM
            mdc_repair_info
        <where>
            <if test="mdcRepairInfoVo.equipmentId != null and mdcRepairInfoVo.equipmentId != ''">
                AND equipment_id = #{ mdcRepairInfoVo.equipmentId }
            </if>
            <if test="mdcRepairInfoVo.startTime != null and mdcRepairInfoVo.startTime != ''">
                AND the_date &gt;= #{ mdcRepairInfoVo.startTime }
            </if>
            <if test="mdcRepairInfoVo.endTime != null and mdcRepairInfoVo.endTime != ''">
                AND the_date &lt;= #{mdcRepairInfoVo.endTime }
            </if>
            <if test="mdcRepairInfoVo.equipmentIdList != null and mdcRepairInfoVo.equipmentIdList.size() > 0 ">
                AND equipment_id IN
                <foreach collection="mdcRepairInfoVo.equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
                    #{ id }
                </foreach>
            </if>
        </where>
        ORDER BY the_date DESC, equipment_id ASC
    </select>
 
    <!--查询当月总维修时间-->
    <select id="findTotalRepairLong" resultType="java.math.BigDecimal">
        SELECT
            SUM(repair_long)
        FROM
            mdc_repair_info
        WHERE
            the_date LIKE CONCAT(#{month}, '%')
    </select>
 
    <!--查询当月总维修次数-->
    <select id="findTotalRepairCount" resultType="java.lang.Integer">
        SELECT
            COUNT(repair_long)
        FROM
            mdc_repair_info
        WHERE
            the_date LIKE CONCAT(#{month}, '%')
    </select>
</mapper>