Commit 1f80a71b by fudahua

企业微信标签同步fix

parent b4a9e650
......@@ -66,4 +66,23 @@ public interface QywxTagRelationMapper {
* @return
*/
List<TabQywxTagRelation> listByQywxTagId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("qywxTagId") String qywxTagId);
/**
* 查询企业下标签组的关联
*
* @param wxEnterpriseId
* @param qywxTagId
* @return
*/
TabQywxTagRelation getQywxGroupByQywxTagId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("qywxTagId") String qywxTagId);
/**
* 查询企业下标签项的关联
*
* @param wxEnterpriseId
* @param qywxTagItemId
* @return
*/
TabQywxTagRelation getQywxTagByQywxTagItemId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("qywxTagItemId") String qywxTagItemId);
}
\ No newline at end of file
......@@ -146,6 +146,16 @@ public interface QywxTagService {
*/
public boolean delQywxTagItemById(String wxEnterpriseId, String id);
/**
* 根据企业微信的key 查询关联关系
*
* @param wxEnterpriseId
* @param key
* @param qywxTagRelationType
* @return
*/
public TabQywxTagRelation getQywxTagRelationByQywxKey(String wxEnterpriseId, String key, Integer qywxTagRelationType);
}
......@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service.impl;
import com.gic.commons.util.ToolUtil;
import com.gic.haoban.manage.api.dto.QywxTagInfoDTO;
import com.gic.haoban.manage.api.dto.QywxTagItemDTO;
import com.gic.haoban.manage.api.enums.QywxTagRelationTypeEnum;
import com.gic.haoban.manage.service.dao.mapper.QywxTagItemMapper;
import com.gic.haoban.manage.service.dao.mapper.QywxTagMapper;
import com.gic.haoban.manage.service.dao.mapper.QywxTagRelationMapper;
......@@ -187,4 +188,21 @@ public class QywxTagServiceImpl implements QywxTagService {
qywxTagItemMapper.updateByPrimaryKeySelective(item);
return true;
}
@Override
public TabQywxTagRelation getQywxTagRelationByQywxKey(String wxEnterpriseId, String key, Integer qywxTagRelationType) {
if (qywxTagRelationType == QywxTagRelationTypeEnum.TAG_GROUP.getType()) {
TabQywxTag qywxGroupKey = qywxTagMapper.getByQywxGroupKey(wxEnterpriseId, key);
if (null == qywxGroupKey) {
return null;
}
return qywxTagRelationMapper.getQywxGroupByQywxTagId(wxEnterpriseId, qywxGroupKey.getQywxTagId());
} else {
TabQywxTagItem qywxTagItem = qywxTagItemMapper.getByQywxTagKey(wxEnterpriseId, key);
if (null == qywxTagItem) {
return null;
}
return qywxTagRelationMapper.getQywxTagByQywxTagItemId(wxEnterpriseId, qywxTagItem.getQywxTagItemId());
}
}
}
......@@ -224,4 +224,26 @@
and status_flag=1
and sync_flag=1
</select>
<select id="getQywxGroupByQywxTagId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_qywx_tag_relation
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and qywx_tag_id = #{qywxTagId,jdbcType=VARCHAR}
and relation_type=0
and status_flag=1
and sync_flag=1
</select>
<select id="getQywxTagByQywxTagItemId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_qywx_tag_relation
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and qywx_tag_item_id = #{qywxTagId,jdbcType=VARCHAR}
and relation_type=1
and status_flag=1
and sync_flag=1
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment