package com.rf.psychological.scale.service.impl;


import com.rf.psychological.dao.model.CategorySubjectEntity;
import com.rf.psychological.dao.repository.CategorySubjectRepository;
import com.rf.psychological.scale.service.CategorySubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zsy
 * @description:量表类别关联信息管理
 * @date 2021/6/17 15:55
 */
@Service
public class CategorySubjectServiceImpl implements CategorySubjectService {

    @Autowired
    private CategorySubjectRepository categorySubjectRepository;


    /**
     * 保存
     * @param categorySubjectEntity
     */
    @Override
    public void save(CategorySubjectEntity categorySubjectEntity) {
        this.categorySubjectRepository.save(categorySubjectEntity);
    }

    @Override
    public List<CategorySubjectEntity> findByFlag(String flag) {
        return this.categorySubjectRepository.findByFlag(flag);
    }

    @Override
    public void deleteCategorySubjectByFlag(String flag) {
        this.categorySubjectRepository.deleteCategorySubjectByFlag(flag);
    }

}
