|
@@ -222,13 +222,7 @@ public class WbsTreeContractStatisticsServiceImpl extends ServiceImpl<WbsTreeCon
|
|
|
}
|
|
|
|
|
|
private void updateStatusAndIsDeleted(Long contractId) {
|
|
|
- List<WbsTreeContractStatistics> query = jdbcTemplate.query("SELECT a.id,b.status,b.is_deleted from m_wbs_tree_contract_statistics a LEFT JOIN m_wbs_tree_contract b on a.id = b.p_key_id WHERE (a.status != b.status OR a.is_deleted != b.is_deleted) AND b.p_key_id IS NOT NULl and a.contract_id = " + contractId,
|
|
|
- new BeanPropertyRowMapper<>(WbsTreeContractStatistics.class));
|
|
|
- if (query.isEmpty()) {
|
|
|
- return;
|
|
|
- }
|
|
|
- List<WbsTreeContractStatistics> list = query.stream().filter(item -> item.getStatus() != null && item.getIsDeleted() != null).collect(Collectors.toList());
|
|
|
- this.updateBatchById(list);
|
|
|
+ jdbcTemplate.execute("update m_wbs_tree_contract_statistics a LEFT JOIN m_wbs_tree_contract b on a.id = b.p_key_id set a.status = ifnull(b.status, a.status) , a.is_deleted = IFNULL(b.is_deleted,a.is_deleted) WHERE (a.status != b.status OR a.is_deleted != b.is_deleted) AND b.p_key_id IS NOT NULl and a.contract_id = " + contractId);
|
|
|
}
|
|
|
|
|
|
public Boolean updateLeafNum(String ids) {
|