Преглед изворни кода

bugFix 修改换线获取加工设备的逻辑

xiahan пре 1 година
родитељ
комит
e4f6f997c1

+ 6 - 9
cx-aps/cx-aps-common/src/main/resources/mybatis/ApsProcessOperationProcessEquDao.xml

@@ -350,18 +350,14 @@
     </update>
     <select id="getOptionalEquipmentById" resultType="com.rongwei.bsentity.vo.OptionalEquipmentVo">
         SELECT
-        CONCAT( IFNULL( aci.USEDEPTID, arg.RESOURCEWORKSHOPID ), '/', apoe.RESOURCEID ) AS value ,
-        CONCAT( IFNULL( aci.USEDEPTNAME, arg.RESOURCEWORKSHOP ), '/', IFNULL( aci.CHECKITEMNAME, arg.RESOURCENAME ) ) AS
-        label
+        CONCAT(aci.USEDEPTID, '/', aci.ID ) AS value ,
+        CONCAT(aci.USEDEPTNAME, '/', aci.CHECKITEMNAME) AS label
         FROM
         aps_process_operation_process_equ apope
         LEFT JOIN aps_process_operation apo ON apope.PROCESSID = apo.ID
-        AND apo.DELETED = '0'
-        LEFT JOIN aps_process_operation_equ apoe ON apoe.MAINID = apo.ID
-        AND apoe.DELETED = '0'
-        LEFT JOIN asp_check_items aci ON apoe.RESOURCEID = aci.ID
+        LEFT JOIN asp_check_items aci ON FIND_IN_SET(aci.ID,apo.CANCHOOSEDEVICEID)
+        left join sys_dict c on c.DICTTYPE='asp_check_item_type' AND aci.CHECKITEMTYPE =c.VALUE
         AND aci.DELETED = '0'
-        LEFT JOIN aps_resource_group arg ON apoe.RESOURCEID = arg.ID
         <where>
             apope.DELETED = '0'
             <if test="idList !=null and idList.size() >0">
@@ -370,12 +366,13 @@
                     #{id}
                 </foreach>
             </if>
-            GROUP BY  IFNULL( aci.USEDEPTID, arg.RESOURCEWORKSHOPID ),apoe.RESOURCEID
+            GROUP BY  aci.ID
             <if test="idList !=null and idList.size() >1">
                 <!-- 存在多选工序作业时 筛选共有的设备 -->
                 <bind name="idLength" value="idList.size()"/>
                 HAVING count(*)>=#{idLength}
             </if>
+            order by c.VALUE,aci.CHECKITEMNAME asc
         </where>
     </select>
     <select id="checkConflict" resultType="java.lang.String">