package com.chinaweal.aiccs.aiccs.business.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.chinaweal.aiccs.aiccs.business.entity.TSRefGroupAndUser;
import com.chinaweal.aiccs.aiccs.business.mapper.TSRefGroupAndUserMapper;
import com.chinaweal.aiccs.aiccs.business.service.TSRefGroupAndUserService;
import com.chinaweal.youfool.framework.springboot.mybatis.plus.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 业务组用户与流程关系表 服务实现类
 * </p>
 *
 * @author <a href="https://blog.lroyia.top">lroyia</a>
 * @since 2021-01-29
 */
@Service
public class TSRefGroupAndUserServiceImpl extends BaseServiceImpl<TSRefGroupAndUserMapper, TSRefGroupAndUser> implements TSRefGroupAndUserService {

    @Override
    public List<TSRefGroupAndUser> findRefGroupAndUserByGroupid(String groupId) {
        return list(new LambdaQueryWrapper<TSRefGroupAndUser>().eq(TSRefGroupAndUser::getGroupid, groupId));
    }

    @Override
    public void deleteRefgroupanduserByGroupid(String groupId, String processId) {
        remove(new LambdaQueryWrapper<TSRefGroupAndUser>().eq(TSRefGroupAndUser::getGroupid, groupId).eq(TSRefGroupAndUser::getProcessid, processId));
    }
}
