66 lines
2.2 KiB
Java
66 lines
2.2 KiB
Java
package com.engine.salary.biz;
|
|
|
|
import com.engine.salary.entity.datacollection.dto.AttendQuoteDataBaseDTO;
|
|
import com.engine.salary.entity.datacollection.param.AttendQuoteDataQueryParam;
|
|
import com.engine.salary.entity.datacollection.po.AttendQuoteDataPO;
|
|
import com.engine.salary.mapper.datacollection.AttendQuoteDataMapper;
|
|
import com.google.common.collect.Lists;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.ibatis.session.SqlSession;
|
|
import weaver.conn.mybatis.MyBatisFactory;
|
|
|
|
import java.util.List;
|
|
|
|
public class AttendQuoteDataBiz {
|
|
|
|
public List<AttendQuoteDataBaseDTO> list(AttendQuoteDataQueryParam param) {
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
try {
|
|
AttendQuoteDataMapper mapper = sqlSession.getMapper(AttendQuoteDataMapper.class);
|
|
return mapper.list(param);
|
|
} finally {
|
|
sqlSession.close();
|
|
}
|
|
}
|
|
|
|
public List<AttendQuoteDataPO> listSome(AttendQuoteDataQueryParam param) {
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
try {
|
|
AttendQuoteDataMapper mapper = sqlSession.getMapper(AttendQuoteDataMapper.class);
|
|
return mapper.listSome(param);
|
|
} finally {
|
|
sqlSession.close();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void deleteByAttendQuoteIds(List<Long> unAccountingIds) {
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
try {
|
|
AttendQuoteDataMapper mapper = sqlSession.getMapper(AttendQuoteDataMapper.class);
|
|
mapper.deleteByAttendQuoteIds(unAccountingIds);
|
|
sqlSession.commit();
|
|
} finally {
|
|
sqlSession.close();
|
|
}
|
|
|
|
}
|
|
|
|
public void insertData(List<AttendQuoteDataPO> pos) {
|
|
if(CollectionUtils.isEmpty(pos)){
|
|
return;
|
|
}
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
try {
|
|
AttendQuoteDataMapper mapper = sqlSession.getMapper(AttendQuoteDataMapper.class);
|
|
List<List<AttendQuoteDataPO>> partition = Lists.partition(pos, 100);
|
|
partition.forEach(mapper::insertData);
|
|
sqlSession.commit();
|
|
} finally {
|
|
sqlSession.close();
|
|
}
|
|
}
|
|
|
|
}
|