package com.ruoyi.mall.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.MallConfigMapper;
import com.ruoyi.mall.domain.MallConfig;
import com.ruoyi.mall.service.IMallConfigService;

/**
 * 商城相关设置Service业务层处理
 *
 * @author ruoyi
 * @date 2024-03-26
 */
@Service
public class MallConfigServiceImpl implements IMallConfigService
{
    @Autowired
    private MallConfigMapper mallConfigMapper;

    /**
     * 查询商城相关设置
     *
     * @param id 商城相关设置主键
     * @return 商城相关设置
     */
    @Override
    public MallConfig selectMallConfigById(Long id)
    {
        return mallConfigMapper.selectMallConfigById(id);
    }

    /**
     * 查询商城相关设置列表
     *
     * @param mallConfig 商城相关设置
     * @return 商城相关设置
     */
    @Override
    public List<MallConfig> selectMallConfigList(MallConfig mallConfig)
    {
        return mallConfigMapper.selectMallConfigList(mallConfig);
    }

    /**
     * 新增商城相关设置
     *
     * @param mallConfig 商城相关设置
     * @return 结果
     */
    @Override
    public int insertMallConfig(MallConfig mallConfig)
    {
        mallConfig.setCreateAt(DateUtils.getTime());
        return mallConfigMapper.insertMallConfig(mallConfig);
    }

    /**
     * 修改商城相关设置
     *
     * @param mallConfig 商城相关设置
     * @return 结果
     */
    @Override
    public int updateMallConfig(MallConfig mallConfig)
    {
        mallConfig.setUpdateAt(DateUtils.getTime());
        return mallConfigMapper.updateMallConfig(mallConfig);
    }

    /**
     * 批量删除商城相关设置
     *
     * @param ids 需要删除的商城相关设置主键
     * @return 结果
     */
    @Override
    public int deleteMallConfigByIds(Long[] ids)
    {
        return mallConfigMapper.deleteMallConfigByIds(ids);
    }

    /**
     * 删除商城相关设置信息
     *
     * @param id 商城相关设置主键
     * @return 结果
     */
    @Override
    public int deleteMallConfigById(Long id)
    {
        return mallConfigMapper.deleteMallConfigById(id);
    }

    /**
     * 根据设置标识查询商城相关设置
     *
     * @param identifying 设置标识
     * @return 商城相关设置
     */
    @Override
    public MallConfig selectMallConfigByIdentifying(String identifying) {
        return mallConfigMapper.selectMallConfigByIdentifying(identifying);
    }
}
