package org.example.mybatisplus.service.impl;

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

import org.example.mybatisplus.service.ICmsEntRiskFinancialTaxAuthService;
import org.example.mybatisplus.tools.ConvertUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.example.mybatisplus.mapper.auto.CmsEntRiskFinancialTaxAuthMapper;
import org.example.mybatisplus.model.auto.CmsEntRiskFinancialTaxAuth;
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:31
 */
@Service
public class CmsEntRiskFinancialTaxAuthServiceImpl extends ServiceImpl<CmsEntRiskFinancialTaxAuthMapper, CmsEntRiskFinancialTaxAuth> implements ICmsEntRiskFinancialTaxAuthService {

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

    @Autowired
    private CmsEntRiskFinancialTaxAuthMapper cmsEntRiskFinancialTaxAuthMapper;
                                                                                                                                                                                                                                            /**
     * 查询企业财税合规风险信息授权
     *
     * @param id
     * @return CmsEntRiskFinancialTaxAuth
     */
    @Override
    public CmsEntRiskFinancialTaxAuth selectCmsEntRiskFinancialTaxAuthById(Long id) {
        return this.baseMapper.selectById(id);
    }

    /**
     * 查询企业财税合规风险信息授权列表
     *
     * @param queryWrapper
     * @return CmsEntRiskFinancialTaxAuth集合
     */
    @Override
    public List<CmsEntRiskFinancialTaxAuth> selectCmsEntRiskFinancialTaxAuthList(Wrapper<CmsEntRiskFinancialTaxAuth> queryWrapper) {
        return this.baseMapper.selectList(queryWrapper);
    }

    /**
     * 查询企业财税合规风险信息授权列表
     *
     * @param cmsEntRiskFinancialTaxAuth
     * @return CmsEntRiskFinancialTaxAuth集合
     */
    @Override
    public List<CmsEntRiskFinancialTaxAuth> selectCmsEntRiskFinancialTaxAuthList(CmsEntRiskFinancialTaxAuth cmsEntRiskFinancialTaxAuth) {
		Map<String, Object> map = BeanUtil.beanToMap(cmsEntRiskFinancialTaxAuth, true, true);
		QueryWrapper<CmsEntRiskFinancialTaxAuth> queryWrapper = new QueryWrapper<CmsEntRiskFinancialTaxAuth>();
		queryWrapper.allEq(map,false);
		return this.baseMapper.selectList(queryWrapper);
    }

    /**
     * 新增企业财税合规风险信息授权
     *
     * @param cmsEntRiskFinancialTaxAuth
     * @return 结果
     */
    @Override
    public int insertCmsEntRiskFinancialTaxAuth(CmsEntRiskFinancialTaxAuth cmsEntRiskFinancialTaxAuth) {
        return this.baseMapper.insert(cmsEntRiskFinancialTaxAuth);
    }

    /**
     * 修改企业财税合规风险信息授权
     *
     * @param cmsEntRiskFinancialTaxAuth
     * @return 结果
     */
    @Override
    public int updateCmsEntRiskFinancialTaxAuth (CmsEntRiskFinancialTaxAuth  cmsEntRiskFinancialTaxAuth) {
        return this.baseMapper.updateById(cmsEntRiskFinancialTaxAuth);
    }

    /**
     * 批量删除企业财税合规风险信息授权
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCmsEntRiskFinancialTaxAuthByIds(String ids) {
        return this.baseMapper.deleteBatchIds(Arrays.asList(ConvertUtil.toStrArray(ids)));
    }

    /**
     * 删除企业财税合规风险信息授权信息
     *
     * @param id
     * @return 结果
     */
    @Override
    public int deleteCmsEntRiskFinancialTaxAuthById(Long id) {
        return this.baseMapper.deleteById(id);
    }

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