package com.yunzhi.marketing.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunzhi.marketing.common.CommConstant;
import com.yunzhi.marketing.entity.TaShareContent;
import com.yunzhi.marketing.mapper.TaShareContentMapper;
import com.yunzhi.marketing.service.TaShareContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *   服务实现类
 * </p>
 *
 * @author jobob
 * @since 2019-09-21
 */
@Service
public class ShareContentServiceImpl extends ServiceImpl<TaShareContentMapper, TaShareContent> implements TaShareContentService {
    @Autowired
    TaShareContentMapper taShareContentMapper;

    @Override
    public List<TaShareContent> getPostersForTarget(String targetId, String targetType){
        QueryWrapper<TaShareContent>queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("target_id",targetId);
        queryWrapper.eq("share_content_type",targetType);
        queryWrapper.eq("status", CommConstant.STATUS_NORMAL);
        List<TaShareContent> data = taShareContentMapper.selectList(queryWrapper);
        return data;
    }

}
