package io.renren.modules.levelManage.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.renren.modules.levelManage.entity.ProjectAttributesEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 
 * 
 * @author Noth
 * @email sunlightcs@gmail.com
 * @date 2022-09-17 17:20:39
 */
@Mapper
public interface ProjectAttributesDao extends BaseMapper<ProjectAttributesEntity> {

    Integer hasProject(@Param("schema") String schema);

    int createTable(@Param("cols") List<Map<String,String>> cols);

    List<Map<String,Object>> listAttribute();

    Integer countProject();

    List<String> listCols();

    List<Map<String,Object>> list(@Param("tableCols") List<String> tableCols,@Param("page") Integer page,@Param("size") Integer size);

    List<String > listBoolCols();

    Map<String,Object> selectById(@Param("id") Long id,@Param("tableCols") List<String> tableCols);

    Long saveWithCols(@Param("cols") List<Map<String,Object>> cols);

    String  selectProjectNameById(@Param("id") Long id);

    Integer updateWithCols(@Param("cols") List<Map<String,Object>> cols,@Param("id") Long id);

    List<Map<String,Object>> selectByName(@Param("tableCols") List<String> tableCols, @Param("page") Integer page,
                                          @Param("size") Integer size,@Param("name") String name);

    Integer getCountByName(@Param("name") String name);

    Integer removeProjectByIds(@Param("ids") List<Long> ids);

    Integer dropProject();

    Integer truncateProjectAttribute();

    List<Map<String,Object>> listProjectName();

    String countProjectLevel(@Param("id") Long id);

    Integer selectRootLevel(@Param("id") Long id);

    List<Map<String,Object>> listProjectByUid(@Param("uid") Long uid);

}
