package ${currentPackage};

#foreach($pkg in ${customProviderEntityFilePackages})
import ${pkg}.*;
#end

import java.util.List;

/**
 * $!{table.comment} 对外服务类
 *
 * @author ${author}
 * @version ${version}
 * @since ${date}
 */
public interface ${type}Api {

    /**
     * ${apiComment.create}
     *
     * @param dto dto
     * @return id
     */
    Long create${type}(${type}CreateDTO dto);

    /**
     * ${apiComment.updateById}
     *
     * @param dto dto
     * @return effect
     */
    Integer update${type}ById(${type}UpdateDTO dto);

    /**
     * ${apiComment.updateAll}
     *
     * @param query  query
     * @param update update
     * @return effect
     */
    Integer update${type}(${type}QueryDTO query, ${type}UpdateDTO update);

    /**
     * ${apiComment.getById}
     *
     * @param id id
     * @return row
     */
    ${type}DTO get${type}ById(Long id);

    /**
     * ${apiComment.getByIdList}
     *
     * @param idList idList
     * @return rows
     */
    List<${type}DTO> get${type}ByIdList(List<Long> idList);

    /**
     * ${apiComment.queryList}
     *
     * @param dto dto
     * @return rows
     */
    List<${type}DTO> get${type}List(${type}QueryDTO dto);

    #if($meta.enableCache)
    /**
     * ${apiComment.queryListByCache}
     *
     * @return rows
     */
    List<${type}DTO> get${type}ListByCache();

    #end
    /**
     * ${apiComment.queryCount}
     *
     * @param dto dto
     * @return count
     */
    Long get${type}Count(${type}QueryDTO dto);

    /**
     * ${apiComment.deleteById}
     *
     * @param id id
     * @return effect
     */
    Integer delete${type}ById(Long id);

    /**
     * ${apiComment.batchDelete}
     *
     * @param idList idList
     * @return effect
     */
    Integer delete${type}ByIdList(List<Long> idList);

    /**
     * ${apiComment.deleteAll}
     *
     * @param dto dto
     * @return effect
     */
    Integer delete${type}(${type}QueryDTO dto);

}
