Commit b3f62693 by danmo

会话接口修改

1 parent 7a7db8b2
...@@ -86,7 +86,11 @@ private static final long serialVersionUID=1L; ...@@ -86,7 +86,11 @@ private static final long serialVersionUID=1L;
@ApiModelProperty(value = "是否为外部聊天 0 外部 1 内部", hidden = true) @ApiModelProperty(value = "是否为外部聊天 0 外部 1 内部", hidden = true)
private Integer isExternal; private Integer isExternal;
@ApiModelProperty("名称") @ApiModelProperty("成员名称")
@TableField(exist = false) @TableField(exist = false)
private String name; private String userName;
@ApiModelProperty("客户名称")
@TableField(exist = false)
private String customerName;
} }
...@@ -107,17 +107,24 @@ ...@@ -107,17 +107,24 @@
`action`, `action`,
msg_type, msg_type,
contact, contact,
if((case when LOCATE('wm', from_id) or LOCATE('wo', from_id) then 0 else 1 end), ifnull(wc.name,wu.user_name) as name,
(select wu.user_name from we_user wu where wccm.from_id = wu.user_id), ifnull(wc.avatar,wu.head_image_url) as avatar
(select wc.name from we_customer wc where wccm.from_id = wc.external_userid)) as name,
if((case when LOCATE('wm', from_id) or LOCATE('wo', from_id) then 0 else 1 end),
(select wu.head_image_url from we_user wu where wccm.from_id = wu.user_id),
(select wc.avatar from we_customer wc where wccm.from_id = wc.external_userid)) as avatar
from we_chat_contact_msg wccm from we_chat_contact_msg wccm
left join we_user wu on wccm.from_id = wu.user_id and (case when LOCATE('wm', wccm.from_id) or LOCATE('wo', wccm.from_id) then 0 else 1 end) = 1
left join we_customer wc on wccm.from_id = wc.external_userid and (case when LOCATE('wm', wccm.from_id) or LOCATE('wo', wccm.from_id) then 0 else 1 end) = 0
<where> <where>
<if test="fromId != null and fromId != ''"> <if test="fromId != null and fromId != ''">
and wccm.fromId = #{fromId} and wccm.fromId = #{fromId}
</if> </if>
<if test="toList != null and toList != ''">
and wccm.to_list = #{toList}
</if>
<if test="msgType != null and msgType != ''">
and wccm.msg_type = #{msgType}
</if>
<if test="action != null and action != ''"> <if test="action != null and action != ''">
and wccm.action = #{action} and wccm.action = #{action}
</if> </if>
...@@ -131,12 +138,18 @@ ...@@ -131,12 +138,18 @@
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 --> <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
AND date_format(wccm.msg_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d') AND date_format(wccm.msg_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if> </if>
<if test="userName != null and userName != ''">
and wu.user_name like concat('%', #{userName}, '%')
</if>
<if test="customerName != null and customerName != ''">
and wc.name like concat('%', #{customerName}, '%')
</if>
</where> </where>
) t ) t
<where> <where>
<if test="name != null and name != ''">
and t.name like concat('%', #{name}, '%')
</if>
</where> </where>
</select> </select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!