diff --git a/src/com/engine/salary/biz/OtherDeductionBiz.java b/src/com/engine/salary/biz/OtherDeductionBiz.java index b0301e915..b71668f86 100644 --- a/src/com/engine/salary/biz/OtherDeductionBiz.java +++ b/src/com/engine/salary/biz/OtherDeductionBiz.java @@ -183,4 +183,24 @@ public class OtherDeductionBiz extends BaseBean { } + /** + * @description 批量删除 + * @return void + * @author Harryxzy + * @date 2022/10/27 16:07 + */ + public void batchDeleteByIDS(List deleteIds) { + if (CollectionUtils.isEmpty(deleteIds)) { + return; + } + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + OtherDeductionMapper mapper = sqlSession.getMapper(OtherDeductionMapper.class); + List> partition = Lists.partition(deleteIds, 100); + partition.forEach(mapper::deleteData); + sqlSession.commit(); + } finally { + sqlSession.close(); + } + } } diff --git a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java index 21bb198d1..7638a60cc 100644 --- a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java +++ b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java @@ -4,7 +4,6 @@ import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; import com.engine.salary.entity.datacollection.param.OtherDeductionQueryParam; import com.engine.salary.entity.datacollection.po.OtherDeductionPO; -import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -45,4 +44,9 @@ public interface OtherDeductionMapper { */ void updateData(@Param("collection") List pos); + /** + * 批量删除 + * @param longs + */ + void deleteData(List longs); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml index f9c2def36..f729ab0cf 100644 --- a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml @@ -36,6 +36,17 @@ , t.tenant_key + + + UPDATE hrsa_other_deduction t + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + +