cuilei
7 天以前 58020f3d711d4baa16ef092c2ea826071c7d23b9
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
<?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.eam.mapper.EamInspectionOrderMapper">
 
    <select id="queryPageList" resultType="org.jeecg.modules.eam.entity.EamInspectionOrder">
        select wmo.*, e.equipment_code, e.equipment_name, e.installation_position
        from eam_inspection_order wmo
        inner join eam_equipment e
        on wmo.equipment_id = e.id
        ${ew.customSqlSegment}
    </select>
 
    <select id="equipmentInspectionStatistics"
            resultType="org.jeecg.modules.eam.vo.EquipmentInspectionStatistics">
        select FORMAT(err.inspection_date, 'yyyy-MM') as monthStr,
        COUNT(1) as planNumber,
        SUM(CASE WHEN err.inspection_status = 'COMPLETE' THEN 1 ELSE 0 END) as completeNumber
        from eam_inspection_order err
        inner join eam_equipment e
        on err.equipment_id = e.id
        where err.inspection_status != 'ABOLISH' and err.del_flag = 0 and e.del_flag = 0
        <if test="productionIds != null">
            AND e.org_id IN
            <foreach collection="productionIds" item="productionId" index="index" open="(" close=")" separator=",">
                #{productionId}
            </foreach>
        </if>
        and err.inspection_date &gt;= #{start}
        and err.inspection_date &lt; #{end}
        group by FORMAT(err.inspection_date, 'yyyy-MM')
    </select>
    <select id="selectUnReceivedInspectionOrder" resultType="org.jeecg.modules.eam.entity.EamInspectionOrder">
        select eio.*,ee.org_id
        from eam_inspection_order eio
        left join eam_equipment ee on eio.equipment_id = ee.id
        where eio.inspection_status = 'WAIT_INSPECTION' and eio.del_flag = 0
    </select>
</mapper>