| <?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.zy.asrs.mapper.AppVersionMapper"> | 
|   | 
|     <!-- 通用查询映射结果 --> | 
|     <resultMap id="BaseResultMap" type="com.zy.asrs.entity.AppVersion"> | 
|         <id column="id" property="id" /> | 
|         <result column="version" property="version" /> | 
|         <result column="path" property="path" /> | 
|         <result column="latest" property="latest" /> | 
|         <result column="type" property="type" /> | 
|   | 
|     </resultMap> | 
|   | 
|     <select id="getLatestApp" resultMap="BaseResultMap"> | 
|         select top 1 * from asr_app_version | 
|         where type = #{type} and latest = 1 | 
|     </select> | 
|   | 
|     <update id="updateLatest"> | 
|         update asr_app_version | 
|         set latest = #{latest} | 
|         where 1 = 1 | 
|         <if test="type != null || type != ''"> | 
|             and type = #{type} | 
|         </if> | 
|     </update> | 
|   | 
| </mapper> |