|
@@ -2,8 +2,8 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.caimei.mapper.cmMapper.ArticleMapper">
|
|
|
<insert id="insertArticle">
|
|
|
- insert into cm_brand_article(authUserId, title, image, content, auditStatus, status, createTime, auditBy, auditTime, checkFlag, sort)
|
|
|
- values (#{authUserId}, #{title}, #{image}, #{content}, #{auditStatus}, #{status}, #{createTime}, #{auditBy}, #{auditTime}, #{checkFlag}, #{sort})
|
|
|
+ insert into cm_brand_article(authUserId, title, image, content, auditStatus, status, createTime, auditBy, auditTime)
|
|
|
+ values (#{authUserId}, #{title}, #{image}, #{content}, #{auditStatus}, #{status}, #{createTime}, #{auditBy}, #{auditTime})
|
|
|
</insert>
|
|
|
<update id="updateArticleByArticleId">
|
|
|
update cm_brand_article
|
|
@@ -11,8 +11,7 @@
|
|
|
image = #{image},
|
|
|
content = #{content},
|
|
|
status = #{status},
|
|
|
- auditStatus = #{auditStatus},
|
|
|
- sort = #{sort}
|
|
|
+ auditStatus = #{auditStatus}
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
<update id="updateArticleStatusByArticleId">
|
|
@@ -45,7 +44,7 @@
|
|
|
<select id="getArticleList" resultType="com.caimei.model.vo.ArticleListVo">
|
|
|
select a.id as articleId,a.title as articleTitle,a.image as articleImage,
|
|
|
a.auditStatus,a.invalidReason,a.status,a.createTime,
|
|
|
- au.name as auditBy,a.auditTime,a.sort, a.checkFlag
|
|
|
+ au.name as auditBy,a.auditTime
|
|
|
from cm_brand_article a
|
|
|
left join cm_brand_auth_user au on a.auditBy = au.authUserId
|
|
|
where a.authUserId = #{authUserId}
|
|
@@ -63,12 +62,12 @@
|
|
|
order by a.auditStatus desc, a.createTime desc
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- order by -a.sort desc, a.createTime desc
|
|
|
+ order by a.createTime desc
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</select>
|
|
|
<select id="getArticleForm" resultType="com.caimei.model.vo.ArticleFormVo">
|
|
|
- select id as articleId, title as articleTitle, image as articleImage, content as articleContent, createTime, auditStatus, sort
|
|
|
+ select id as articleId, title as articleTitle, image as articleImage, content as articleContent, createTime, auditStatus
|
|
|
from cm_brand_article
|
|
|
where id = #{articleId}
|
|
|
</select>
|
|
@@ -81,6 +80,6 @@
|
|
|
<if test="articleTitle != null and articleTitle != ''">
|
|
|
and title like concat('%',#{articleTitle},'%')
|
|
|
</if>
|
|
|
- order by -a.sort desc, a.createTime desc
|
|
|
+ order by a.createTime desc
|
|
|
</select>
|
|
|
</mapper>
|