|
@@ -344,29 +344,30 @@
|
|
|
</update>
|
|
|
<select id="getOptionalEquipmentById" resultType="com.rongwei.bsentity.vo.OptionalEquipmentVo">
|
|
|
SELECT
|
|
|
- CONCAT(IFNULL( aci.USEDEPTID, arg.RESOURCEWORKSHOPID ),'/',aci.ID) AS value,
|
|
|
- CONCAT(IFNULL( aci.USEDEPTNAME, arg.RESOURCEWORKSHOP ),'/',aci.CHECKITEMNAME) as label
|
|
|
+ CCONCAT( IFNULL( aci.USEDEPTID, arg.RESOURCEWORKSHOPID ), '/', apoe.RESOURCEID ) AS value ,
|
|
|
+ CONCAT( IFNULL( aci.USEDEPTNAME, arg.RESOURCEWORKSHOP ), '/', IFNULL( aci.CHECKITEMNAME, arg.RESOURCENAME ) ) 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
|
|
|
- AND aci.DELETED = '0'
|
|
|
- LEFT JOIN aps_resource_group arg ON apoe.RESOURCEID = arg.ID
|
|
|
+ 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
|
|
|
+ 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">
|
|
|
- AND apope.ID IN
|
|
|
+ AND apope.ID IN
|
|
|
<foreach collection="idList" item="id" open="(" close=")" separator=",">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- GROUP BY IFNULL( aci.USEDEPTID, arg.RESOURCEWORKSHOPID ),aci.ID
|
|
|
+ GROUP BY IFNULL( aci.USEDEPTID, arg.RESOURCEWORKSHOPID ),apoe.RESOURCEID
|
|
|
<if test="idList !=null and idList.size() >1">
|
|
|
<!-- 存在多选工序作业时 筛选共有的设备 -->
|
|
|
- <bind name="idLength" value="idList.size()" />
|
|
|
+ <bind name="idLength" value="idList.size()"/>
|
|
|
HAVING count(*)>=#{idLength}
|
|
|
</if>
|
|
|
</where>
|