|
@@ -66,10 +66,10 @@
|
|
|
<when test="previousprocessid == null and previousprocessid == ''">
|
|
|
<!-- 不存在上一个工序 未完工卷数等于0时 更新 为已完工 -->
|
|
|
<!-- 完工状态-->
|
|
|
- apope.CLOSESTATUS= CASE
|
|
|
- WHEN (apope.PLANPROCESSRALL - #{currentCheckNum}) = 0 THEN '已完工'
|
|
|
- ELSE '未完工'
|
|
|
- END,
|
|
|
+# apope.CLOSESTATUS= CASE
|
|
|
+# WHEN (apope.PLANPROCESSRALL - #{currentCheckNum}) = 0 THEN '已完工'
|
|
|
+# ELSE '未完工'
|
|
|
+# END,
|
|
|
<!-- 作业状态-->
|
|
|
apope.WORKSTATUS= CASE
|
|
|
WHEN (apope.PLANPROCESSRALL -#{currentCheckNum}) = 0 THEN '已完工'
|
|
@@ -83,19 +83,19 @@
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
<!-- 存在上一个工序 上道工序作业已完工 当前工序作业明细的已开工卷数=已检验卷数-->
|
|
|
- apope.CLOSESTATUS =
|
|
|
- CASE
|
|
|
- <!--并且当前工序明细的已开工卷数=已检验卷数-->
|
|
|
- WHEN
|
|
|
- (
|
|
|
- <!--并且上道工序作业已完工状态=已完工-->
|
|
|
- select (select apo.CLOSESTATUS='已完工' from aps_process_operation apo where apo.ID =#{previousprocessid} )
|
|
|
- <!--并且作业明细待加工料卷批次号数量-工序作业已取消卷数<=0-->
|
|
|
- and (select IFNULL(LENGTH(apope.BACHMATERIALPROCESS) - LENGTH(REPLACE(apope.BACHMATERIALPROCESS, ',',
|
|
|
- '')) + 1 ,0)-IFNULL(apo.CANCELROLL,0)<=0 from aps_process_operation apo where apo.ID =#{processOperationId}
|
|
|
- ) and apope.STARTINGROLL = apope.CHECKOUTROLL+#{currentCheckNum} from dual )THEN '已完工'
|
|
|
- ELSE '未完工'
|
|
|
- END,
|
|
|
+<!-- apope.CLOSESTATUS =-->
|
|
|
+<!-- CASE-->
|
|
|
+<!-- <!–并且当前工序明细的已开工卷数=已检验卷数–>-->
|
|
|
+<!-- WHEN-->
|
|
|
+<!-- (-->
|
|
|
+<!-- <!–并且上道工序作业已完工状态=已完工–>-->
|
|
|
+<!-- select (select apo.CLOSESTATUS='已完工' from aps_process_operation apo where apo.ID =#{previousprocessid} )-->
|
|
|
+<!-- <!–并且作业明细待加工料卷批次号数量-工序作业已取消卷数<=0–>-->
|
|
|
+<!-- and (select IFNULL(LENGTH(apope.BACHMATERIALPROCESS) - LENGTH(REPLACE(apope.BACHMATERIALPROCESS, ',',-->
|
|
|
+<!-- '')) + 1 ,0)-IFNULL(apo.CANCELROLL,0)<=0 from aps_process_operation apo where apo.ID =#{processOperationId}-->
|
|
|
+<!-- ) and apope.STARTINGROLL = apope.CHECKOUTROLL+#{currentCheckNum} from dual )THEN '已完工'-->
|
|
|
+<!-- ELSE '未完工'-->
|
|
|
+<!-- END,-->
|
|
|
apope.WORKSTATUS =
|
|
|
CASE
|
|
|
WHEN (select (select apo.CLOSESTATUS='已完工' from aps_process_operation apo where apo.ID =#{previousprocessid} )
|
|
@@ -317,4 +317,33 @@
|
|
|
)
|
|
|
</where>
|
|
|
</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
|
|
|
+ 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
|
|
|
+ <where>
|
|
|
+ apope.DELETED = '0'
|
|
|
+ <if test="idList !=null and idList.size() >0">
|
|
|
+ AND apope.ID IN
|
|
|
+ <foreach collection="idList" item="id" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ GROUP BY IFNULL( aci.USEDEPTID, arg.RESOURCEWORKSHOPID ),aci.ID
|
|
|
+ <if test="idList !=null and idList.size() >1">
|
|
|
+ <!-- 存在多选工序作业时 筛选共有的设备 -->
|
|
|
+ <bind name="idLength" value="idList.size()" />
|
|
|
+ HAVING count(*)>=#{idLength}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|