ReplyMessage.xml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <!-- namespace必须指向DAO接口 -->
  5. <mapper namespace="com.jpsoft.weixin.dao.ReplyMessageDAO">
  6. <resultMap id="ReplyMessageMap" type="com.jpsoft.picc.modules.base.entity.ReplyMessage">
  7. <id property="id" column="id_"/>
  8. <result property="wechatId" column="wechat_id"/>
  9. <result property="event" column="event_"/>
  10. <result property="message" column="message_"/>
  11. <result property="createTime" column="create_time"/>
  12. <result property="updateTime" column="update_time"/>
  13. <result property="callbackUrl" column="callback_url"/>
  14. </resultMap>
  15. <insert id="insert" parameterType="com.jpsoft.picc.modules.base.entity.ReplyMessage">
  16. <!--
  17. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  18. select sys_guid() from dual
  19. </selectKey>
  20. -->
  21. <![CDATA[
  22. insert into wechat_reply_message
  23. (id_,wechat_id,event_,message_,create_time,update_time,callback_url)
  24. values
  25. (
  26. #{id,jdbcType=VARCHAR}
  27. ,#{wechatId,jdbcType=VARCHAR}
  28. ,#{event,jdbcType=VARCHAR}
  29. ,#{message,jdbcType=VARCHAR}
  30. ,#{createTime,jdbcType= TIMESTAMP }
  31. ,#{updateTime,jdbcType= TIMESTAMP }
  32. ,#{callbackUrl,jdbcType=VARCHAR}
  33. )
  34. ]]>
  35. </insert>
  36. <delete id="delete" parameterType="string">
  37. delete from wechat_reply_message where id_=#{id,jdbcType=VARCHAR}
  38. </delete>
  39. <update id="update" parameterType="com.jpsoft.picc.modules.base.entity.ReplyMessage">
  40. update wechat_reply_message
  41. <set>
  42. <if test="wechatId!=null">
  43. wechat_id=#{wechatId,jdbcType=VARCHAR},
  44. </if>
  45. <if test="event!=null">
  46. event_=#{event,jdbcType=VARCHAR},
  47. </if>
  48. <if test="message!=null">
  49. message_=#{message,jdbcType=VARCHAR},
  50. </if>
  51. <if test="createTime!=null">
  52. create_time=#{createTime,jdbcType= TIMESTAMP },
  53. </if>
  54. <if test="updateTime!=null">
  55. update_time=#{updateTime,jdbcType= TIMESTAMP },
  56. </if>
  57. <if test="callbackUrl!=null">
  58. callback_url=#{callbackUrl,jdbcType=VARCHAR},
  59. </if>
  60. </set>
  61. where id_=#{id}
  62. </update>
  63. <select id="get" parameterType="string" resultMap="ReplyMessageMap">
  64. select * from wechat_reply_message where id_=#{0}
  65. </select>
  66. <select id="exist" parameterType="string" resultType="int">
  67. select count(*) from wechat_reply_message where id_=#{0}
  68. </select>
  69. <select id="list" resultMap="ReplyMessageMap">
  70. select * from wechat_reply_message
  71. </select>
  72. <select id="search" parameterType="hashmap" resultMap="ReplyMessageMap">
  73. <![CDATA[
  74. select * from wechat_reply_message
  75. ]]>
  76. <where>
  77. <if test="searchParams.id != null">
  78. and ID_ like #{searchParams.id}
  79. </if>
  80. </where>
  81. <foreach item="sort" collection="sortList" open="order by" separator=",">
  82. ${sort.name} ${sort.order}
  83. </foreach>
  84. </select>
  85. <select id="findByEvent" resultMap="ReplyMessageMap">
  86. select * from wechat_reply_message where wechat_id=#{wechatId} and event_=#{event} limit 1
  87. </select>
  88. </mapper>