|
@@ -31,7 +31,7 @@
|
|
</delete>
|
|
</delete>
|
|
<select id="getReplyList" resultType="com.caimei365.manager.entity.wechat.WechatReply">
|
|
<select id="getReplyList" resultType="com.caimei365.manager.entity.wechat.WechatReply">
|
|
SELECT a.cm_wxparamID AS id, a.keyword, a.title, a.responsetype AS responseType,
|
|
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
|
|
|
|
|
|
+ a.msgtype AS msgType, a.relateID AS relateId, a.wx_type AS wxType, IFNULL(a.updatee_date,a.create_date) AS updateTime
|
|
FROM wechat_reply a
|
|
FROM wechat_reply a
|
|
<where>
|
|
<where>
|
|
<if test=" wxType != null and wxType != ''">
|
|
<if test=" wxType != null and wxType != ''">
|
|
@@ -47,11 +47,11 @@
|
|
AND a.title LIKE concat('%',#{title},'%')
|
|
AND a.title LIKE concat('%',#{title},'%')
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
- ORDER BY a.update_date DESC
|
|
|
|
|
|
+ ORDER BY updateTime DESC
|
|
</select>
|
|
</select>
|
|
<select id="getWechatReply" resultType="com.caimei365.manager.entity.wechat.WechatReply">
|
|
<select id="getWechatReply" resultType="com.caimei365.manager.entity.wechat.WechatReply">
|
|
SELECT a.cm_wxparamID AS id, a.keyword, a.title, a.responsetype AS responseType,
|
|
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
|
|
|
|
|
|
+ a.msgtype AS msgType, a.relateID AS relateId, a.wx_type AS wxType, IFNULL(a.updatee_date,a.create_date) AS updateTime
|
|
FROM wechat_reply a WHERE a.cm_wxparamID = #{id}
|
|
FROM wechat_reply a WHERE a.cm_wxparamID = #{id}
|
|
</select>
|
|
</select>
|
|
<update id="updateWechatReply">
|
|
<update id="updateWechatReply">
|
|
@@ -60,10 +60,40 @@
|
|
WHERE cm_wxparamID = #{id}
|
|
WHERE cm_wxparamID = #{id}
|
|
</update>
|
|
</update>
|
|
<insert id="insertWechatReply" keyProperty="id" useGeneratedKeys="true">
|
|
<insert id="insertWechatReply" keyProperty="id" useGeneratedKeys="true">
|
|
- INSERT INTO wechat_reply(keyword, title, responsetype, msgtype, relateID, wxType, create_by, create_date)
|
|
|
|
|
|
+ INSERT INTO wechat_reply(keyword, title, responsetype, msgtype, relateID, wx_type, create_by, create_date)
|
|
VALUES (#{keyword}, #{title}, #{responseType}, #{msgType}, #{relateId}, #{wxType}, #{userId}, NOW())
|
|
VALUES (#{keyword}, #{title}, #{responseType}, #{msgType}, #{relateId}, #{wxType}, #{userId}, NOW())
|
|
</insert>
|
|
</insert>
|
|
<delete id="deleteWechatReply">
|
|
<delete id="deleteWechatReply">
|
|
DELETE FROM wechat_reply WHERE cm_wxparamID = #{id}
|
|
DELETE FROM wechat_reply WHERE cm_wxparamID = #{id}
|
|
</delete>
|
|
</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.updatee_date,a.create_date) AS updateTime
|
|
|
|
+ FROM wechat_text a
|
|
|
|
+ <where>
|
|
|
|
+ <if test=" wxType != null and wxType != ''">
|
|
|
|
+ AND a.wx_type =#{wxType}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="title != null and title != ''">
|
|
|
|
+ AND a.title LIKE concat('%',#{title},'%')
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ 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.updatee_date,a.create_date) AS updateTime
|
|
|
|
+ FROM wechat_text a WHERE a.cm_wxtextID = #{id}
|
|
|
|
+ </select>
|
|
|
|
+ <update id="updateWechatText">
|
|
|
|
+ UPDATE wechat_text SET title = #{title}, content = #{content}, wx_type = #{wxType}, update_by = #{userId}, updatee_date = NOW()
|
|
|
|
+ WHERE cm_wxtextID = #{id}
|
|
|
|
+ </update>
|
|
|
|
+ <insert id="insertWechatText" keyProperty="id" useGeneratedKeys="true">
|
|
|
|
+ INSERT INTO wechat_text(title, content, wx_type, create_by, create_date)
|
|
|
|
+ VALUES (#{title}, #{content}, #{wxType}, #{userId}, NOW())
|
|
|
|
+ </insert>
|
|
|
|
+ <delete id="deleteWechatText">
|
|
|
|
+ DELETE FROM wechat_text WHERE cm_wxtextID = #{id}
|
|
|
|
+ </delete>
|
|
</mapper>
|
|
</mapper>
|