package com.kmall.admin.service.impl.mk.dist;

import com.kmall.admin.dao.mk.dist.MkDistSellStatisDao;
import com.kmall.admin.entity.mk.dist.MkDistSellStatisEntity;
import com.kmall.admin.service.mk.dist.MkDistSellStatisService;
import com.kmall.admin.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 购买商品生成销售分配记录统计，渠道销售统计Service实现类
 *
 * @author huangyq
 * @email admin@qhdswl.com
 * @date 2019-04-09 18:04:46
 */
@Service("mkDistSellStatisService")
public class MkDistSellStatisServiceImpl implements MkDistSellStatisService {
    @Autowired
    private MkDistSellStatisDao mkDistSellStatisDao;

    @Override
    public MkDistSellStatisEntity queryObject(Integer id) {
        return mkDistSellStatisDao.queryObject(id);
    }

    @Override
    public List<MkDistSellStatisEntity> queryList(Map<String, Object> map) {
        return mkDistSellStatisDao.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return mkDistSellStatisDao.queryTotal(map);
    }

    @Override
    public int save(MkDistSellStatisEntity mkDistSellStatis) {
        mkDistSellStatis.setCreaterSn(ShiroUtils.getUserEntity().getUsername());
        mkDistSellStatis.setCreateTime(new Date());
        return mkDistSellStatisDao.save(mkDistSellStatis);
    }

    @Override
    public int update(MkDistSellStatisEntity mkDistSellStatis) {
        mkDistSellStatis.setModerSn(ShiroUtils.getUserEntity().getUsername());
        mkDistSellStatis.setModTime(new Date());
        return mkDistSellStatisDao.update(mkDistSellStatis);
    }

    @Override
    public int delete(Integer id) {
        return mkDistSellStatisDao.delete(id);
    }

    @Override
    public int deleteBatch(Integer[]ids) {
        return mkDistSellStatisDao.deleteBatch(ids);
    }

    @Override
    public List<MkDistSellStatisEntity> queryStatisExportList(Map<String, Object> map) {
        return mkDistSellStatisDao.queryStatisExportList(map);
    }
}
