package com.ho.user.mapper;

import com.ho.user.entity.SysDict;
import com.ho.user.api.entity.SysSubDict;
import com.ho.user.vo.req.DictPageReqVO;
import com.ho.user.vo.resp.DictRespVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysDictMapper {

    SysDict selectByPrimaryKey(Integer id);

    int deleteByPrimaryKey(@Param("id") Integer id);

    int insertDict(@Param("record") SysDict record);

    int insertSubDict(@Param("record")SysSubDict record);

    int updateDict(@Param("record")SysDict dict);

    int updateByPrimaryKey(@Param("record")SysSubDict record);

    SysDict selectByType( String type);

    List<DictRespVo> selectAll(@Param("record") DictPageReqVO vo);

    List<SysDict> selectTypeAll();

    int deleteByType(@Param("type")String type);

    SysSubDict selectSubDictByValue(String value);

    SysDict selectById(Integer id);

    SysSubDict selectBySubId(Integer id);


    List<SysSubDict> selectSubDictByType(@Param("type") String type,@Param("lang") String lang);

    List<SysSubDict> selectSubDictByTypeList(@Param("typeList") List<String> typeList);

    int updateSubDict(@Param("record")SysSubDict subDict);

    SysSubDict selectSubDictByTV(@Param("type")String type, @Param("value")String value);

    SysDict selectDictByTypeAndName(@Param("record")SysDict queryDict);

    List<SysDict> selectDictListByType(String type);

    List<SysSubDict> selectSubDictByKey(@Param("record") SysSubDict sysSubDict);

    SysSubDict selectSubDictBySort(@Param("type") String type, Long sort);

    List<SysSubDict> getDictByIds(List<Integer> ids);
}