From a7ecb4b14c2e5a56f425f46decc9c203580edd35 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期四, 25 七月 2024 10:56:56 +0800
Subject: [PATCH] 小修改

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentMapper.xml |  232 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 231 insertions(+), 1 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentMapper.xml
index 7026233..2b4251a 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentMapper.xml
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentMapper.xml
@@ -252,13 +252,18 @@
         t1.line_id lineId,
         t1.is_meta isMeta,
         t1.id showId,
+        t1.is_line isLine,
         t1.is_line_equip isLineEquip,
         t1.is_judging isJudging,
+        t1.area_id areaId,
         t3.sumOfEquipment
     from mom_eam_equipment t1
     left join (select  * from mom_eam_equipment_category where del_flag = 0) t2 on t1.equipment_category_id = t2.id
     left join(select  count(id) sumOfEquipment,line_id  from mom_eam_equipment where del_flag=0 group by line_id) t3 on t3.line_id = t1.id
     where t1.del_flag  = 0
+        <if test="equipmentCategoryId != null and equipmentCategoryId != ''">
+            and t1.equipment_category_id = #{equipmentCategoryId}
+        </if>
         <if test="num != null and num != ''">
             and t1.num like concat('%',#{num},'%')
         </if>
@@ -270,6 +275,10 @@
         </if>
         <if test="workCenterId != null and workCenterId != ''">
             and t1.work_center_id = #{workCenterId}
+        </if>
+--         鏍规嵁areaId鏌ヨ璁惧
+        <if test="areaId != null and areaId != ''">
+            and t1.area_id = #{areaId}
         </if>
         <if test="factoryModelId != null and factoryModelId != ''">
             and t1.factory_model_id = #{factoryModelId}
@@ -298,6 +307,12 @@
         <if test="specificEquipment != null and  specificEquipment != ''">
             and t1.specific_equipment = #{specificEquipment}
         </if>
+        <if test="equipNums.size!=0">
+            and t1.num in
+            <foreach collection="equipNums" open="(" separator="," close=")" item="num">
+                #{num}
+            </foreach>
+        </if>
         <if test="warrantyStart != null">
             and DATEDIFF(day,t1.warranty_start,#{warrantyStart})=0
         </if>
@@ -310,12 +325,173 @@
         <if test="lineId != null and lineId != ''">
             and t1.line_id = #{lineId}
         </if>
-        order by (CASE WHEN t1.is_meta='yes' then GETDATE() else t1.create_time end) desc
+        order by t1.create_time desc
     </select>
+
+    <select id="getEquipmentTZList" resultType="org.jeecg.modules.eam.entity.Equipment">
+        select
+        t1.id id,
+        t1.num num,
+        t1.name name,
+        t1.model model,
+        t1.specification specification,
+        t1.equipment_status equipmentStatus,
+        t1.technology_status technologyStatus,
+        t1.asset_number assetNumber,
+        t1.equipment_category_id equipmentCategoryId,
+        t1.specific_equipment specificEquipment,
+        t1.equipment_photo equipmentPhoto,
+        t1.constructor_id constructorId,
+        t1.supplier_id supplierId,
+        t1.factory_number factoryNumber,
+        t1.leave_factory_date leaveFactoryDate,
+        t1.acceptance_check_date acceptanceCheckDate,
+        t1.affiliation_id affiliationId,
+        t1.manage_id manageId,
+        t1.manager manager,
+        t1.use_id useId,
+        t1.functionary functionary,
+        t1.location location,
+        t1.equipment_importance_id equipmentImportanceId,
+        t1.process_parameters processParameters,
+        t1.process_parameters_template_id processParametersTemplateId,
+        t1.precision_parameters precisionParameters,
+        t1.precision_parameters_template_id precisionParametersTemplateId,
+        t1.verification verification,
+        t1.verification_period verificationPeriod,
+        t1.last_verification_date lastVerificationDate,
+        t1.next_verification_date nextVerificationDate,
+        t1.status status,
+        t1.remark remark,
+        t1.equipment_uda1 equipmentUda1,
+        t1.equipment_uda2 equipmentUda2,
+        t1.equipment_uda3 equipmentUda3,
+        t1.equipment_uda4 equipmentUda4,
+        t1.equipment_uda5 equipmentUda5,
+        t1.create_by createBy,
+        t1.create_time  createTime,
+        t1.update_by updateBy,
+        t1.update_time updateTime,
+        t1.del_flag delFlag,
+        t1.team_id teamId,
+        t1.source_id sourceId,
+        t1.fund_source fundSource,
+        t1.factory_no factoryNo,
+        t1.mfr mfr,
+        t1.source_country sourceCountry,
+        t1.gpo gpo,
+        t1.key_equipment_identification keyEquipmentIdentification,
+        t1.security_configuration securityConfiguration,
+        t1.cooling_system coolingSystem,
+        t1.fire_extinguisher fireExtinguisher,
+        t1.fire_extinguisher_validity_period fireExtinguisherValidityPeriod,
+        t1.operating_system operatingSystem,
+        t1.system system,
+        t1.port port,
+        t1.coordinate_num coordinateNum,
+        t1.project_approval_no projectApprovalNo,
+        t1.standard_a standardA,
+        t1.standard_b standardB,
+        t1.standard_c standardC,
+        t1.standard_d standardD,
+        t1.standard_e standardE,
+        t1.standard_f standardF,
+        t1.factory_model_id factoryModelId,
+        t1.work_center_id workCenterId,
+        t1.warranty_start warrantyStart,
+        t1.warranty_end warrantyEnd,
+        t1.property_status propertyStatus,
+        t1.check_period checkPeriod,
+        t1.next_technology_status_qualification_time nextTechnologyStatusQualificationTime,
+        t1.technology_status_qualification_time technologyStatusQualificationTime,
+        t1.technology_status_verification_type technologyStatusVerificationType,
+        t1.line_id lineId,
+        t1.is_meta isMeta,
+        t1.id showId,
+        t1.is_line isLine,
+        t1.is_line_equip isLineEquip,
+        t1.is_judging isJudging,
+        t1.area_id areaId,
+        t3.sumOfEquipment
+        from mom_eam_equipment t1
+        left join (select  * from mom_eam_equipment_category where del_flag = 0) t2 on t1.equipment_category_id = t2.id
+        left join(select  count(id) sumOfEquipment,line_id  from mom_eam_equipment where del_flag=0 group by line_id) t3 on t3.line_id = t1.id
+        where t1.del_flag  = 0
+        <if test="equipmentCategoryId != null and equipmentCategoryId != ''">
+            and t1.equipment_category_id = #{equipmentCategoryId}
+        </if>
+        <if test="num != null and num != ''">
+            and t1.num like concat('%',#{num},'%')
+        </if>
+        <if test="name != null and name != ''">
+            and t1.name like concat('%',#{name},'%')
+        </if>
+        <if test="model != null and model != ''">
+            and t1.model like concat('%',#{model},'%')
+        </if>
+        <if test="workCenterIds != null">
+            and t1.work_center_id in
+            <foreach collection="workCenterIds" open="(" separator="," close=")" item="workCenterId">
+                #{workCenterId}
+            </foreach>
+        </if>
+        --         鏍规嵁areaId鏌ヨ璁惧
+        <if test="areaId != null and areaId != ''">
+            and t1.area_id = #{areaId}
+        </if>
+        <if test="factoryModelId != null and factoryModelId != ''">
+            and t1.factory_model_id = #{factoryModelId}
+        </if>
+        <if test="manageId != null and manageId != ''">
+            and t1.manage_id = #{manageId}
+        </if>
+        <if test="useId != null and useId != ''">
+            and t1.use_id = #{useId}
+        </if>
+        <if test="equipmentImportanceId != null and  equipmentImportanceId != ''">
+            and t1. equipment_importance_id = #{equipmentImportanceId}
+        </if>
+        <if test="technologyStatus != null and  technologyStatus != ''">
+            and t1.technology_status = #{technologyStatus}
+        </if>
+        <if test="equipmentStatus != null and  equipmentStatus != ''">
+            and t1.equipment_status = #{equipmentStatus}
+        </if>
+        <if test="isLineEquip != null and  isLineEquip != ''">
+            and t1.is_line_equip = #{isLineEquip}
+        </if>
+        <if test="isLine != null and  isLine != ''">
+            and t1.is_line = #{isLine}
+        </if>
+        <if test="specificEquipment != null and  specificEquipment != ''">
+            and t1.specific_equipment = #{specificEquipment}
+        </if>
+        <if test="equipNums.size!=0">
+            and t1.num in
+            <foreach collection="equipNums" open="(" separator="," close=")" item="num">
+                #{num}
+            </foreach>
+        </if>
+        <if test="warrantyStart != null">
+            and DATEDIFF(day,t1.warranty_start,#{warrantyStart})=0
+        </if>
+        <if test="warrantyEnd != null">
+            and DATEDIFF(day,t1.warranty_end,#{warrantyEnd})=0
+        </if>
+        <if test="sql != null and sql != ''">
+            and t2.equipment_category_uda1 = #{sql}
+        </if>
+        <if test="lineId != null and lineId != ''">
+            and t1.line_id = #{lineId}
+        </if>
+        order by t1.create_time desc
+    </select>
+<!--    order by (CASE WHEN t1.is_meta='yes' then GETDATE() else t1.create_time end) desc-->
     <select id="getStandardList" resultType="org.jeecg.modules.eam.entity.DailyInspectionStandardDetail">
         select t9.* from ( select
            t1.id id,
            t5.name projectName,
+           '' as maintenanceRole,
            t5.detection_standard standard,
            '1' as type,
            t6.name cycleName,
@@ -332,6 +508,7 @@
            select
            t3.id id,
            t7.name projectName,
+           t3.maintenance_role maintenanceRole,
            t7.standard standard,
            t8.maintenance_type type,
            t8.name cycleName,
@@ -349,4 +526,57 @@
            order by t9.type
     </select>
 
+    <select id="getEquipmentListAllStandard"  parameterType="Map" resultType="Map">
+        SELECT
+        t1.id,
+        t2.name as categoryName,
+        t1.num as equipmentNum,
+        t1.name as equipmentName,
+        t1.model as equipmentModel,
+        t1.equipment_importance_id as abc,
+        t1.precision_parameters as precisionParameters,
+        t1.precision_parameters_template_id as precisionParametersTemplateId,
+        t3.depart_name as departName,
+        t4.item_text as technologyStatus,
+        t5.item_text as specificEquipment
+        FROM
+        mom_eam_equipment t1
+        LEFT JOIN mom_eam_equipment_category t2 ON t1.equipment_category_id = t2.id
+        LEFT JOIN sys_depart t3 ON t1.use_id = t3.id
+        LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'technology_status' ) t4 ON t4.item_value = t1.technology_status
+        LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'specific_equipment' ) t5 ON t5.item_value = t1.specific_equipment
+        WHERE t1.del_flag = '0'
+        <if test="params.num != null and params.num != ''">
+            and t1.num like concat('%',#{params.num},'%')
+        </if>
+        <if test="params.name != null and params.name != ''">
+            and t1.name like concat('%',#{params.name},'%')
+        </if>
+        <if test="params.model != null and params.model != ''">
+            and t1.model like concat('%',#{params.model},'%')
+        </if>
+        <if test="params.useId != null and params.useId != ''">
+            and t1.use_id = #{params.useId}
+        </if>
+        <if test="params.equipmentImportanceId != null and  params.equipmentImportanceId != ''">
+            and t1. equipment_importance_id = #{params.equipmentImportanceId}
+        </if>
+        <if test="params.technologyStatus != null and  params.technologyStatus != ''">
+            and t1.technology_status = #{params.technologyStatus}
+        </if>
+        <if test="params.equipmentStatus != null and  params.equipmentStatus != ''">
+            and t1.equipment_status = #{params.equipmentStatus}
+        </if>
+        <if test="params.specificEquipment != null and  params.specificEquipment != ''">
+            and t1.specific_equipment = #{params.specificEquipment}
+        </if>
+        <if test="params.factoryModelId != null and params.factoryModelId != ''">
+            and t1.factory_model_id = #{params.factoryModelId}
+        </if>
+        <if test="params.equipmentCategoryId != null and params.equipmentCategoryId != ''">
+            and t1.equipment_category_id = #{params.equipmentCategoryId}
+        </if>
+        ORDER BY t1.create_time desc
+    </select>
+
 </mapper>

--
Gitblit v1.9.3