1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
<?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.geodaoyu.manager.data.mapper.MsgDialogMapper"> <resultMap id="BaseResultMap" type="com.geodaoyu.manager.data.model.MsgDialog"> <id property="msgId" column="MSGID" javaType="java.lang.String" jdbcType="VARCHAR"/> <result property="sender" column="SENDER" javaType="java.lang.String" jdbcType="VARCHAR"/> <result property="receiver" column="RECEIVER" javaType="java.lang.String" jdbcType="VARCHAR"/> <result property="sendTime" column="SENDTIME" javaType="java.lang.String" jdbcType="VARCHAR"/> <result property="content" column="CONTENT" javaType="java.lang.String" jdbcType="VARCHAR"/> <result property="state" column="STATE" javaType="java.lang.String" jdbcType="VARCHAR"/> <result property="readTime" column="READTIME" javaType="java.lang.String" jdbcType="VARCHAR"/> </resultMap>
<insert id="insertMsg" parameterType="com.geodaoyu.manager.data.model.MsgDialog"> INSERT INTO w_message ( MSGID,SENDER,RECEIVER,SENDTIME,CONTENT,STATE,READTIME ) VALUES ( #{msgId,jdbcType=VARCHAR}, #{sender,jdbcType=VARCHAR}, #{receiver,jdbcType=VARCHAR}, #{sendTime,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{state,jdbcType=VARCHAR}, #{readTime,jdbcType=VARCHAR} ) </insert>
<insert id="insertMsgs" parameterType="java.util.List" > INSERT ALL <foreach collection="list" item="item" separator=" "> INTO w_message ( MSGID,SENDER,RECEIVER,SENDTIME,CONTENT,STATE,READTIME ) VALUES ( #{item.msgId,jdbcType=VARCHAR}, #{item.sender,jdbcType=VARCHAR}, #{item.receiver,jdbcType=VARCHAR}, #{item.sendTime,jdbcType=VARCHAR}, #{item.content,jdbcType=VARCHAR}, #{item.state,jdbcType=VARCHAR}, #{item.readTime,jdbcType=VARCHAR}, ) </foreach> select * from dual </insert>
<delete id="deleteMsg" parameterType="com.geodaoyu.manager.data.model.MsgDialog"> DELETE FROM w_message WHERE MSGID=#{msgId,jdbcType=VARCHAR} </delete>
<update id="updateMsg" parameterType="com.geodaoyu.manager.data.model.MsgDialog"> UPDATE w_message SET STATE=#{state,jdbcType=VARCHAR}, READTIME=#{readTime,jdbcType=VARCHAR} WHERE MSGID=#{msgId,jdbcType=VARCHAR} </update>
<update id="updateMsgs" parameterType="com.geodaoyu.manager.data.model.MsgDialog"> UPDATE w_message SET STATE='已读', READTIME=#{readTime,jdbcType=VARCHAR} WHERE RECEIVER=#{receiver,jdbcType=VARCHAR} AND STATE='未读' </update>
<select id="selectMsgsByFilter" parameterType="com.geodaoyu.manager.filter.MsgDialogFilter" resultMap="BaseResultMap"> SELECT * FROM ( SELECT r.*,ROWNUM oracleRN FROM ( SELECT t.* FROM w_message t <trim prefix="WHERE" prefixOverrides="AND"> |