qushaowei
2025-06-19 3b518f3909a196d53e890823ee89d04f5f1b622a
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
51
52
53
54
<?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
        from eam_inspection_order wmo
        inner join eam_equipment e
        on wmo.equipment_id = e.id
        ${ew.customSqlSegment}
    </select>
 
    <select id="findInspectionUser"  parameterType="String" resultType="org.jeecg.modules.eam.vo.InspectionVo">
 
        SELECT
            t1.operator,
            t1.confirm_user as confirmUser,
            CONVERT(VARCHAR, DATEPART(DAY, t1.inspection_date)) as dayTime
        FROM
            eam_inspection_order t1
        WHERE t1.del_flag = '0'
          AND t1.equipment_id = #{equipmentId}
        AND SUBSTRING ( CONVERT ( VARCHAR ( 10 ), t1.inspection_date, 120 ), 1, 7 ) = SUBSTRING(CONVERT(VARCHAR(10),#{yearMonth}, 120 ), 1, 7 )
    </select>
 
    <select id="findInspectionResult"  parameterType="String" resultType="org.jeecg.modules.eam.vo.InspectionVo">
 
        SELECT
            t1.item_demand as inspectionContent,
            CONVERT(VARCHAR, DATEPART(DAY, t2.inspection_date)) as dayTime,
            case t1.inspection_result  when '1' then '√' when '2' then 'x' else '' end as inspectionResult
        FROM
            eam_inspection_order_detail t1
        LEFT JOIN eam_inspection_order t2 ON t1.order_id = t2.id
        WHERE t1.item_demand = #{itemDemand}
        and t2.equipment_id = #{equipmentId}
        AND SUBSTRING ( CONVERT ( VARCHAR ( 10 ), t2.inspection_date, 120 ), 1, 7 ) = SUBSTRING(CONVERT(VARCHAR(10),#{yearMonth}, 120 ), 1, 7 )
    </select>
 
    <select id="findInspectionStandard"  parameterType="String" resultType="Map">
        SELECT
            ROW_NUMBER() OVER (ORDER BY t1.id) AS seq,
            t1.item_demand as itemDemand
        FROM
            eam_maintenance_standard_detail t1
            LEFT JOIN eam_maintenance_standard t2 ON t1.standard_id = t2.id
        WHERE
          t2.maintenance_category = 'POINT_INSPECTION'
          AND t2.standard_status = 'NORMAL'
          and equipment_id =#{equipmentId}
        ORDER BY
            item_code ASC
    </select>
</mapper>