|
|
@@ -149,22 +149,34 @@
|
|
|
from (select tolist user_id
|
|
|
from chat_msg
|
|
|
where from_id = #{userId} and type=0
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ and msgtime between #{startTime} and #{endTime}
|
|
|
+ </if>
|
|
|
union
|
|
|
select from_id user_id
|
|
|
from chat_msg
|
|
|
- where find_in_set(#{userId},tolist) and type=0)x
|
|
|
- left join chat_msg_user b on x.user_id=b.user_id
|
|
|
+ where find_in_set(#{userId},tolist) and type=0
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ and msgtime between #{startTime} and #{endTime}
|
|
|
+ </if>
|
|
|
+ )x left join chat_msg_user b on x.user_id=b.user_id
|
|
|
</select>
|
|
|
<select id="selectMyIdByRoom" resultType="com.kede.common.model.ChatMsgUser">
|
|
|
select x.roomid userId,b.name
|
|
|
from (select roomid
|
|
|
from chat_msg
|
|
|
where from_id = #{userId} and type=1
|
|
|
- union
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ and msgtime between #{startTime} and #{endTime}
|
|
|
+ </if>
|
|
|
+ union
|
|
|
select roomid
|
|
|
from chat_msg
|
|
|
- where find_in_set(#{userId},tolist) and type=1)x
|
|
|
- left join chat_msg_user b on x.roomid=b.user_id
|
|
|
+ where find_in_set(#{userId},tolist) and type=1
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ and msgtime between #{startTime} and #{endTime}
|
|
|
+ </if>
|
|
|
+ )x left join chat_msg_user b on x.roomid=b.user_id
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|