package com.huijy.management.service.impl;

import java.util.List;
import com.huijy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.huijy.management.mapper.MemberHelpMapper;
import com.huijy.management.domain.MemberHelp;
import com.huijy.management.service.IMemberHelpService;

/**
 * 求助记录Service业务层处理
 *
 * @author luobo
 * @date 2021-09-12
 */
@Service
public class MemberHelpServiceImpl implements IMemberHelpService
{
    @Autowired
    private MemberHelpMapper memberHelpMapper;

    /**
     * 查询求助记录
     *
     * @param memberHelpId 求助记录主键
     * @return 求助记录
     */
    @Override
    public MemberHelp selectMemberHelpByMemberHelpId(Long memberHelpId)
    {
        return memberHelpMapper.selectMemberHelpByMemberHelpId(memberHelpId);
    }

    /**
     * 查询求助记录列表
     *
     * @param memberHelp 求助记录
     * @return 求助记录
     */
    @Override
    public List<MemberHelp> selectMemberHelpList(MemberHelp memberHelp)
    {
        return memberHelpMapper.selectMemberHelpList(memberHelp);
    }

    /**
     * 新增求助记录
     *
     * @param memberHelp 求助记录
     * @return 结果
     */
    @Override
    public int insertMemberHelp(MemberHelp memberHelp)
    {
        memberHelp.setCreateTime(DateUtils.getNowDate());
        return memberHelpMapper.insertMemberHelp(memberHelp);
    }

    /**
     * 修改求助记录
     *
     * @param memberHelp 求助记录
     * @return 结果
     */
    @Override
    public int updateMemberHelp(MemberHelp memberHelp)
    {
        return memberHelpMapper.updateMemberHelp(memberHelp);
    }

    /**
     * 批量删除求助记录
     *
     * @param memberHelpIds 需要删除的求助记录主键
     * @return 结果
     */
    @Override
    public int deleteMemberHelpByMemberHelpIds(Long[] memberHelpIds)
    {
        return memberHelpMapper.deleteMemberHelpByMemberHelpIds(memberHelpIds);
    }

    /**
     * 删除求助记录信息
     *
     * @param memberHelpId 求助记录主键
     * @return 结果
     */
    @Override
    public int deleteMemberHelpByMemberHelpId(Long memberHelpId)
    {
        return memberHelpMapper.deleteMemberHelpByMemberHelpId(memberHelpId);
    }
}
