package com.engine.organization.mapper.extend;

import com.engine.organization.entity.extend.param.ExtendInfoParams;
import org.apache.ibatis.annotations.Param;

import java.util.Map;

/**
 * @description:
 * @author:dxfeng
 * @createTime: 2022/05/20
 * @version: 1.0
 */
public interface ExtMapper {

    /**
     * 根据主表id,查询主表拓展表数据
     *
     * @param params
     * @return
     */
    Map<String, Object> listExt(ExtendInfoParams params);

    /**
     * 判断当前数据是否存在
     *
     * @param params
     * @return
     */
    int countExtById(ExtendInfoParams params);

    /**
     * 插入主表
     *
     * @param params
     * @return
     */
    int insertTable(ExtendInfoParams params);

    /**
     * 插入拓展表
     *
     * @param params
     * @return
     */
    int insertExtTable(ExtendInfoParams params);

    /**
     * 更新主表拓展表
     *
     * @param params
     * @return
     */
    int updateTable(ExtendInfoParams params);

    int deleteByID(@Param("tableName") String tableName, @Param("id") long id);
}
