package com.younike.system.service.impl;

import java.util.List;
import java.time.LocalDateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.younike.system.mapper.MerchantLogMapper;
import com.younike.system.domain.MerchantLog;
import com.younike.system.service.IMerchantLogService;

/**
 * 店铺信息Service业务层处理
 * 
 * @author elev
 * @date 2022-01-10
 */
@Service
public class MerchantLogServiceImpl implements IMerchantLogService {
    @Autowired
    private MerchantLogMapper merchantLogMapper;

    /**
     * 查询店铺信息
     * 
     * @param merchantId 店铺信息主键
     * @return 店铺信息
     */
    @Override
    public MerchantLog selectMerchantLogByMerchantId(Long merchantId) {
        return merchantLogMapper.selectMerchantLogByMerchantId(merchantId);
    }

    /**
     * 查询店铺信息列表
     * 
     * @param merchantLog 店铺信息
     * @return 店铺信息
     */
    @Override
    public List<MerchantLog> selectMerchantLogList(MerchantLog merchantLog) {
        return merchantLogMapper.selectMerchantLogList(merchantLog);
    }

    /**
     * 新增店铺信息
     * 
     * @param merchantLog 店铺信息
     * @return 结果
     */
    @Override
    public int insertMerchantLog(MerchantLog merchantLog) {
        merchantLog.setCreateTime(LocalDateTime.now());
        return merchantLogMapper.insertMerchantLog(merchantLog);
    }

    /**
     * 修改店铺信息
     * 
     * @param merchantLog 店铺信息
     * @return 结果
     */
    @Override
    public int updateMerchantLog(MerchantLog merchantLog) {
        merchantLog.setUpdateTime(LocalDateTime.now());
        return merchantLogMapper.updateMerchantLog(merchantLog);
    }

    /**
     * 批量删除店铺信息
     * 
     * @param merchantIds 需要删除的店铺信息主键
     * @return 结果
     */
    @Override
    public int deleteMerchantLogByMerchantIds(Long[] merchantIds) {
        return merchantLogMapper.deleteMerchantLogByMerchantIds(merchantIds);
    }

    /**
     * 删除店铺信息信息
     * 
     * @param merchantId 店铺信息主键
     * @return 结果
     */
    @Override
    public int deleteMerchantLogByMerchantId(Long merchantId)
    {
        return merchantLogMapper.deleteMerchantLogByMerchantId(merchantId);
    }
}
