Commit aebb3573 authored by suhuiguang's avatar suhuiguang

reafact(jg): 批量删除

1.设备批量删除 2.装置批量删除
parent 925fc8f0
...@@ -1248,7 +1248,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1248,7 +1248,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
/** /**
* 删除校验,被引用时不可删除 * 删除校验,被引用时不可删除
* *
* @param records * @param records 设备record集合
*/ */
private void checkForDelete(List<String> records) { private void checkForDelete(List<String> records) {
List<CountDto> useCounts = commonMapper.countEquipInUseTimesWithOutZFBatch(records); List<CountDto> useCounts = commonMapper.countEquipInUseTimesWithOutZFBatch(records);
......
...@@ -151,33 +151,33 @@ ...@@ -151,33 +151,33 @@
project_contraption_id as keyStr, project_contraption_id as keyStr,
SUM(inUseNumber) longValue SUM(inUseNumber) longValue
FROM ( FROM (
SELECT SELECT
a.project_contraption_id, a.project_contraption_id,
COUNT(1) AS inUseNumber COUNT(1) AS inUseNumber
FROM FROM
tzs_jg_use_registration a tzs_jg_use_registration a
WHERE a.project_contraption_id = ANY(ARRAY[
<foreach collection="projectContraptionIdList" item="projectContraptionId" separator=",">
#{projectContraptionId}
</foreach>
])
AND a.is_delete = 0
AND ( a.status <![CDATA[ <> ]]> '已作废')
group by a.project_contraption_id
UNION all
SELECT
a.project_contraption_id,
COUNT(1) AS inUseNumber
FROM
tzs_jg_installation_notice a
WHERE a.project_contraption_id = ANY(ARRAY[ WHERE a.project_contraption_id = ANY(ARRAY[
<foreach collection="projectContraptionIdList" item="projectContraptionId" separator=","> <foreach collection="projectContraptionIdList" item="projectContraptionId" separator=",">
#{projectContraptionId} #{projectContraptionId}
</foreach> </foreach>
]) ])
AND (a.notice_status <![CDATA[ <> ]]> '6617') AND a.is_delete = 0
and a.is_delete = 0 AND ( a.status <![CDATA[ <> ]]> '已作废')
group by a.project_contraption_id group by a.project_contraption_id
UNION all
SELECT
a.project_contraption_id,
COUNT(1) AS inUseNumber
FROM
tzs_jg_installation_notice a
WHERE a.project_contraption_id = ANY(ARRAY[
<foreach collection="projectContraptionIdList" item="projectContraptionId" separator=",">
#{projectContraptionId}
</foreach>
])
AND (a.notice_status <![CDATA[ <> ]]> '6617')
and a.is_delete = 0
group by a.project_contraption_id
) )
GROUP BY GROUP BY
project_contraption_id project_contraption_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment