package com.inkasso.factoring.dict.dao;

import com.inkasso.factoring.dict.entity.Dictionary;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DictionaryMapper {

    void add(Dictionary user);

    Dictionary get(Long id);

    Dictionary getByCode(String code);

    Dictionary getByNameAndParentCode(@Param("name") String name, @Param("parentCode") String parentCode);

    List<Dictionary> findByParentCode(String parentCode);

    List<Dictionary> findByParentCodeAndCode(@Param("parentCode") String parentCode, @Param("code") String code);

    List<Dictionary> findByParentId(Long parentId);

    List<Dictionary> findByParentIdIsNull();

    Dictionary getByCodeAndParentCode(@Param("code") String code, @Param("parentCode")  String parentCode);

    Dictionary getByName(@Param("name") String name);
}
