package com.ruoyi.frequency.klkaccounattach.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.frequency.klkaccounattach.mapper.KlkAccountAttachMapper;
import com.ruoyi.frequency.klkaccounattach.entity.KlkAccountAttach;
import com.ruoyi.frequency.klkaccounattach.service.KlkAccountAttachService;

/**
 * 拉卡拉平台账号信息附件Service业务层处理
 *
 * @author liwenlong
 * @date 2024-05-07
 */
@Service
public class KlkAccountAttachServiceImpl extends ServiceImpl<KlkAccountAttachMapper, KlkAccountAttach>  implements KlkAccountAttachService
{
    @Autowired
    private KlkAccountAttachMapper klkAccountAttachMapper;

    /**
     * 查询拉卡拉平台账号信息附件
     *
     * @param id 拉卡拉平台账号信息附件主键
     * @return 拉卡拉平台账号信息附件
     */
    @Override
    public KlkAccountAttach selectKlkAccountAttachById(Long id)
    {
        return klkAccountAttachMapper.selectKlkAccountAttachById(id);
    }

    /**
     * 查询拉卡拉平台账号信息附件列表
     *
     * @param klkAccountAttach 拉卡拉平台账号信息附件
     * @return 拉卡拉平台账号信息附件
     */
    @Override
    public List<KlkAccountAttach> selectKlkAccountAttachList(KlkAccountAttach klkAccountAttach)
    {
        return klkAccountAttachMapper.selectKlkAccountAttachList(klkAccountAttach);
    }

    /**
     * 新增拉卡拉平台账号信息附件
     *
     * @param klkAccountAttach 拉卡拉平台账号信息附件
     * @return 结果
     */
    @Override
    public int insertKlkAccountAttach(KlkAccountAttach klkAccountAttach)
    {
        klkAccountAttach.setCreateData();
        return klkAccountAttachMapper.insert(klkAccountAttach);
    }

    /**
     * 修改拉卡拉平台账号信息附件
     *
     * @param klkAccountAttach 拉卡拉平台账号信息附件
     * @return 结果
     */
    @Override
    public int updateKlkAccountAttach(KlkAccountAttach klkAccountAttach)
    {
        klkAccountAttach.setUpdateData();
        return klkAccountAttachMapper.updateKlkAccountAttach(klkAccountAttach);
    }

    /**
     * 批量删除拉卡拉平台账号信息附件
     *
     * @param ids 需要删除的拉卡拉平台账号信息附件主键
     * @return 结果
     */
    @Override
    public int deleteKlkAccountAttachByIds(Long[] ids,Integer delFlag)
    {
        this.lambdaUpdate().set(KlkAccountAttach::getDelFlag,delFlag).in(KlkAccountAttach::getId,ids).update();
        return ids.length;
    }

}
