|
@@ -22,18 +22,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
select id, way_id,information_id, user_id, company_user_id, type, msg, external_user_id, company_id, create_time,corp_id from qw_contact_way_logs
|
|
select id, way_id,information_id, user_id, company_user_id, type, msg, external_user_id, company_id, create_time,corp_id from qw_contact_way_logs
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
- <select id="selectQwContactWayLogsList" parameterType="QwContactWayLogs" resultMap="QwContactWayLogsResult">
|
|
|
|
- <include refid="selectQwContactWayLogsVo"/>
|
|
|
|
|
|
+ <select id="selectQwContactWayLogsList" parameterType="QwContactWayLogs" resultType="QwContactWayLogs">
|
|
|
|
+ select a.*,b.name,b.avatar,b.gender,b.is_repeat,c.nick_name from qw_contact_way_logs a
|
|
|
|
+ inner join qw_external_contact b on a.external_user_id = b.id
|
|
|
|
+ inner join company_user c on b.company_user_id = c.user_id
|
|
<where>
|
|
<where>
|
|
- <if test="wayId != null "> and way_id = #{wayId}</if>
|
|
|
|
- <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
|
- <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
|
|
|
|
- <if test="type != null "> and type = #{type}</if>
|
|
|
|
- <if test="msg != null and msg != ''"> and msg = #{msg}</if>
|
|
|
|
- <if test="corpId != null "> and corp_id = #{corpId}</if>
|
|
|
|
- <if test="externalUserId != null "> and external_user_id = #{externalUserId}</if>
|
|
|
|
- <if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
|
- <if test="createTime != null "> and create_time = #{createTime}</if>
|
|
|
|
|
|
+ <if test="wayId != null "> and a.way_id = #{wayId}</if>
|
|
|
|
+ <if test="userId != null "> and a.user_id = #{userId}</if>
|
|
|
|
+ <if test="companyUserId != null "> and b.company_user_id = #{companyUserId}</if>
|
|
|
|
+ <if test="type != null "> and a.type = #{type}</if>
|
|
|
|
+ <if test="msg != null and msg != ''"> and a.msg = #{msg}</if>
|
|
|
|
+ <if test="corpId != null "> and a.corp_id = #{corpId}</if>
|
|
|
|
+ <if test="externalUserId != null "> and a.external_user_id = #{externalUserId}</if>
|
|
|
|
+ <if test="companyId != null "> and a.company_id = #{companyId}</if>
|
|
|
|
+ <if test="beginTime != null"><!-- 开始时间检索 -->
|
|
|
|
+ AND date_format(a.create_time,'%y%m%d') >= date_format(#{beginTime},'%y%m%d')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endTime != null"><!-- 结束时间检索 -->
|
|
|
|
+ AND date_format(a.create_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
|
|
|
|
+ </if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|