Commit f7e28022 by Administrator

Merge branch 'fixbug/OneToManyToRepeat' into 'master'

bug: [none] 一对多去重复

See merge request rays/pcloud-book!891
parents 9b8d611f da0b9ac3
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<update id="updateNewsShowState" parameterType="com.pcloud.book.applet.entity.AppletNews"> <update id="updateNewsShowState" parameterType="com.pcloud.book.applet.entity.AppletNews">
update applet_news update applet_news
set show_state = #{showState,jdbcType=BOOLEAN}, set show_state = #{showState,jdbcType=BOOLEAN},
...@@ -305,6 +305,7 @@ ...@@ -305,6 +305,7 @@
AND rights_type = #{rightsType} AND rights_type = #{rightsType}
</if> </if>
) )
group by n.id
ORDER BY n.update_time DESC ORDER BY n.update_time DESC
</select> </select>
...@@ -331,6 +332,7 @@ ...@@ -331,6 +332,7 @@
<if test="rightsClassifyId!=null"> <if test="rightsClassifyId!=null">
AND news.rights_classify_id =#{rightsClassifyId} AND news.rights_classify_id =#{rightsClassifyId}
</if> </if>
group by n.id
ORDER BY ORDER BY
news.update_time DESC news.update_time DESC
LIMIT #{top} LIMIT #{top}
...@@ -424,7 +426,7 @@ ...@@ -424,7 +426,7 @@
</select> </select>
<select id="listAppletNews4Analysis" parameterType="map" resultType="com.pcloud.book.applet.dto.AppletNewsDTO"> <select id="listAppletNews4Analysis" parameterType="map" resultType="com.pcloud.book.applet.dto.AppletNewsDTO">
SELECT DISTINCT SELECT
n.id, n.id,
n.news_name newsName, n.news_name newsName,
n.source, n.source,
...@@ -481,6 +483,7 @@ ...@@ -481,6 +483,7 @@
<if test="source!=null"> <if test="source!=null">
AND n.source =#{source} AND n.source =#{source}
</if> </if>
group by n.id
ORDER BY n.update_time DESC ORDER BY n.update_time DESC
</select> </select>
...@@ -567,9 +570,11 @@ ...@@ -567,9 +570,11 @@
</if> </if>
<choose> <choose>
<when test="order>0 and order == 1"> <when test="order>0 and order == 1">
group by n.id
ORDER BY RAND() ORDER BY RAND()
</when> </when>
<otherwise> <otherwise>
group by n.id
ORDER BY n.update_time DESC ORDER BY n.update_time DESC
</otherwise> </otherwise>
</choose> </choose>
...@@ -633,7 +638,7 @@ ...@@ -633,7 +638,7 @@
</select> </select>
<select id="getPageByNewsByTempletLabel" parameterType="map" resultType="com.pcloud.book.applet.dto.AppletNewsDTO"> <select id="getPageByNewsByTempletLabel" parameterType="map" resultType="com.pcloud.book.applet.dto.AppletNewsDTO">
SELECT DISTINCT SELECT
n.id, n.id,
n.news_name newsName, n.news_name newsName,
n.source, n.source,
...@@ -681,6 +686,7 @@ ...@@ -681,6 +686,7 @@
AND rights_type = #{rightsType} AND rights_type = #{rightsType}
</if> </if>
) )
group by n.id
ORDER BY n.update_time DESC ORDER BY n.update_time DESC
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment