package com.jeesite.modules.admin.wenjuan.service;

import java.util.List;

import com.jeesite.modules.admin.wenjuan.dao.AdminQuestionOptionDao;
import com.jeesite.modules.admin.wenjuan.entity.AdminQuestionOption;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;

/**
 * 问卷调查选项表Service
 *
 * @author wlc
 * @version 2022-06-20
 */
@Service
@Transactional(readOnly = true)
public class AdminQuestionOptionService extends CrudService<AdminQuestionOptionDao, AdminQuestionOption> {

    @Autowired
    private AdminQuestionOptionDao adminQuestionOptionDao;

    /**
     * 获取单条数据
     *
     * @param adminQuestionOption
     * @return
     */
    @Override
    public AdminQuestionOption get(AdminQuestionOption adminQuestionOption) {
        return super.get(adminQuestionOption);
    }

    /**
     * 查询分页数据
     *
     * @param adminQuestionOption      查询条件
     * @param adminQuestionOption.page 分页对象
     * @return
     */
    @Override
    public Page<AdminQuestionOption> findPage(AdminQuestionOption adminQuestionOption) {
        return super.findPage(adminQuestionOption);
    }

    /**
     * 查询列表数据
     *
     * @param adminQuestionOption
     * @return
     */
    @Override
    public List<AdminQuestionOption> findList(AdminQuestionOption adminQuestionOption) {
        return super.findList(adminQuestionOption);
    }

    /**
     * 保存数据（插入或更新）
     *
     * @param adminQuestionOption
     */
    @Override
    @Transactional(readOnly = false)
    public void save(AdminQuestionOption adminQuestionOption) {
        super.save(adminQuestionOption);
    }

    /**
     * 更新状态
     *
     * @param adminQuestionOption
     */
    @Override
    @Transactional(readOnly = false)
    public void updateStatus(AdminQuestionOption adminQuestionOption) {
        super.updateStatus(adminQuestionOption);
    }

    /**
     * 删除数据
     *
     * @param adminQuestionOption
     */
    @Override
    @Transactional(readOnly = false)
    public void delete(AdminQuestionOption adminQuestionOption) {
        super.delete(adminQuestionOption);
    }

    /**
     * 根据问卷调查项ID --> 查询 问卷调查选项表
     *
     * @param questionitemId
     * @return
     */
    public List<AdminQuestionOption> selectQOptionList(String questionitemId) {
        return adminQuestionOptionDao.selectQOptionList(questionitemId);
    }
}