2022-03-15 14:18:04 +08:00
|
|
|
package com.engine.salary.biz;
|
|
|
|
|
|
|
|
|
|
import com.engine.salary.entity.datacollection.po.AttendQuoteDataValuePO;
|
|
|
|
|
import com.engine.salary.mapper.datacollection.AttendQuoteDataValueMapper;
|
2022-05-26 13:41:58 +08:00
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
2022-03-15 14:18:04 +08:00
|
|
|
import org.apache.ibatis.session.SqlSession;
|
|
|
|
|
import weaver.conn.mybatis.MyBatisFactory;
|
|
|
|
|
|
2022-04-24 17:42:32 +08:00
|
|
|
import java.util.ArrayList;
|
2022-03-15 14:18:04 +08:00
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
public class AttendQuoteDataValueBiz {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据考勤引用字段表的主键id删除
|
2022-03-16 14:29:02 +08:00
|
|
|
*
|
2022-03-15 14:18:04 +08:00
|
|
|
* @param attendQuoteDataIds
|
|
|
|
|
*/
|
|
|
|
|
public void deleteByAttendQuoteDataIds(List<Long> attendQuoteDataIds) {
|
|
|
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
|
|
|
try {
|
|
|
|
|
AttendQuoteDataValueMapper mapper = sqlSession.getMapper(AttendQuoteDataValueMapper.class);
|
2022-06-30 14:21:29 +08:00
|
|
|
List<List<Long>> partition = Lists.partition(attendQuoteDataIds, 500);
|
|
|
|
|
partition.forEach(mapper::deleteByAttendQuoteDataIds);
|
2022-03-15 14:18:04 +08:00
|
|
|
sqlSession.commit();
|
|
|
|
|
} finally {
|
|
|
|
|
sqlSession.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<AttendQuoteDataValuePO> listSome(AttendQuoteDataValuePO param) {
|
|
|
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
|
|
|
try {
|
|
|
|
|
AttendQuoteDataValueMapper mapper = sqlSession.getMapper(AttendQuoteDataValueMapper.class);
|
|
|
|
|
return mapper.listSome(param);
|
|
|
|
|
} finally {
|
|
|
|
|
sqlSession.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-16 14:29:02 +08:00
|
|
|
public void insertData(List<AttendQuoteDataValuePO> values) {
|
2022-05-26 13:41:58 +08:00
|
|
|
if(CollectionUtils.isEmpty(values)){
|
|
|
|
|
return;
|
|
|
|
|
}
|
2022-03-16 14:29:02 +08:00
|
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
|
|
|
try {
|
|
|
|
|
AttendQuoteDataValueMapper mapper = sqlSession.getMapper(AttendQuoteDataValueMapper.class);
|
2022-05-26 13:41:58 +08:00
|
|
|
List<List<AttendQuoteDataValuePO>> partition = Lists.partition(values, 100);
|
|
|
|
|
partition.forEach(mapper::insertData);
|
2022-03-16 14:29:02 +08:00
|
|
|
sqlSession.commit();
|
|
|
|
|
} finally {
|
|
|
|
|
sqlSession.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-04-24 17:42:32 +08:00
|
|
|
|
|
|
|
|
public void deleteByAttendQuoteIds(ArrayList<Long> quoteIds) {
|
|
|
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
|
|
|
try {
|
|
|
|
|
AttendQuoteDataValueMapper mapper = sqlSession.getMapper(AttendQuoteDataValueMapper.class);
|
|
|
|
|
mapper.deleteByAttendIds(quoteIds);
|
|
|
|
|
sqlSession.commit();
|
|
|
|
|
} finally {
|
|
|
|
|
sqlSession.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-15 14:18:04 +08:00
|
|
|
}
|