package com.bcxin.ins.service.product.impl;

import com.bcxin.ins.dao.product.InsProductggAPIDao;
import com.bcxin.ins.service.product.InsProductggAPIService;
import com.bcxin.ins.entity.product_core.ProPrimaryExpire;
import com.bcxin.mybatisplus.service.impl.ServiceImpl;
import com.google.common.collect.Maps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

@Service
public class InsProductggAPIServiceImpl extends ServiceImpl<InsProductggAPIDao, ProPrimaryExpire> implements InsProductggAPIService {

	@Autowired
	private InsProductggAPIDao dao;

	public ProPrimaryExpire getInsProductggByInsProductID(Long insProductID){
		Map<String,Object> params = Maps.newHashMap();
		params.put("pro_primary_id",insProductID);
		List<ProPrimaryExpire> insProductggList = dao.selectByMap(params);
		if(insProductggList.size()>0){
			return insProductggList.get(0);
		}
		return null;
	}
}
