package com.iamberry.wechat.service.questionnaire;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.iamberry.wechat.core.entity.questionnaire.QuestionnaireOption;
import com.iamberry.wechat.face.questionnaire.QuestionOptionService;
import com.iamberry.wechat.face.questionnaire.QuestionnaireService;
import com.iamberry.wechat.service.mapper.QuestionOptionMapper;
import com.iamberry.wechat.service.mapper.QuestionnaireMapper;
@Service
public class QuestionOptionServiceImpl implements QuestionOptionService{
	@Autowired
	private QuestionOptionMapper questionOptionMapper;
	
	/**
	 * 根据题目id查询题目所有选项
	 * @param optionQuesionId
	 * @return
	 */
	
	public List<QuestionnaireOption> selectOptionById(Integer optionQuesionId){
		return questionOptionMapper.selectOptionById(optionQuesionId);
		
	}

	/**
	 * 根据选项id修改选项内容
	 * @param optionQuesionId
	 * @return
	 */
	@Override
	public Integer updateOptionById(QuestionnaireOption questionnaireOption) {
		// TODO Auto-generated method stub
		return questionOptionMapper.updateOptionById(questionnaireOption);
	}

	/**
	 * 根据选项id排序
	 * @param QuestionnaireOption
	 * @return
	 * @author
	 */
	@Override
	public Integer optionSortingById(QuestionnaireOption questionnaireOption) {
		// TODO Auto-generated method stub
		return questionOptionMapper.optionSortingById(questionnaireOption);
	}

	@Override
	public Integer insertOption(QuestionnaireOption questionnaireOption) {
		// TODO Auto-generated method stub
		return questionOptionMapper.insertOption(questionnaireOption);
	}
}
