package com.engine.organization.mapper.extend;

import com.engine.organization.entity.extend.po.ExtendInfoPO;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

/**
 * @description:
 * @author:dxfeng
 * @createTime: 2022/05/19
 * @version: 1.0
 */
public interface ExtendInfoMapper {

    List<ExtendInfoPO> listFields(@Param("extendType") String extendType, @Param("extendGroupId") String extendGroupId, @Param("tableName") String tableName, @Param("operateType") String operateType, @Param("isEnable") String isEnable);

    int countFieldsByGroupId(@Param("tableName") String tableName, @Param("groupId") Long groupId);

    int updateExtendInfo(ExtendInfoPO extendInfo);

    int insertExtendInfo(ExtendInfoPO extendInfo);

    // 添加表结构
    void addTableColumn(@Param("tableName") String tableName, @Param("fieldName") String fieldName, @Param("dbType") String dbType);

    Long getMaxId();

    List<Object> listFieldsByTableName(@Param("tableName") String tableName, @Param("fieldName") String fieldName);

    int deleteExtendInfoByIds(@Param("ids") Collection<Long> ids);

    void deleteTableColumn(@Param("tableName") String tableName, @Param("fieldName") String fieldName);

    List<ExtendInfoPO> getExtendInfosByIds(@Param("ids") Collection<Long> ids);

    int updateExtendGroupId(@Param("groupId") Long groupId, @Param("ids") Collection<Long> ids);

    ExtendInfoPO getInfoByExtendAndLabelName(@Param("extendType") Long extendType, @Param("labelName") String labelName);


}
