|
|
@@ -285,6 +285,68 @@ public interface QwExternalContactMapper extends BaseMapper<QwExternalContact> {
|
|
|
"</script>"})
|
|
|
List<QwExternalContactVO> selectQwExternalContactListVO(QwExternalContactParam qwExternalContact);
|
|
|
|
|
|
+ @Select({"<script> " +
|
|
|
+ "select ec.unionid from qw_external_contact ec " +
|
|
|
+ "left join qw_user qu on ec.user_id=qu.qw_user_id and qu.corp_id=ec.corp_id " +
|
|
|
+ "left join qw_dept qd on qd.dept_id=qu.department and qd.corp_id=qu.corp_id " +
|
|
|
+ "left join company_user cu on ec.company_user_id=cu.user_id " +
|
|
|
+ "<where> \n" +
|
|
|
+ " <if test=\"userId != null and userId != ''\"> and ec.user_id like concat( #{userId}, '%') </if>\n" +
|
|
|
+ " <if test=\"qwUserName != null and qwUserName != ''\"> and qu.qw_user_name like concat( #{qwUserName}, '%') </if>\n" +
|
|
|
+ " <if test=\"externalUserId != null and externalUserId != ''\"> and ec.external_user_id = #{externalUserId}</if>\n" +
|
|
|
+ " <if test=\"name != null and name != ''\"> and ec.name like concat( #{name}, '%')</if>\n" +
|
|
|
+ " <if test=\"type != null \"> and ec.type = #{type}</if>\n" +
|
|
|
+ " <if test=\"gender != null \"> and ec.gender = #{gender}</if>\n" +
|
|
|
+ " <if test=\"description != null and description != ''\"> and ec.description = #{description}</if>\n" +
|
|
|
+
|
|
|
+ "<if test ='tagIds!=null and tagIds.size()!=0 '> " +
|
|
|
+ " and (\n" +
|
|
|
+ " <foreach collection='tagIds' item='item' index='index' separator=' AND '>\n" +
|
|
|
+ " find_in_set(#{item}, REGEXP_REPLACE(ec.tag_ids, '[\"\\\\[\\\\]]', ''))\n" +
|
|
|
+ " </foreach>\n" +
|
|
|
+ " )"+
|
|
|
+ "</if> " +
|
|
|
+
|
|
|
+ " <if test=\"remarkMobiles != null and remarkMobiles != ''\"> and ec.remark_mobiles like concat( #{remarkMobiles}, '%')</if>\n" +
|
|
|
+ " <if test=\"remark != null and remark != ''\"> and ec.remark like concat('%', #{remark}, '%')</if>\n" +
|
|
|
+ " <if test=\"remarkCorpName != null and remarkCorpName != ''\"> and ec.remark_corp_name like concat('%', #{remarkCorpName}, '%')</if>\n" +
|
|
|
+ " <if test=\"addWay != null \"> and ec.add_way = #{addWay}</if>\n" +
|
|
|
+ " <if test=\"operUserid != null and operUserid != ''\"> and ec.oper_userid = #{operUserid}</if>\n" +
|
|
|
+ " <if test=\"corpId != null and corpId != ''\"> and ec.corp_id = #{corpId}</if>\n" +
|
|
|
+ " <if test=\"companyId != null \"> and qu.company_id = #{companyId}</if>\n" +
|
|
|
+ " <if test=\"companyUserId != null \"> and ec.company_user_id = #{companyUserId}</if>\n" +
|
|
|
+ " <if test=\"customerId != null \"> and ec.customer_id = #{customerId}</if>\n" +
|
|
|
+ " <if test=\"status != null \"> and ec.status = #{status}</if>\n" +
|
|
|
+ " <if test=\"stageStatus != null \"> and ec.stage_status = #{stageStatus}</if>\n" +
|
|
|
+ " <if test=\"transferStatus != null \"> and ec.transfer_status = #{transferStatus}</if>\n" +
|
|
|
+ " <if test=\"qwUserId != null \"> and ec.qw_user_id = #{qwUserId}</if>\n" +
|
|
|
+ " <if test=\"level != null \"> and ec.level = #{level}</if>\n" +
|
|
|
+ " <if test=\"levelType != null \"> and ec.level_type = #{levelType}</if>\n" +
|
|
|
+ " <if test=\"isBind == 'isBind' \"> and ec.customer_id is not null </if> \n" +
|
|
|
+ " <if test=\"isBind == 'noBind' \"> and ec.customer_id is null </if> \n" +
|
|
|
+ " <if test=\"isBindMini == 'isBindMini' \"> and ec.fs_user_id is not null </if> \n" +
|
|
|
+ " <if test=\"isBindMini == 'noBindMini' \"> and ec.fs_user_id is null </if> \n" +
|
|
|
+ " <if test=\"lossTime != null \"> and DATE(ec.loss_time) = DATE(#{lossTime})</if>\n" +
|
|
|
+ " <if test=\"createTime != null \">and DATE(ec.create_time) = DATE(#{createTime})</if>\n" +
|
|
|
+ " <if test=\"delTime != null \"> and DATE(ec.del_time) = DATE(#{delTime})</if>\n" +
|
|
|
+ " <if test=\"sTime != null \"> and DATE(ec.create_time) >= DATE(#{sTime})</if>\n" +
|
|
|
+ " <if test=\"eTime != null \"> and DATE(ec.create_time) <= DATE(#{eTime})</if>\n" +
|
|
|
+ " <if test=\"companyUserName != null and companyUserName != ''\"> and cu.user_name = #{companyUserName}</if>\n" +
|
|
|
+ " <if test=\"cuDeptIdList != null and !cuDeptIdList.isEmpty() and userType != '00' \">" +
|
|
|
+ " AND cu.dept_id IN " +
|
|
|
+ " <foreach collection='cuDeptIdList' item='item' open='(' separator=',' close=')'> " +
|
|
|
+ " #{item} " +
|
|
|
+ " </foreach> " +
|
|
|
+ " </if>" +
|
|
|
+ "<if test ='companyUser!=null'> " +
|
|
|
+ "and (cu.nick_name like concat('%', #{companyUser}, '%') or cu.phonenumber= #{companyUser})"+
|
|
|
+ "</if> " +
|
|
|
+ " and ec.unionid is not null" +
|
|
|
+ " </where>"+
|
|
|
+ "order by ec.create_time desc,ec.id desc"+
|
|
|
+ "</script>"})
|
|
|
+ List<QwExternalContactUnionIdExportVO> selectQwExternalContactUnionIdExportVO(QwExternalContactParam qwExternalContact);
|
|
|
+
|
|
|
|
|
|
List<QwExternalContactVOTime> selectQwExternalContactListVOByIds(@Param("ids") List<Long> ids);
|
|
|
|