package com.ruoyi.system.mapper;

import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.AppVersion;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * versionMapper接口
 * 
 * @author ruoyi
 * @date 2023-06-13
 */
public interface AppVersionMapper  extends BaseMapper<AppVersion>
{

    @Select("SELECT * FROM app_version where id=( SELECT MAX(id) FROM app_version where platform=#{platform}  and name=#{name})")
    AppVersion getVersion(@Param("platform")Long platform, @Param("name")String name);
    /**
     * 查询version
     * 
     * @param id version主键
     * @return version
     */
    public AppVersion selectAppVersionById(Long id);

    /**
     * 查询version列表
     * 
     * @param appVersion version
     * @return version集合
     */
    public List<AppVersion> selectAppVersionList(AppVersion appVersion);

    /**
     * 新增version
     * 
     * @param appVersion version
     * @return 结果
     */
    public int insertAppVersion(AppVersion appVersion);

    /**
     * 修改version
     * 
     * @param appVersion version
     * @return 结果
     */
    public int updateAppVersion(AppVersion appVersion);

    /**
     * 删除version
     * 
     * @param id version主键
     * @return 结果
     */
    public int deleteAppVersionById(Long id);

    /**
     * 批量删除version
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteAppVersionByIds(Long[] ids);
}
