Commit ed2d44d6 by 孙喜旺

会话列表sql修改

1 parent aa3baaab
...@@ -86,4 +86,7 @@ private static final long serialVersionUID=1L; ...@@ -86,4 +86,7 @@ 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("名称")
@TableField(exist = false)
private String name;
} }
...@@ -111,26 +111,25 @@ ...@@ -111,26 +111,25 @@
(select wu.user_name from we_user wu where wccm.from_id = wu.user_id), (select wu.user_name from we_user wu where wccm.from_id = wu.user_id),
(select wc.name from we_customer wc where wccm.from_id = wc.external_userid)) as name, (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), if((case when LOCATE('wm', from_id) or LOCATE('wo', from_id) then 0 else 1 end),
(select wu.user_name from we_user wu where wccm.from_id = wu.user_id), (select wu.head_image_url from we_user wu where wccm.from_id = wu.user_id),
(select wc.name from we_customer wc where wccm.from_id = wc.external_userid)) as name, (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
<where> <where>
<if test="fromId != null and fromId != ''"> <if test="fromId != null and fromId != ''">
and t.fromId = #{fromId} and wccm.fromId = #{fromId}
</if> </if>
<if test="action != null and action != ''"> <if test="action != null and action != ''">
and t.action = #{action} and wccm.action = #{action}
</if> </if>
<if test="contact != null and contact != ''"> <if test="contact != null and contact != ''">
and t.contact like concat('%', #{contact}, '%') and wccm.contact like concat('%', #{contact}, '%')
</if> </if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 --> <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
AND date_format(t.msg_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d') AND date_format(wccm.msg_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if> </if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 --> <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
AND date_format(t.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>
</where> </where>
) t ) t
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!