|
@@ -21,6 +21,17 @@
|
|
|
<result column="sendingip" jdbcType="VARCHAR" property="sendingip" />
|
|
|
<result column="receiveip" jdbcType="VARCHAR" property="receiveip" />
|
|
|
</resultMap>
|
|
|
+
|
|
|
+ <resultMap id="NoReadVo" type="com.gyee.frame.model.custom.NoReadVo">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ -->
|
|
|
+
|
|
|
+ <result column="pointtoid" jdbcType="VARCHAR" property="pointtoid" />
|
|
|
+ <result column="num" jdbcType="INTEGER" property="num" />
|
|
|
+
|
|
|
+ </resultMap>
|
|
|
<sql id="Example_Where_Clause">
|
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
@@ -450,14 +461,19 @@
|
|
|
|
|
|
<select id="selectLastInfoByUserId" resultMap="BaseResultMap">
|
|
|
select * from (
|
|
|
- select
|
|
|
- ROW_NUMBER() Over(order by chattime desc) num, id, sendingid, sendingname, chattime, pointto, pointtoid, chattypes, chatcontent,
|
|
|
- remark1, remark2, remark3, numericdate, sendingip, receiveip
|
|
|
- from chatdetail
|
|
|
- where ((sendingid = #{sendingid} and pointtoid = #{pointtoid}
|
|
|
- ) or (sendingid = #{pointtoid} and pointtoid = #{sendingid} ))
|
|
|
+ select
|
|
|
+ ROW_NUMBER() Over(order by chattime desc) num, id, sendingid, sendingname, chattime, pointto, pointtoid, chattypes, chatcontent,
|
|
|
+ remark1, remark2, remark3, numericdate, sendingip, receiveip
|
|
|
+ from chatdetail
|
|
|
+ where ((sendingid = #{sendingid} and pointtoid = #{pointtoid}
|
|
|
+ ) or (sendingid = #{pointtoid} and pointtoid = #{sendingid} ))
|
|
|
) where num = 1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectNoreadInfoByUserId" resultMap="NoReadVo">
|
|
|
|
|
|
+ select t.sendingid as sendingid,count(*) as num from chatdetail t where t.pointtoid=#{pointtoid}
|
|
|
+ and t.receiveip is null group by t.sendingid
|
|
|
|
|
|
</select>
|
|
|
</mapper>
|