package com.fs.wx.sop.service.impl;

import java.util.List;

import com.fs.common.annotation.DataSource;
import com.fs.common.enums.DataSourceType;
import com.fs.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.wx.sop.mapper.WxSopUserMapper;
import com.fs.wx.sop.domain.WxSopUser;
import com.fs.wx.sop.service.IWxSopUserService;

/**
 * 个微营期Service业务层处理
 * 
 * @author 吴树波
 * @date 2026-02-24
 */
@Service
public class WxSopUserServiceImpl extends ServiceImpl<WxSopUserMapper, WxSopUser> implements IWxSopUserService {

    /**
     * 查询个微营期
     * 
     * @param id 个微营期主键
     * @return 个微营期
     */
    @Override
    @DataSource(DataSourceType.SOP)
    public WxSopUser selectWxSopUserById(Long id)
    {
        return baseMapper.selectWxSopUserById(id);
    }

    /**
     * 查询个微营期列表
     * 
     * @param wxSopUser 个微营期
     * @return 个微营期
     */
    @Override
    @DataSource(DataSourceType.SOP)
    public List<WxSopUser> selectWxSopUserList(WxSopUser wxSopUser)
    {
        return baseMapper.selectWxSopUserList(wxSopUser);
    }

    /**
     * 新增个微营期
     * 
     * @param wxSopUser 个微营期
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SOP)
    public int insertWxSopUser(WxSopUser wxSopUser)
    {
        wxSopUser.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertWxSopUser(wxSopUser);
    }

    /**
     * 修改个微营期
     * 
     * @param wxSopUser 个微营期
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SOP)
    public int updateWxSopUser(WxSopUser wxSopUser)
    {
        wxSopUser.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateWxSopUser(wxSopUser);
    }

    /**
     * 批量删除个微营期
     * 
     * @param ids 需要删除的个微营期主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SOP)
    public int deleteWxSopUserByIds(Long[] ids)
    {
        return baseMapper.deleteWxSopUserByIds(ids);
    }

    /**
     * 删除个微营期信息
     * 
     * @param id 个微营期主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SOP)
    public int deleteWxSopUserById(Long id)
    {
        return baseMapper.deleteWxSopUserById(id);
    }
}
