package com.fs.sop.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fs.common.annotation.DataSource;
import com.fs.common.enums.DataSourceType;
import com.fs.sop.domain.SopUserLogsWx;
import com.fs.sop.mapper.SopUserLogsWxMapper;
import com.fs.sop.service.ISopUserLogsWxService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 个微sop营期Service业务层处理
 *
 * @author fs
 * @date 2025-03-12
 */
@Service
@DataSource(DataSourceType.SOP)
public class SopUserLogsWxServiceImpl extends ServiceImpl<SopUserLogsWxMapper, SopUserLogsWx> implements ISopUserLogsWxService {

    /**
     * 查询个微sop营期
     *
     * @param id 个微sop营期主键
     * @return 个微sop营期
     */
    @Override
    public SopUserLogsWx selectSopUserLogsWxById(Long id)
    {
        return baseMapper.selectSopUserLogsWxById(id);
    }

    /**
     * 查询个微sop营期列表
     *
     * @param sopUserLogsWx 个微sop营期
     * @return 个微sop营期
     */
    @Override
    public List<SopUserLogsWx> selectSopUserLogsWxList(SopUserLogsWx sopUserLogsWx)
    {
        return baseMapper.selectSopUserLogsWxList(sopUserLogsWx);
    }

    /**
     * 新增个微sop营期
     *
     * @param sopUserLogsWx 个微sop营期
     * @return 结果
     */
    @Override
    public int insertSopUserLogsWx(SopUserLogsWx sopUserLogsWx)
    {
        return baseMapper.insertSopUserLogsWx(sopUserLogsWx);
    }

    /**
     * 修改个微sop营期
     *
     * @param sopUserLogsWx 个微sop营期
     * @return 结果
     */
    @Override
    public int updateSopUserLogsWx(SopUserLogsWx sopUserLogsWx)
    {
        return baseMapper.updateSopUserLogsWx(sopUserLogsWx);
    }

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

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

    @Override
    @DataSource(DataSourceType.SOP)
    public void insertList(List<SopUserLogsWx> collect) {
        super.saveBatch(collect);
    }

    @Override
    @DataSource(DataSourceType.SOP)
    public List<SopUserLogsWx> listBySopId(String id) {
        return list(new QueryWrapper<SopUserLogsWx>().eq("sop_id", id));
    }
}
