123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?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">
- <!-- namespace必须指向DAO接口 -->
- <mapper namespace="com.jpsoft.weixin.dao.ReplyMessageDAO">
- <resultMap id="ReplyMessageMap" type="com.jpsoft.weixin.entity.ReplyMessage">
- <id property="id" column="id_" />
- <result property="event" column="event_" />
- <result property="message" column="message_" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- </resultMap>
- <insert id="insert" parameterType="com.jpsoft.weixin.entity.ReplyMessage">
- <!--
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
- select sys_guid() from dual
- </selectKey>
- -->
- <![CDATA[
- insert into wechat_reply_message
- (id_,event_,message_,create_time,update_time)
- values
- (
- #{id,jdbcType=VARCHAR}
- ,#{event,jdbcType=VARCHAR}
- ,#{message,jdbcType=VARCHAR}
- ,#{createTime,jdbcType= TIMESTAMP }
- ,#{updateTime,jdbcType= TIMESTAMP }
- )
- ]]>
- </insert>
- <delete id="delete" parameterType="string">
- delete from wechat_reply_message where id_=#{id,jdbcType=VARCHAR}
- </delete>
- <update id="update" parameterType="com.jpsoft.weixin.entity.ReplyMessage">
- update wechat_reply_message
- <set>
- <if test="event!=null">
- event_=#{event,jdbcType=VARCHAR},
- </if>
- <if test="message!=null">
- message_=#{message,jdbcType=VARCHAR},
- </if>
- <if test="createTime!=null">
- create_time=#{createTime,jdbcType= TIMESTAMP },
- </if>
- <if test="updateTime!=null">
- update_time=#{updateTime,jdbcType= TIMESTAMP },
- </if>
- </set>
- where id_=#{id}
- </update>
- <select id="get" parameterType="string" resultMap="ReplyMessageMap">
- select * from wechat_reply_message where id_=#{0}
- </select>
- <select id="exist" parameterType="string" resultType="int">
- select count(*) from wechat_reply_message where id_=#{0}
- </select>
- <select id="list" resultMap="ReplyMessageMap">
- select * from wechat_reply_message
- </select>
- <select id="search" parameterType="hashmap" resultMap="ReplyMessageMap">
- <![CDATA[
- select * from wechat_reply_message
- ]]>
- <where>
- <if test="searchParams.id != null">
- and ID_ like #{searchParams.id}
- </if>
- </where>
- <foreach item="sort" collection="sortList" open="order by" separator=",">
- ${sort.name} ${sort.order}
- </foreach>
- </select>
- <select id="findByEvent" resultMap="ReplyMessageMap">
- select * from wechat_reply_message where id_=#{id} and event_=#{event} limit 1
- </select>
- </mapper>
|