客户列表bug修复

1 parent 5bd95e70
...@@ -371,9 +371,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -371,9 +371,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
@Override @Override
public List<WeUser> getCustomersByUserId(String externalUserid) { public List<WeUser> getCustomersByUserId(String externalUserid) {
String userId=null; String userId=null;
if(Constants.USER_TYPE_WECOME.equals(SecurityUtils.getLoginUser().getUser().getUserType())){ // if(Constants.USER_TYPE_WECOME.equals(SecurityUtils.getLoginUser().getUser().getUserType())){
userId=SecurityUtils.getLoginUser().getUser().getWeUserId(); // userId=SecurityUtils.getLoginUser().getUser().getWeUserId();
} // }
return this.baseMapper.getCustomersByUserId(externalUserid,userId); return this.baseMapper.getCustomersByUserId(externalUserid,userId);
} }
......
...@@ -129,23 +129,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -129,23 +129,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="userName" column="user_name" /> <result property="userName" column="user_name" />
<result property="userId" column="user_id" /> <result property="userId" column="user_id" />
<result property="isOpenChat" column="is_open_chat" jdbcType="INTEGER" /> <result property="isOpenChat" column="is_open_chat" jdbcType="INTEGER" />
<collection property="weFlowerCustomerRels" ofType="com.linkwechat.wecom.domain.WeFlowerCustomerRel"> <!-- <collection property="weFlowerCustomerRels" ofType="com.linkwechat.wecom.domain.WeFlowerCustomerRel">-->
<result property="id" column="wfcrId" /> <!-- <result property="id" column="wfcrId" />-->
<result property="userId" column="user_id" /> <!-- <result property="userId" column="user_id" />-->
<result property="remark" column="remark" /> <!-- <result property="remark" column="remark" />-->
<result property="description" column="description" /> <!-- <result property="description" column="description" />-->
<result property="createTime" column="create_time" /> <!-- <result property="createTime" column="create_time" />-->
<result property="remarkCorpName" column="remark_corp_name" /> <!-- <result property="remarkCorpName" column="remark_corp_name" />-->
<result property="operUserid" column="oper_userid" /> <!-- <result property="operUserid" column="oper_userid" />-->
<result property="addWay" column="add_way" /> <!-- <result property="addWay" column="add_way" />-->
<result property="state" column="state" /> <!-- <result property="state" column="state" />-->
<result property="status" column="status" /> <!-- <result property="status" column="status" />-->
<result property="userName" column="user_name"/> <!-- <result property="userName" column="user_name"/>-->
<result property="department" column="department"/> <!-- <result property="department" column="department"/>-->
<collection property="weFlowerCustomerTagRels" javaType="ArrayList" <!-- <collection property="weFlowerCustomerTagRels" javaType="ArrayList"-->
column="{id = wfcrId}" select="selectWeCustomerTags"> <!-- column="{id = wfcrId}" select="selectWeCustomerTags">-->
</collection> <!-- </collection>-->
</collection> <!-- </collection>-->
</resultMap> </resultMap>
...@@ -407,44 +407,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -407,44 +407,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getCustomersByUserId" resultMap="WeCustomerResult"> <select id="getCustomersByUserId" resultMap="WeCustomerResult">
SELECT SELECT
wc.external_userid, wc.external_userid,
wc.`name`, wc.`name`,
wc.avatar, wc.avatar,
wc.type, wc.type,
wc.gender, wc.gender,
wc.unionid, wc.unionid,
wc.birthday, wc.birthday,
wc.corp_name, wc.corp_name,
wc.corp_full_name, wc.corp_full_name,
wc.position, wc.position,
wc.is_open_chat, wc.is_open_chat,
wfcr.id as wfcrId, wu.user_name,
wfcr.user_id, wt.tag_id,
wfcr.remark, wt.create_time,
wfcr.description, wt.`name` as tagName,
wfcr.create_time, (SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department
wfcr.remark_corp_name,
wfcr.oper_userid,
wfcr.add_way,
wfcr.state,
wu.user_name,
wfcrf.flower_customer_rel_id,
wt.tag_id,
wt.create_time,
wt.`name` as tagName,
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department
FROM FROM
we_customer wc we_customer wc
LEFT JOIN we_flower_customer_rel wfcr ON wc.first_user_id=wfcr.user_id LEFT JOIN we_user wu ON wu.user_id=wc.first_user_id
LEFT JOIN we_user wu ON wu.user_id=wfcr.user_id LEFT JOIN we_flower_customer_tag_rel wfcrf ON wfcrf.user_id = wc.first_user_id
LEFT JOIN we_flower_customer_tag_rel wfcrf ON wfcrf.flower_customer_rel_id = wfcr.id
LEFT JOIN we_tag wt ON wt.tag_id = wfcrf.tag_id LEFT JOIN we_tag wt ON wt.tag_id = wfcrf.tag_id
WHERE wc.external_userid=#{externalUserid} WHERE wc.external_userid=#{externalUserid}
<if test="userId != null and userId !=''"> <if test="userId != null and userId !=''">
AND wfcr.user_id=#{userId} AND wc.first_user_id=#{userId}
</if> </if>
ORDER BY wfcr.create_time ASC limit 1 ORDER BY wc.create_time ASC limit 1
</select> </select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!