| 
					
				 | 
			
			
				@@ -9,7 +9,6 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<result column="platform_" property="platform" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<result column="version_" property="version" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<result column="status_" property="status" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		<result column="is_force_update_" property="isForceUpdate" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<result column="description_" property="description" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<result column="download_url_" property="downloadUrl" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<result column="operator_id_" property="operatorId" /> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -30,7 +29,12 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<!-- 全查询 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<select id="findAll" resultMap="AppVersionInfo"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		SELECT * FROM app_version_info 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		ORDER BY id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		<where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			<if test="search != null and search != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				platform_ LIKE CONCAT('%',#{search},'%') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		</where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		ORDER BY status_ DESC 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<!-- 向数据库增加一条记录 --> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -40,7 +44,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			AS ID FROM DUAL </selectKey> --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		INSERT INTO app_version_info 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		(id_,platform_,version_,status_,is_force_update_,description_,download_url_,operator_id_,update_time_,create_time_) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		VALUES(#{id},#{platform},#{version},#{status},#{isForceUpdate},#{description},#{downloadUrl},#{operatorId},#{updateTime},#{createTime}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		VALUES(#{id},#{platform},#{version},#{status},#{isForceUpdate},#{description},#{downloadUrl},#{operatorId},NOW(),NOW()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</insert> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<!-- 根据主键查询一条记录 --> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -59,9 +63,6 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			<if test="platform != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				platform_ = #{platform}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			<if test="id != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				id_ = #{id}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			<if test="updateTime != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				update_time_ = #{updateTime}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -74,12 +75,12 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			<if test="isForceUpdate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				is_force_update_ = #{isForceUpdate}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			<if test="createTime != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				create_time_ = #{createTime}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		</set> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		WHERE id_ = #{id} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</update> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	<update id="batchUpdateStatus"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		UPDATE app_version_info SET status_ = 'history',update_time_ = NOW() WHERE platform_ = #{platform} AND status_ = 'newest' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	</update> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<!-- 根据主键删除一条记录 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<delete id="delete"> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -88,12 +89,23 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<!-- 分页查询 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<select id="queryPage" resultMap="AppVersionInfo" parameterType="map"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		SELECT * FROM app_version_info ORDER BY id_ DESC 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		SELECT * FROM app_version_info 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		<where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			<if test="search != null and search != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				platform_ LIKE CONCAT('%',#{search},'%') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		</where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		ORDER BY status_ DESC 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<include refid="global.limit" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<!-- 查询当前表的总记录数 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<select id="queryCount" resultType="int"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		SELECT COUNT(*) FROM app_version_info 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		<where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			<if test="search != null and search != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				platform_ LIKE CONCAT('%',#{search},'%') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		</where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </mapper> 
			 |