|
@@ -91,11 +91,23 @@
|
|
<select id="queryPage" resultMap="AppVersionInfo" parameterType="map">
|
|
<select id="queryPage" resultMap="AppVersionInfo" parameterType="map">
|
|
SELECT * FROM app_version_info
|
|
SELECT * FROM app_version_info
|
|
<where>
|
|
<where>
|
|
- <if test="search != null and search != ''">
|
|
|
|
- platform_ LIKE CONCAT('%',#{search},'%')
|
|
|
|
|
|
+ <if test="keyword != null and keyword.trim() != ''">
|
|
|
|
+ and (id_ like concat('%',#{keyword},'%') or
|
|
|
|
+ version_ like concat('%',#{keyword},'%') or
|
|
|
|
+ description_ like concat('%',#{keyword},'%')
|
|
|
|
+ )
|
|
|
|
+ </if>
|
|
|
|
+ <if test="version != null and version != ''">
|
|
|
|
+ and version_ = #{version}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="platform != null and platform != ''">
|
|
|
|
+ and platform_ = #{platform}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="status != null and status != ''">
|
|
|
|
+ and status_ = #{status}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
- ORDER BY status_ DESC
|
|
|
|
|
|
+ order by version_ desc ,status_='newest' desc , id_ desc
|
|
<include refid="global.limit" />
|
|
<include refid="global.limit" />
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -103,9 +115,30 @@
|
|
<select id="queryCount" resultType="int">
|
|
<select id="queryCount" resultType="int">
|
|
SELECT COUNT(*) FROM app_version_info
|
|
SELECT COUNT(*) FROM app_version_info
|
|
<where>
|
|
<where>
|
|
- <if test="search != null and search != ''">
|
|
|
|
- platform_ LIKE CONCAT('%',#{search},'%')
|
|
|
|
|
|
+ <if test="keyword != null and keyword.trim() != ''">
|
|
|
|
+ and (id_ like concat('%',#{keyword},'%') or
|
|
|
|
+ version_ like concat('%',#{keyword},'%') or
|
|
|
|
+ description_ like concat('%',#{keyword},'%')
|
|
|
|
+ )
|
|
|
|
+ </if>
|
|
|
|
+ <if test="version != null and version != ''">
|
|
|
|
+ and version_ = #{version}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="platform != null and platform != ''">
|
|
|
|
+ and platform_ = #{platform}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="status != null and status != ''">
|
|
|
|
+ and status_ = #{status}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <select id="queryLatestByPlatform" resultMap="AppVersionInfo">
|
|
|
|
+ SELECT *
|
|
|
|
+ FROM app_version_info
|
|
|
|
+ WHERE platform_ = #{platform}
|
|
|
|
+ and find_in_set(status_, #{status})
|
|
|
|
+ order by version_ desc, status_='newest' desc, id_ desc
|
|
|
|
+ limit 1
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|