123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <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
- 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
- FROM wechat_menu a WHERE a.id = #{id}
- </select>
- <select id="countChildByParentId" resultType="java.lang.Integer">
- SELECT IFNULL(COUNT(*),0) FROM wechat_menu WHERE parentId = #{parentId}
- </select>
- <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()
- 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)
- 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
- FROM wechat_reply a
- <where>
- <if test=" wxType != null and wxType != ''">
- AND a.wx_type =#{wxType}
- </if>
- <if test="responseType != null and responseType != ''">
- AND a.responsetype = #{responseType}
- </if>
- <if test="msgType != null and msgType != ''">
- AND a.msgtype = #{msgType}
- </if>
- <if test="title != null and title != ''">
- AND a.title LIKE concat('%',#{title},'%')
- </if>
- </where>
- 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>
- <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}
- </update>
- <insert id="insertWechatReply" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO wechat_reply(keyword, title, responsetype, msgtype, relateID, wx_type, create_by, create_date)
- VALUES (#{keyword}, #{title}, #{responseType}, #{msgType}, #{relateId}, #{wxType}, #{userId}, NOW())
- </insert>
- <delete id="deleteWechatReply">
- DELETE FROM wechat_reply WHERE cm_wxparamID = #{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
- 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.update_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}, update_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>
- <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
- FROM wechat_article 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="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>
- <select id="getArticleDetailIds" resultType="java.lang.Integer">
- SELECT cm_wxarticledtlID FROM wechat_article_detail WHERE cm_wxarticleID = #{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>
- <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>
- <update id="updateWechatArticle">
- UPDATE wechat_article SET title = #{title}, wx_type = #{wxType}, update_by = #{userId}, update_date = NOW()
- WHERE cm_wxarticleID = #{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>
- <insert id="insertWechatArticle" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO wechat_article(title, wx_type, create_by, create_date)
- 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>
- <delete id="deleteWechatArticle">
- DELETE FROM wechat_article WHERE cm_wxarticleID = #{id}
- </delete>
- <delete id="deleteDetailByArticleId">
- DELETE FROM wechat_article_detail WHERE cm_wxarticleID = #{articleId}
- </delete>
- <delete id="deleteWechatArticleDetail">
- DELETE FROM wechat_article_detail WHERE cm_wxarticledtlID = #{id}
- </delete>
- </mapper>
|