103 lines
3.5 KiB
Java
103 lines
3.5 KiB
Java
package com.engine.salary.biz;
|
|
|
|
import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO;
|
|
import com.engine.salary.entity.datacollection.param.AttendQuoteFieldQueryParam;
|
|
import com.engine.salary.entity.datacollection.po.AttendQuoteFieldPO;
|
|
import com.engine.salary.mapper.datacollection.AttendQuoteFieldMapper;
|
|
import org.apache.ibatis.session.SqlSession;
|
|
import weaver.conn.mybatis.MyBatisFactory;
|
|
|
|
import java.util.Collection;
|
|
import java.util.List;
|
|
|
|
public class AttendQuoteFieldBiz {
|
|
|
|
public List<AttendQuoteFieldPO> listSome(AttendQuoteFieldPO param) {
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
try {
|
|
AttendQuoteFieldMapper mapper = sqlSession.getMapper(AttendQuoteFieldMapper.class);
|
|
return mapper.listSome(param);
|
|
} finally {
|
|
sqlSession.close();
|
|
}
|
|
}
|
|
|
|
public void save(AttendQuoteFieldPO po) {
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
try {
|
|
AttendQuoteFieldMapper mapper = sqlSession.getMapper(AttendQuoteFieldMapper.class);
|
|
mapper.insertIgnoreNull(po);
|
|
|
|
sqlSession.commit();
|
|
} finally {
|
|
sqlSession.close();
|
|
}
|
|
}
|
|
|
|
public AttendQuoteFieldPO getById(Long id) {
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
try {
|
|
AttendQuoteFieldMapper mapper = sqlSession.getMapper(AttendQuoteFieldMapper.class);
|
|
return mapper.getById(id);
|
|
} finally {
|
|
sqlSession.close();
|
|
}
|
|
}
|
|
|
|
public void update(AttendQuoteFieldPO po) {
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
try {
|
|
AttendQuoteFieldMapper mapper = sqlSession.getMapper(AttendQuoteFieldMapper.class);
|
|
mapper.updateIgnoreNull(po);
|
|
|
|
sqlSession.commit();
|
|
} finally {
|
|
sqlSession.close();
|
|
}
|
|
|
|
}
|
|
|
|
public List<AttendQuoteFieldListDTO> list(AttendQuoteFieldQueryParam param) {
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
try {
|
|
AttendQuoteFieldMapper mapper = sqlSession.getMapper(AttendQuoteFieldMapper.class);
|
|
return mapper.list(param);
|
|
} finally {
|
|
sqlSession.close();
|
|
}
|
|
}
|
|
|
|
public void deleteByIds(Collection<Long> ids) {
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
try {
|
|
AttendQuoteFieldMapper mapper = sqlSession.getMapper(AttendQuoteFieldMapper.class);
|
|
mapper.deleteByIds(ids);
|
|
sqlSession.commit();
|
|
} finally {
|
|
sqlSession.close();
|
|
}
|
|
}
|
|
|
|
public void saveBatch(List<AttendQuoteFieldPO> saves) {
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
try {
|
|
AttendQuoteFieldMapper mapper = sqlSession.getMapper(AttendQuoteFieldMapper.class);
|
|
mapper.saveBatch(saves);
|
|
sqlSession.commit();
|
|
} finally {
|
|
sqlSession.close();
|
|
}
|
|
}
|
|
|
|
public void deleteAttendByCode(AttendQuoteFieldQueryParam param) {
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
try {
|
|
AttendQuoteFieldMapper mapper = sqlSession.getMapper(AttendQuoteFieldMapper.class);
|
|
mapper.deleteAttendByCode(param);
|
|
sqlSession.commit();
|
|
} finally {
|
|
sqlSession.close();
|
|
}
|
|
}
|
|
}
|