package com.ruoyi.szxc.service.impl;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.szxc.domain.SzxcWishManage;
import com.ruoyi.szxc.mapper.SzxcWishManageMapper;
import com.ruoyi.szxc.service.ISzxcWishManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

/**
 * 心愿管理Service业务层处理
 * 
 * @author hs
 * @date 2024-04-03
 */
@Service
public class SzxcWishManageServiceImpl implements ISzxcWishManageService 
{
    @Autowired
    private SzxcWishManageMapper szxcWishManageMapper;

    /**
     * 查询心愿管理
     * 
     * @param id 心愿管理主键
     * @return 心愿管理
     */
    @Override
    public SzxcWishManage selectSzxcWishManageById(Long id)
    {
        return szxcWishManageMapper.selectSzxcWishManageById(id);
    }

    /**
     * 查询心愿管理列表
     * 
     * @param szxcWishManage 心愿管理
     * @return 心愿管理
     */
    @Override
    @DataScope(deptAlias = "w")
    public List<SzxcWishManage> selectSzxcWishManageList(SzxcWishManage szxcWishManage)
    {
        return szxcWishManageMapper.selectSzxcWishManageList(szxcWishManage);
    }

    /**
     * 新增心愿管理
     * 
     * @param szxcWishManage 心愿管理
     * @return 结果
     */
    @Override
    public int insertSzxcWishManage(SzxcWishManage szxcWishManage)
    {
        szxcWishManage.setCreateTime(DateUtils.getNowDate());
        return szxcWishManageMapper.insertSzxcWishManage(szxcWishManage);
    }

    /**
     * 修改心愿管理
     * 
     * @param szxcWishManage 心愿管理
     * @return 结果
     */
    @Override
    public int updateSzxcWishManage(SzxcWishManage szxcWishManage)
    {
        szxcWishManage.setUpdateTime(DateUtils.getNowDate());
        return szxcWishManageMapper.updateSzxcWishManage(szxcWishManage);
    }

    /**
     * 批量删除心愿管理
     * 
     * @param ids 需要删除的心愿管理主键
     * @return 结果
     */
    @Override
    public int deleteSzxcWishManageByIds(Long[] ids)
    {
        return szxcWishManageMapper.deleteSzxcWishManageByIds(ids);
    }

    @Override
    public List<Map<String, Object>> getWishData() {
        return szxcWishManageMapper.getWishData() ;
    }

    /**
     * 删除心愿管理信息
     * 
     * @param id 心愿管理主键
     * @return 结果
     */
    @Override
    public int deleteSzxcWishManageById(Long id)
    {
        return szxcWishManageMapper.deleteSzxcWishManageById(id);
    }
}
