|
@@ -3,14 +3,14 @@
|
|
|
<mapper namespace="com.caimei365.manager.dao.WeChatDao">
|
|
|
<select id="getWechatMenuList" resultType="com.caimei365.manager.entity.wechat.WechatMenu">
|
|
|
SELECT a.id, a.parentId, a.parentIds, a.`name`, a.sort, a.type, a.`key`,
|
|
|
- a.url, a.mediaId, a.appid, a.pagepath AS pagePath, a.wxType
|
|
|
+ a.url, a.mediaId, a.appid, a.pagePath AS pagePath, a.wxType
|
|
|
FROM wechat_menu a
|
|
|
WHERE a.wxType = #{wxType} AND a.parentId = #{parentId}
|
|
|
ORDER BY a.sort ASC
|
|
|
</select>
|
|
|
<select id="getWechatMenu" resultType="com.caimei365.manager.entity.wechat.WechatMenu">
|
|
|
SELECT a.id, a.parentId, a.parentIds, a.`name`, a.sort, a.type, a.`key`,
|
|
|
- a.url, a.mediaId, a.appid, a.pagepath AS pagePath, a.wxType
|
|
|
+ a.url, a.mediaId, a.appid, a.pagePath AS pagePath, a.wxType
|
|
|
FROM wechat_menu a WHERE a.id = #{id}
|
|
|
</select>
|
|
|
<select id="countChildByParentId" resultType="java.lang.Integer">
|
|
@@ -19,23 +19,23 @@
|
|
|
<update id="updateWechatMenu">
|
|
|
UPDATE wechat_menu SET parentId = #{parentId}, parentIds = #{parentIds}, name = #{name}, sort = #{sort},
|
|
|
type = #{type}, `key` = #{key}, url = #{url}, mediaId = #{mediaId}, appid = #{appid},
|
|
|
- pagepath = #{pagePath}, updateBy = #{userId}, updateDate = NOW()
|
|
|
+ pagePath = #{pagePath}, updateBy = #{userId}, updateDate = NOW()
|
|
|
WHERE id = #{id}
|
|
|
</update>
|
|
|
<insert id="insertWechatMenu" keyProperty="id" useGeneratedKeys="true">
|
|
|
- INSERT INTO wechat_menu(parentId, parentIds, `name`, sort, type, `key`, url, mediaId, appid, pagepath, wxType, createBy, createDate)
|
|
|
+ INSERT INTO wechat_menu(parentId, parentIds, `name`, sort, type, `key`, url, mediaId, appid, pagePath, wxType, createBy, createDate)
|
|
|
VALUES (#{parentId}, #{parentIds}, #{name}, #{sort}, #{type}, #{key}, #{url}, #{mediaId}, #{appid}, #{pagePath}, #{wxType}, #{userId}, NOW())
|
|
|
</insert>
|
|
|
<delete id="deleteWechatMenu">
|
|
|
DELETE FROM wechat_menu WHERE id = #{id}
|
|
|
</delete>
|
|
|
<select id="getReplyList" resultType="com.caimei365.manager.entity.wechat.WechatReply">
|
|
|
- SELECT a.cm_wxparamID AS id, a.keyword, a.title, a.responsetype AS responseType,
|
|
|
- a.msgtype AS msgType, a.relateID AS relateId, a.wx_type AS wxType, IFNULL(a.update_date,a.create_date) AS updateTime
|
|
|
+ SELECT a.id AS id, a.keyword, a.title, a.responsetype AS responseType,
|
|
|
+ a.msgtype AS msgType, a.relateId AS relateId, a.wxType AS wxType, IFNULL(a.updateDate,a.createDate) AS updateTime
|
|
|
FROM wechat_reply a
|
|
|
<where>
|
|
|
<if test=" wxType != null and wxType != ''">
|
|
|
- AND a.wx_type =#{wxType}
|
|
|
+ AND a.wxType =#{wxType}
|
|
|
</if>
|
|
|
<if test="responseType != null and responseType != ''">
|
|
|
AND a.responsetype = #{responseType}
|
|
@@ -50,29 +50,29 @@
|
|
|
ORDER BY updateTime DESC
|
|
|
</select>
|
|
|
<select id="getWechatReply" resultType="com.caimei365.manager.entity.wechat.WechatReply">
|
|
|
- SELECT a.cm_wxparamID AS id, a.keyword, a.title, a.responsetype AS responseType,
|
|
|
- a.msgtype AS msgType, a.relateID AS relateId, a.wx_type AS wxType, IFNULL(a.update_date,a.create_date) AS updateTime
|
|
|
- FROM wechat_reply a WHERE a.cm_wxparamID = #{id}
|
|
|
+ SELECT a.id AS id, a.keyword, a.title, a.responsetype AS responseType,
|
|
|
+ a.msgtype AS msgType, a.relateId AS relateId, a.wxType AS wxType, IFNULL(a.updateDate,a.createDate) AS updateTime
|
|
|
+ FROM wechat_reply a WHERE a.id = #{id}
|
|
|
</select>
|
|
|
<update id="updateWechatReply">
|
|
|
UPDATE wechat_reply SET keyword = #{keyword}, title = #{title}, responsetype = #{responseType},
|
|
|
- msgtype = #{msgType}, relateID = #{relateId}, update_by = #{userId}, update_date = NOW()
|
|
|
- WHERE cm_wxparamID = #{id}
|
|
|
+ msgtype = #{msgType}, relateId = #{relateId}, updateBy = #{userId}, updateDate = NOW()
|
|
|
+ WHERE id = #{id}
|
|
|
</update>
|
|
|
<insert id="insertWechatReply" keyProperty="id" useGeneratedKeys="true">
|
|
|
- INSERT INTO wechat_reply(keyword, title, responsetype, msgtype, relateID, wx_type, create_by, create_date)
|
|
|
+ INSERT INTO wechat_reply(keyword, title, responsetype, msgtype, relateId, wxType, createBy, createDate)
|
|
|
VALUES (#{keyword}, #{title}, #{responseType}, #{msgType}, #{relateId}, #{wxType}, #{userId}, NOW())
|
|
|
</insert>
|
|
|
<delete id="deleteWechatReply">
|
|
|
- DELETE FROM wechat_reply WHERE cm_wxparamID = #{id}
|
|
|
+ DELETE FROM wechat_reply WHERE id = #{id}
|
|
|
</delete>
|
|
|
<select id="getTextList" resultType="com.caimei365.manager.entity.wechat.WechatText">
|
|
|
- SELECT a.cm_wxtextID AS id, a.title, a.content, a.wx_type AS wxType,
|
|
|
- IFNULL(a.update_date,a.create_date) AS updateTime
|
|
|
+ SELECT a.id AS id, a.title, a.content, a.wxType AS wxType,
|
|
|
+ IFNULL(a.updateDate,a.createDate) AS updateTime
|
|
|
FROM wechat_text a
|
|
|
<where>
|
|
|
<if test=" wxType != null and wxType != ''">
|
|
|
- AND a.wx_type =#{wxType}
|
|
|
+ AND a.wxType =#{wxType}
|
|
|
</if>
|
|
|
<if test="title != null and title != ''">
|
|
|
AND a.title LIKE concat('%',#{title},'%')
|
|
@@ -81,28 +81,28 @@
|
|
|
ORDER BY updateTime DESC
|
|
|
</select>
|
|
|
<select id="getWechatText" resultType="com.caimei365.manager.entity.wechat.WechatText">
|
|
|
- SELECT a.cm_wxtextID AS id, a.title, a.content, a.wx_type AS wxType,
|
|
|
- IFNULL(a.update_date,a.create_date) AS updateTime
|
|
|
- FROM wechat_text a WHERE a.cm_wxtextID = #{id}
|
|
|
+ SELECT a.id AS id, a.title, a.content, a.wxType AS wxType,
|
|
|
+ IFNULL(a.updateDate,a.createDate) AS updateTime
|
|
|
+ FROM wechat_text a WHERE a.id = #{id}
|
|
|
</select>
|
|
|
<update id="updateWechatText">
|
|
|
- UPDATE wechat_text SET title = #{title}, content = #{content}, wx_type = #{wxType}, update_by = #{userId}, update_date = NOW()
|
|
|
- WHERE cm_wxtextID = #{id}
|
|
|
+ UPDATE wechat_text SET title = #{title}, content = #{content}, wxType = #{wxType}, updateBy = #{userId}, updateDate = NOW()
|
|
|
+ WHERE id = #{id}
|
|
|
</update>
|
|
|
<insert id="insertWechatText" keyProperty="id" useGeneratedKeys="true">
|
|
|
- INSERT INTO wechat_text(title, content, wx_type, create_by, create_date)
|
|
|
+ INSERT INTO wechat_text(title, content, wxType, createBy, createDate)
|
|
|
VALUES (#{title}, #{content}, #{wxType}, #{userId}, NOW())
|
|
|
</insert>
|
|
|
<delete id="deleteWechatText">
|
|
|
- DELETE FROM wechat_text WHERE cm_wxtextID = #{id}
|
|
|
+ DELETE FROM wechat_text WHERE id = #{id}
|
|
|
</delete>
|
|
|
<select id="getArticleList" resultType="com.caimei365.manager.entity.wechat.WechatArticle">
|
|
|
- SELECT a.cm_wxarticleID AS id, a.title, a.wx_type AS wxType,
|
|
|
- IFNULL(a.update_date,a.create_date) AS updateTime
|
|
|
+ SELECT a.articleId AS id, a.title, a.wxType AS wxType,
|
|
|
+ IFNULL(a.updateDate,a.createDate) AS updateTime
|
|
|
FROM wechat_article a
|
|
|
<where>
|
|
|
<if test=" wxType != null and wxType != ''">
|
|
|
- AND a.wx_type =#{wxType}
|
|
|
+ AND a.wxType =#{wxType}
|
|
|
</if>
|
|
|
<if test="title != null and title != ''">
|
|
|
AND a.title LIKE concat('%',#{title},'%')
|
|
@@ -111,44 +111,44 @@
|
|
|
ORDER BY updateTime DESC
|
|
|
</select>
|
|
|
<select id="getWechatArticle" resultType="com.caimei365.manager.entity.wechat.WechatArticle">
|
|
|
- SELECT a.cm_wxarticleID AS id, a.title, a.wx_type AS wxType,
|
|
|
- IFNULL(a.update_date,a.create_date) AS updateTime
|
|
|
- FROM wechat_article a WHERE a.cm_wxarticleID = #{id}
|
|
|
+ SELECT a.articleId AS id, a.title, a.wxType AS wxType,
|
|
|
+ IFNULL(a.updateDate,a.createDate) AS updateTime
|
|
|
+ FROM wechat_article a WHERE a.articleId = #{id}
|
|
|
</select>
|
|
|
<select id="getArticleDetailIds" resultType="java.lang.Integer">
|
|
|
- SELECT cm_wxarticledtlID FROM wechat_article_detail WHERE cm_wxarticleID = #{articleId}
|
|
|
+ SELECT id FROM wechat_article_detail WHERE articleId = #{articleId}
|
|
|
</select>
|
|
|
<select id="getArticleDetailList" resultType="com.caimei365.manager.entity.wechat.WechatArticleDetail">
|
|
|
- SELECT a.cm_wxarticledtlID AS id,a.cm_wxarticleID AS articleId, a.title, a.linkurl AS linkUrl, a.picurl AS pictureUrl
|
|
|
- FROM wechat_article_detail a WHERE a.cm_wxarticleID = #{articleId}
|
|
|
+ SELECT a.id AS id,a.articleId AS articleId, a.title, a.linkurl AS linkUrl, a.picurl AS picurl
|
|
|
+ FROM wechat_article_detail a WHERE a.articleId = #{articleId}
|
|
|
</select>
|
|
|
<select id="getWechatArticleDetail" resultType="com.caimei365.manager.entity.wechat.WechatArticleDetail">
|
|
|
- SELECT a.cm_wxarticledtlID AS id,a.cm_wxarticleID AS articleId, a.title, a.linkurl AS linkUrl, a.picurl AS pictureUrl
|
|
|
- FROM wechat_article_detail a WHERE a.cm_wxarticledtlID = #{id}
|
|
|
+ SELECT a.id AS id,a.articleId AS articleId, a.title, a.linkurl AS linkUrl, a.picurl AS picurl
|
|
|
+ FROM wechat_article_detail a WHERE a.id = #{id}
|
|
|
</select>
|
|
|
<update id="updateWechatArticle">
|
|
|
- UPDATE wechat_article SET title = #{title}, wx_type = #{wxType}, update_by = #{userId}, update_date = NOW()
|
|
|
- WHERE cm_wxarticleID = #{id}
|
|
|
+ UPDATE wechat_article SET title = #{title}, wxType = #{wxType}, updateBy = #{userId}, updateDate = NOW()
|
|
|
+ WHERE articleId = #{id}
|
|
|
</update>
|
|
|
<update id="updateWechatArticleDetail">
|
|
|
- UPDATE wechat_article_detail SET title = #{title}, linkurl = #{linkUrl}, picurl = #{pictureUrl}, update_by = #{userId}, update_date = NOW()
|
|
|
- WHERE cm_wxarticledtlID = #{id}
|
|
|
+ UPDATE wechat_article_detail SET title = #{title}, linkurl = #{linkUrl}, picurl = #{picurl}, updateBy = #{userId}, updateDate = NOW()
|
|
|
+ WHERE id = #{id}
|
|
|
</update>
|
|
|
<insert id="insertWechatArticle" keyProperty="id" useGeneratedKeys="true">
|
|
|
- INSERT INTO wechat_article(title, wx_type, create_by, create_date)
|
|
|
+ INSERT INTO wechat_article(title, wxType, createBy, createDate)
|
|
|
VALUES (#{title}, #{wxType}, #{userId}, NOW())
|
|
|
</insert>
|
|
|
<insert id="insertWechatArticleDetail" keyProperty="id" useGeneratedKeys="true">
|
|
|
- INSERT INTO wechat_article_detail(cm_wxarticleID, title, linkurl, picurl, create_by, create_date)
|
|
|
- VALUES (#{articleId}, #{title}, #{linkUrl},#{pictureUrl}, #{userId}, NOW())
|
|
|
+ INSERT INTO wechat_article_detail(articleId, title, linkurl, picurl, createBy, createDate)
|
|
|
+ VALUES (#{articleId}, #{title}, #{linkUrl},#{picurl}, #{userId}, NOW())
|
|
|
</insert>
|
|
|
<delete id="deleteWechatArticle">
|
|
|
- DELETE FROM wechat_article WHERE cm_wxarticleID = #{id}
|
|
|
+ DELETE FROM wechat_article WHERE articleId = #{id}
|
|
|
</delete>
|
|
|
<delete id="deleteDetailByArticleId">
|
|
|
- DELETE FROM wechat_article_detail WHERE cm_wxarticleID = #{articleId}
|
|
|
+ DELETE FROM wechat_article_detail WHERE articleId = #{articleId}
|
|
|
</delete>
|
|
|
<delete id="deleteWechatArticleDetail">
|
|
|
- DELETE FROM wechat_article_detail WHERE cm_wxarticledtlID = #{id}
|
|
|
+ DELETE FROM wechat_article_detail WHERE id = #{id}
|
|
|
</delete>
|
|
|
</mapper>
|