package org.example.mybatisplus.service.impl;

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

import org.example.mybatisplus.service.ICmsEntRiskFinancialTaxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.example.mybatisplus.tools.ConvertUtil;
import org.example.mybatisplus.mapper.auto.CmsEntRiskFinancialTaxMapper;
import org.example.mybatisplus.model.auto.CmsEntRiskFinancialTax;
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:24
 */
@Service
public class CmsEntRiskFinancialTaxServiceImpl extends ServiceImpl<CmsEntRiskFinancialTaxMapper, CmsEntRiskFinancialTax> implements ICmsEntRiskFinancialTaxService {

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

    @Autowired
    private CmsEntRiskFinancialTaxMapper cmsEntRiskFinancialTaxMapper;
                                                                                                                                                                                                                                                                                                                    /**
     * 查询企业财税合规风险信息表
     *
     * @param id
     * @return CmsEntRiskFinancialTax
     */
    @Override
    public CmsEntRiskFinancialTax selectCmsEntRiskFinancialTaxById(Long id) {
        return this.baseMapper.selectById(id);
    }

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

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

    /**
     * 新增企业财税合规风险信息表
     *
     * @param cmsEntRiskFinancialTax
     * @return 结果
     */
    @Override
    public int insertCmsEntRiskFinancialTax(CmsEntRiskFinancialTax cmsEntRiskFinancialTax) {
        return this.baseMapper.insert(cmsEntRiskFinancialTax);
    }

    /**
     * 修改企业财税合规风险信息表
     *
     * @param cmsEntRiskFinancialTax
     * @return 结果
     */
    @Override
    public int updateCmsEntRiskFinancialTax (CmsEntRiskFinancialTax  cmsEntRiskFinancialTax) {
        return this.baseMapper.updateById(cmsEntRiskFinancialTax);
    }

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

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

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