package com.ssj.service.weixin.zuoyb.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.dubbo.config.annotation.Service;
import com.ssj.bean.weixin.zyb.domain.ZuoybScoringContentDetails;
import com.ssj.dao.weixin.zuoyb.dao.ZuoybScoringContentDetailsDao;
import com.ssj.framework.core.common.service.BaseServiceImpl;
import com.ssj.framework.core.persistence.DynamicSpecifications;
import com.ssj.framework.core.persistence.SearchFilter;
import com.ssj.service.weixin.zuoyb.service.ZuoybScoringContentDetailsService;


/** 
 * @author  ZhangCaibao 
 * @version 2017年7月4日 上午11:25:10 
 * 类说明 
 */
@Service(version="1.0")
@Transactional
public class ZuoybScoringContentDetailsServiceImpl extends BaseServiceImpl<ZuoybScoringContentDetails, String> implements ZuoybScoringContentDetailsService{
    @Autowired
	private ZuoybScoringContentDetailsDao  zuoybScoringContentDetailsDao;
	@Override
	public PagingAndSortingRepository<ZuoybScoringContentDetails, String> getDao() {
		return zuoybScoringContentDetailsDao;
	}
	@Override
	public Page<ZuoybScoringContentDetails> findByPage(
			Map<String, Object> params, Pageable sp) {
		Map<String, SearchFilter> filters = SearchFilter.parse(params);
		Specification<ZuoybScoringContentDetails> specification = DynamicSpecifications.bySearchFilter(filters.values(), ZuoybScoringContentDetails.class);    
		return  zuoybScoringContentDetailsDao.findAll(specification, sp);
	}
	@Override
	public void deleteByScoringContentId(String scoringContentId) {
		zuoybScoringContentDetailsDao.deleteByScoringContentId(scoringContentId);
		
	}

}
