package cn.qinys.platform.upms.api.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.qinys.platform.entity.upms.DictionaryOption;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * DictionaryOption 的Mapper接口
 *
 * @author v-lishiquan.gx@chinatelecom.cn
 * @date 2020-07-06
 */
@Repository
@Mapper
public interface DictionaryOptionMapper extends BaseMapper<DictionaryOption> {


    /**
     * 字典选项
     *
     * @param dictId
     * @return
     */
    @Select("SELECT * FROM upms_dictionary_option WHERE dict_id = #{dictId} ORDER BY ord ASC")
    List<DictionaryOption> selectByDictId(@Param("dictId") String dictId);


    /**
     * 字典选项
     *
     * @param dictId
     * @return
     */
    @Select("DELETE FROM upms_dictionary_option WHERE dict_id = #{dictId}")
    void deleteByDictId(@Param("dictId") String dictId);

}