com.didiglobal.logi.security.dao.impl.OplogExtraDaoImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of logi-security-spring-boot-starter Show documentation
Show all versions of logi-security-spring-boot-starter Show documentation
logi-security 提供项目大多都需要的一些基础功能(用户、角色、权限、登录、注册、操作记录)
package com.didiglobal.logi.security.dao.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.didiglobal.logi.security.common.entity.OplogExtra;
import com.didiglobal.logi.security.common.po.OplogExtraPO;
import com.didiglobal.logi.security.dao.OplogExtraDao;
import com.didiglobal.logi.security.dao.mapper.OplogExtraMapper;
import com.didiglobal.logi.security.util.CopyBeanUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.List;
/**
* @author cjm
*/
@Component
public class OplogExtraDaoImpl extends BaseDaoImpl implements OplogExtraDao {
@Autowired
private OplogExtraMapper oplogExtraMapper;
@Override
public List selectListByType(Integer type) {
QueryWrapper queryWrapper = getQueryWrapper();
queryWrapper.eq(FieldConstant.TYPE, type);
return CopyBeanUtil.copyList(oplogExtraMapper.selectList(queryWrapper), OplogExtra.class);
}
@Override
public void insertBatch(List oplogExtraList) {
if(CollectionUtils.isEmpty(oplogExtraList)) {
return;
}
List oplogExtraPOList = CopyBeanUtil.copyList(oplogExtraList, OplogExtraPO.class);
for(OplogExtraPO oplogExtraPO : oplogExtraPOList) {
oplogExtraMapper.insert(oplogExtraPO);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy