package com.huiju.estateagents.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huiju.estateagents.base.ResponseBean;
import com.huiju.estateagents.entity.TaShareCount;
import com.huiju.estateagents.mapper.TaShareCountMapper;
import com.huiju.estateagents.service.ITaShareCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *   服务实现类
 * </p>
 *
 * @author jobob
 * @since 2020-02-03
 */
@Service
public class TaShareCountServiceImpl extends ServiceImpl<TaShareCountMapper, TaShareCount> implements ITaShareCountService {

    @Autowired
    private TaShareCountMapper taShareCountMapper;

    @Override
    public ResponseBean selectList(Integer pageNum, Integer pageSize, Integer orgId, String personId, String shareType, String shareTitle) {
        Page page = new Page(pageNum,pageSize);
        // 分页查询
        List<TaShareCount> list = taShareCountMapper.selectListByParams(page, orgId, personId, shareType, shareTitle);
        page.setRecords(list);
        return ResponseBean.success(page);
    }

    @Override
    public ResponseBean selectClickList(Integer pageNum, Integer pageSize, Integer orgId, String personId, String shareType, String shareTitle) {
        Page page = new Page(pageNum,pageSize);
        // 分页查询
        List<TaShareCount> list = taShareCountMapper.selectClickListByParams(page, orgId, personId, shareType, shareTitle);
        page.setRecords(list);
        return ResponseBean.success(page);
    }
}
