|
@@ -47,20 +47,24 @@
|
|
|
|
|
|
<select id="selectZhjqArticleById" parameterType="Long"
|
|
|
resultMap="ZhjqArticleResult">
|
|
|
- SELECT a.id,
|
|
|
- a.Journalism_name,
|
|
|
- a.Journalism_content,
|
|
|
- a.create_time,
|
|
|
- a.sort,
|
|
|
- a.column_id,
|
|
|
- a.release_time,
|
|
|
- a.author,
|
|
|
- b.column_id AS columnId,
|
|
|
- b.column_name as columnName
|
|
|
- FROM zhjq_article a
|
|
|
- LEFT JOIN zhjq_column b ON a.column_id = b.column_id
|
|
|
- where a.id = #{id}
|
|
|
- GROUP BY a.id
|
|
|
+ SELECT
|
|
|
+ a.id,
|
|
|
+ a.Journalism_name,
|
|
|
+ a.Journalism_content,
|
|
|
+ a.create_time,
|
|
|
+ a.sort,
|
|
|
+ a.column_id,
|
|
|
+ a.release_time,
|
|
|
+ a.author,
|
|
|
+ b.column_id AS columnId,
|
|
|
+ b.column_name AS columnName
|
|
|
+ FROM
|
|
|
+ zhjq_article a
|
|
|
+ LEFT JOIN zhjq_column b ON a.column_id = b.column_id
|
|
|
+ WHERE
|
|
|
+ a.id = #{id}
|
|
|
+ GROUP BY
|
|
|
+ a.id
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertZhjqArticle" parameterType="ZhjqArticle" useGeneratedKeys="true"
|
|
@@ -160,28 +164,23 @@
|
|
|
|
|
|
<select id="getArticleAppList" parameterType="ZhjqArticle" resultMap="ZhjqArticleResult">
|
|
|
SELECT
|
|
|
- a.id,
|
|
|
- a.Journalism_name,
|
|
|
- a.Journalism_content,
|
|
|
- a.create_time,
|
|
|
- a.sort,
|
|
|
- a.column_id,
|
|
|
- a.release_time,
|
|
|
- a.author,
|
|
|
- b.column_id AS columnId,
|
|
|
- b.column_name AS columnName
|
|
|
+ a.id,
|
|
|
+ a.Journalism_name,
|
|
|
+ a.Journalism_content,
|
|
|
+ a.create_time,
|
|
|
+ a.sort,
|
|
|
+ a.column_id,
|
|
|
+ a.release_time,
|
|
|
+ a.author,
|
|
|
+ b.column_id AS columnId,
|
|
|
+ b.column_name AS columnName
|
|
|
FROM
|
|
|
- zhjq_article a
|
|
|
+ zhjq_article a
|
|
|
LEFT JOIN
|
|
|
- zhjq_column b ON a.column_id = b.column_id
|
|
|
+ zhjq_column b ON a.column_id = b.column_id
|
|
|
WHERE
|
|
|
- a.column_id = #{columnId}
|
|
|
- <if test="sort != null and sort != ''">
|
|
|
- ORDER BY #{sort} DESC
|
|
|
- </if>
|
|
|
- <if test="sort == null or sort == ''">
|
|
|
- ORDER BY a.create_time DESC
|
|
|
- </if>
|
|
|
+ a.column_id = #{columnId}
|
|
|
+ ORDER BY sort DESC, a.create_time DESC
|
|
|
<if test="limit != null and limit != ''">
|
|
|
LIMIT #{limit}
|
|
|
</if>
|