<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xhkjedu.sapi.mapper.appversion.WebVersionMapper">
    <!--获取构建版-->
    <select id="getCode" resultType="java.lang.Integer">
        select ifnull(max(versioncode)+1,1) from t_web_version where versiontype=#{versiontype}
    </select>
    <!--获取版本列表-->
    <select id="listAll" resultType="java.util.Map">
        select v.versionid,v.versioncode,v.versionname,v.versiontype,v.versioncomm,v.createtime
        from t_web_version v
        <where>
            <if test="app.versiontype!=null and app.versiontype!=0">
                and v.versiontype=#{app.versiontype}
            </if>
        </where>
        order by v.versionid desc
    </select>
    <!--获取最新版本-->
    <select id="getNew" resultType="java.util.Map">
        select v.versioncode,v.versionname,v.versioncomm,v.createtime
        from t_web_version v where v.versiontype=#{versiontype}
        order by v.versioncode desc limit 1
    </select>
</mapper>
