mirror of https://gitee.com/stylefeng/roses
【8.1.1】【sys】更新批量保存用户机构
parent
993dcd4f2a
commit
8b00503b7f
|
@ -114,4 +114,12 @@ public interface SysUserOrgService extends IService<SysUserOrg>, SysUserOrgServi
|
|||
*/
|
||||
void disableAllOrgStatus(Long userId);
|
||||
|
||||
/**
|
||||
* 批量保存用户机构
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024/2/12 23:31
|
||||
*/
|
||||
void quickBatchSaveUserOrg(List<SysUserOrg> batchUserOrg);
|
||||
|
||||
}
|
|
@ -7,6 +7,8 @@ import cn.stylefeng.roses.kernel.db.api.DbOperatorApi;
|
|||
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.page.PageResult;
|
||||
import cn.stylefeng.roses.kernel.dsctn.api.context.DataSourceContext;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.DbTypeEnum;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.StatusEnum;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
|
||||
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
||||
|
@ -139,6 +141,16 @@ public class SysUserOrgServiceImpl extends ServiceImpl<SysUserOrgMapper, SysUser
|
|||
this.update(updateWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void quickBatchSaveUserOrg(List<SysUserOrg> batchUserOrg) {
|
||||
if (DbTypeEnum.MYSQL.equals(DataSourceContext.me().getCurrentDbType())) {
|
||||
this.getBaseMapper().insertBatchSomeColumn(batchUserOrg);
|
||||
} else {
|
||||
this.saveBatch(batchUserOrg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUserOrg> findList(SysUserOrgRequest sysUserOrgRequest) {
|
||||
LambdaQueryWrapper<SysUserOrg> wrapper = this.createWrapper(sysUserOrgRequest);
|
||||
|
|
Loading…
Reference in New Issue