package com.fs.his.service.impl;

import java.util.List;
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.his.mapper.FsDfAccountMapper;
import com.fs.his.domain.FsDfAccount;
import com.fs.his.service.IFsDfAccountService;

/**
 * 代服账户Service业务层处理
 *
 * @author fs
 * @date 2025-10-13
 */
@Service
public class FsDfAccountServiceImpl extends ServiceImpl<FsDfAccountMapper, FsDfAccount> implements IFsDfAccountService {

    /**
     * 查询代服账户
     *
     * @param id 代服账户主键
     * @return 代服账户
     */
    @Override
    public FsDfAccount selectFsDfAccountById(Long id)
    {
        return baseMapper.selectFsDfAccountById(id);
    }

    /**
     * 查询代服账户列表
     *
     * @param fsDfAccount 代服账户
     * @return 代服账户
     */
    @Override
    public List<FsDfAccount> selectFsDfAccountList(FsDfAccount fsDfAccount)
    {
        return baseMapper.selectFsDfAccountList(fsDfAccount);
    }

    /**
     * 新增代服账户
     *
     * @param fsDfAccount 代服账户
     * @return 结果
     */
    @Override
    public int insertFsDfAccount(FsDfAccount fsDfAccount)
    {
        fsDfAccount.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertFsDfAccount(fsDfAccount);
    }

    /**
     * 修改代服账户
     *
     * @param fsDfAccount 代服账户
     * @return 结果
     */
    @Override
    public int updateFsDfAccount(FsDfAccount fsDfAccount)
    {
        fsDfAccount.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateFsDfAccount(fsDfAccount);
    }

    /**
     * 批量删除代服账户
     *
     * @param ids 需要删除的代服账户主键
     * @return 结果
     */
    @Override
    public int deleteFsDfAccountByIds(Long[] ids)
    {
        return baseMapper.deleteFsDfAccountByIds(ids);
    }

    /**
     * 删除代服账户信息
     *
     * @param id 代服账户主键
     * @return 结果
     */
    @Override
    public int deleteFsDfAccountById(Long id)
    {
        return baseMapper.deleteFsDfAccountById(id);
    }

    @Override
    public FsDfAccount selectFsDfAccountByAccount(String loginAccount) {
        return baseMapper.selectFsDfAccountByAccount(loginAccount);
    }
}
