package org.example.mybatisplus.service.impl;

import java.util.List;
import java.util.Arrays;
import java.util.Map;

import org.example.mybatisplus.service.ICmsEntRiskQxbInfoRelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.example.mybatisplus.tools.ConvertUtil;
import org.example.mybatisplus.mapper.auto.CmsEntRiskQxbInfoRelMapper;
import org.example.mybatisplus.model.auto.CmsEntRiskQxbInfoRel;
import cn.hutool.core.bean.BeanUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 启信宝企业风控关系表Service业务层处理
 *
 * @author 各类开发联系微信：qiubbstop     fuce
 * @date 2025-03-09 23:36:05
 */
@Service
public class CmsEntRiskQxbInfoRelServiceImpl extends ServiceImpl<CmsEntRiskQxbInfoRelMapper, CmsEntRiskQxbInfoRel> implements ICmsEntRiskQxbInfoRelService {

    private static final Logger logger = LoggerFactory.getLogger(CmsEntRiskQxbInfoRelServiceImpl.class);

    @Autowired
    private CmsEntRiskQxbInfoRelMapper cmsEntRiskQxbInfoRelMapper;
                                                                                                                                                                                                                                                                                                                    /**
     * 查询启信宝企业风控关系表
     *
     * @param id
     * @return CmsEntRiskQxbInfoRel
     */
    @Override
    public CmsEntRiskQxbInfoRel selectCmsEntRiskQxbInfoRelById(Long id) {
        return this.baseMapper.selectById(id);
    }

    /**
     * 查询启信宝企业风控关系表列表
     *
     * @param queryWrapper
     * @return CmsEntRiskQxbInfoRel集合
     */
    @Override
    public List<CmsEntRiskQxbInfoRel> selectCmsEntRiskQxbInfoRelList(Wrapper<CmsEntRiskQxbInfoRel> queryWrapper) {
        return this.baseMapper.selectList(queryWrapper);
    }

    /**
     * 查询启信宝企业风控关系表列表
     *
     * @param cmsEntRiskQxbInfoRel
     * @return CmsEntRiskQxbInfoRel集合
     */
    @Override
    public List<CmsEntRiskQxbInfoRel> selectCmsEntRiskQxbInfoRelList(CmsEntRiskQxbInfoRel cmsEntRiskQxbInfoRel) {
		Map<String, Object> map = BeanUtil.beanToMap(cmsEntRiskQxbInfoRel, true, true);
		QueryWrapper<CmsEntRiskQxbInfoRel> queryWrapper = new QueryWrapper<CmsEntRiskQxbInfoRel>();
		queryWrapper.allEq(map,false);
		return this.baseMapper.selectList(queryWrapper);
    }

    /**
     * 新增启信宝企业风控关系表
     *
     * @param cmsEntRiskQxbInfoRel
     * @return 结果
     */
    @Override
    public int insertCmsEntRiskQxbInfoRel(CmsEntRiskQxbInfoRel cmsEntRiskQxbInfoRel) {
        return this.baseMapper.insert(cmsEntRiskQxbInfoRel);
    }

    /**
     * 修改启信宝企业风控关系表
     *
     * @param cmsEntRiskQxbInfoRel
     * @return 结果
     */
    @Override
    public int updateCmsEntRiskQxbInfoRel (CmsEntRiskQxbInfoRel  cmsEntRiskQxbInfoRel) {
        return this.baseMapper.updateById(cmsEntRiskQxbInfoRel);
    }

    /**
     * 批量删除启信宝企业风控关系表
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCmsEntRiskQxbInfoRelByIds(String ids) {
        return this.baseMapper.deleteBatchIds(Arrays.asList(ConvertUtil.toStrArray(ids)));
    }

    /**
     * 删除启信宝企业风控关系表信息
     *
     * @param id
     * @return 结果
     */
    @Override
    public int deleteCmsEntRiskQxbInfoRelById(Long id) {
        return this.baseMapper.deleteById(id);
    }

    /**
     * 修改权限状态展示或者不展示
     *
     * @param cmsEntRiskQxbInfoRel
     * @return
     */
    @Override
    public int updateVisible(CmsEntRiskQxbInfoRel cmsEntRiskQxbInfoRel) {
        return this.baseMapper.updateById(cmsEntRiskQxbInfoRel);
    }
}
