【8.1.1】【sys】更新一个批量保存组织机构的方法

pull/60/head
fengshuonan 2024-02-19 08:43:31 +08:00
parent ed25e0a476
commit ea75733f0a
3 changed files with 21 additions and 2 deletions

View File

@ -1,7 +1,7 @@
package cn.stylefeng.roses.kernel.sys.modular.org.mapper;
import cn.stylefeng.roses.kernel.db.mp.injector.CustomBaseMapper;
import cn.stylefeng.roses.kernel.sys.modular.org.entity.HrOrganization;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* Mapper
@ -9,6 +9,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author fengshuonan
* @date 2023/06/10 21:23
*/
public interface HrOrganizationMapper extends BaseMapper<HrOrganization> {
public interface HrOrganizationMapper extends CustomBaseMapper<HrOrganization> {
}

View File

@ -153,4 +153,12 @@ public interface HrOrganizationService extends IService<HrOrganization>, Organiz
*/
List<SimpleDict> getOrgListName(HrOrganizationRequest hrOrganizationRequest);
/**
*
*
* @author fengshuonan
* @since 2024-02-19 8:42
*/
void quickBatchSaveOrg(List<HrOrganization> batchOrgList);
}

View File

@ -13,9 +13,11 @@ import cn.stylefeng.roses.kernel.db.api.factory.PageFactory;
import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory;
import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.dsctn.api.context.DataSourceContext;
import cn.stylefeng.roses.kernel.event.sdk.publish.BusinessEventPublisher;
import cn.stylefeng.roses.kernel.log.api.util.BusinessLogUtil;
import cn.stylefeng.roses.kernel.rule.constants.TreeConstants;
import cn.stylefeng.roses.kernel.rule.enums.DbTypeEnum;
import cn.stylefeng.roses.kernel.rule.enums.StatusEnum;
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
import cn.stylefeng.roses.kernel.rule.pojo.dict.SimpleDict;
@ -536,6 +538,15 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
return dictList;
}
@Override
public void quickBatchSaveOrg(List<HrOrganization> batchOrgList) {
if (DbTypeEnum.MYSQL.equals(DataSourceContext.me().getCurrentDbType())) {
this.getBaseMapper().insertBatchSomeColumn(batchOrgList);
} else {
this.saveBatch(batchOrgList);
}
}
@Override
public String getOrgNameById(Long orgId) {