lyh
2 天以前 e41c3a2f9f64516a455819cde40f825b6a5dd9ef
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentMapper.xml
@@ -53,11 +53,76 @@
               ext.technology_check_period,
               ext.latest_technology_check,
               ext.next_technology_check,
               ext.technology_genarate_flag,
               ext.third_maintenance_genarate_flag
               ext.technology_generate_flag,
               ext.third_maintenance_generate_flag
        from eam_equipment e
        left join eam_equipment_extend ext
        on e.id = ext.id
        ${ew.customSqlSegment}
    </select>
    <select id="selectThreeMaintenanceEquipmentList" resultType="org.jeecg.modules.eam.entity.EamEquipment">
        select e.*,
               ext.latest_third_maintenance,
               ext.next_third_maintenance,
               ext.technology_status,
               ext.third_maintenance_period,
               ext.technology_check_period,
               ext.latest_technology_check,
               ext.next_technology_check,
               ext.technology_generate_flag,
               ext.third_maintenance_generate_flag
        from eam_equipment e
        left join eam_equipment_extend ext
        on e.id = ext.id
        ${ew.customSqlSegment}
    </select>
    <select id="echartsList" resultType="org.jeecg.modules.eam.dto.EchartsDto">
        SELECT COUNT
               ( t.technology_status ) AS "value",
               item.item_text AS "name",
               item.item_value AS "code",
               ( SELECT COUNT ( a.id ) FROM eam_equipment_extend a WHERE a.technology_status IS NOT NULL
                                                <if test="ids != null and ids != ''">
                                                    AND a.id IN
                                                    <foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
                                                        #{id}
                                                    </foreach>
                                                </if>
                                                                   ) AS "total",
               concat (
                       round(
                               ISNULL (
                                       COUNT ( t.id ) / ( SELECT COUNT ( a.id ) FROM eam_equipment_extend a WHERE a.technology_status IS NOT NULL
                                                    <if test="ids != null and ids != ''">
                                                        AND a.id IN
                                                        <foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
                                                            #{id}
                                                        </foreach>
                                                    </if>),
                                       0
                               ) * 100,
                               2
                       ),
                       '%'
               ) AS "percentage"
        FROM
            sys_dict c
                LEFT JOIN sys_dict_item item ON c.id = item.dict_id
                LEFT JOIN eam_equipment_extend t ON t.technology_status = item.item_value
                <if test="ids != null and ids != ''">
                    AND t.id IN
                    <foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
                        #{id}
                    </foreach>
                </if>
        WHERE
            c.dict_code = 'equipment_technology_status'
        GROUP BY
            item.item_text,
            t.technology_status,
            item.item_value
        ORDER BY
            item.item_value
    </select>
</mapper>