Commit 4fee465e by 墨竹

feat:会员登录bug修改

parent 9834e78d
......@@ -24,39 +24,38 @@ public interface MemberUnionidRelatedMapper {
int cleanByCid(@Param("cid") String cid);
MemberUnionidRelated getByUnionId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("wxUserId") String wxUserId, @Param("unionid") String unionid);
MemberUnionidRelated getByUnionId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("wxUserId") String wxUserId, @Param("unionid") String unionid);
MemberUnionidRelated getByMemberId(@Param("wxUserId")String wxUserId, @Param("memberId")String memberId);
MemberUnionidRelated getByMemberId(@Param("wxUserId") String wxUserId, @Param("memberId") String memberId);
void deleteByUnionidAndUserId(@Param("externalUserid")String externalUserid,@Param("wxUserId") String wxUserId);
void deleteByUnionidAndUserId(@Param("externalUserid") String externalUserid, @Param("wxUserId") String wxUserId);
void delMemberUnionidRelatedBatch(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("externalUserids") List<String> externalUserid, @Param("wxUserId") String wxUserId);
List<MemberUnionidRelated> getByWxUserIdAndWxEnterpriseId(@Param("wxUserId")String wxUserId, @Param("wxEnterpriseId")String wxEnterpriseId);
List<MemberUnionidRelated> listByEnterpriseIdAndDate(@Param("enterpriseId")String enterpriseId,@Param("date")Date date);
MemberUnionidRelated getByParams(@Param("wxUserId")String wxUserId, @Param("wxEnterpriseId")String wxEnterpriseId,
@Param("externalName")String name, @Param("addCreateTime")String createTime);
List<MemberUnionidRelated> getByWxUserIdAndWxEnterpriseId(@Param("wxUserId") String wxUserId, @Param("wxEnterpriseId") String wxEnterpriseId);
List<MemberUnionidRelated> listByExTernalUseridAndWxUserId(@Param("externalUserid")String externalUserid, @Param("wxUserId")String wxUserId);
List<MemberUnionidRelated> listByEnterpriseIdAndDate(@Param("enterpriseId") String enterpriseId, @Param("date") Date date);
Page<MemberUnionidRelated> pageMemberUnionByParams(@Param("userIdList")List<String> userIdList, @Param("sendMemberIds")List<String> sendMemberIds,
@Param("enterpriseId")String enterpriseId);
MemberUnionidRelated getByParams(@Param("wxUserId") String wxUserId, @Param("wxEnterpriseId") String wxEnterpriseId,
@Param("externalName") String name, @Param("addCreateTime") String createTime);
List<MemberUnionidRelated> getByWxUserIdListAndWxEnterpriseId(@Param("userIdList")List<String> userIdList, @Param("wxEnterpriseId")String wxEnterpriseId);
List<MemberUnionidRelated> listByExTernalUseridAndWxUserId(@Param("externalUserid") String externalUserid, @Param("wxUserId") String wxUserId);
void cleanStaffRelated(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("staffIds")List<String> staffIds);
Page<MemberUnionidRelated> pageMemberUnionByParams(@Param("userIdList") List<String> userIdList, @Param("sendMemberIds") List<String> sendMemberIds,
@Param("enterpriseId") String enterpriseId);
/**
* 根据应用内的外部联系人获取信息
*
* @param wxUserId
* @param wxEnterpriseId
* @param selfExternalUserId
* @return
*/
MemberUnionidRelated getBySelfExternalUserId(@Param("wxUserId") String wxUserId, @Param("wxEnterpriseId") String wxEnterpriseId, @Param("selfExternalUserId") String selfExternalUserId);
List<MemberUnionidRelated> getByWxUserIdListAndWxEnterpriseId(@Param("userIdList") List<String> userIdList, @Param("wxEnterpriseId") String wxEnterpriseId);
List<MemberUnionidRelated> listBySelfExternalUserId(@Param("wxUserId") String wxUserId, @Param("wxEnterpriseId") String wxEnterpriseId, @Param("selfExternalUserId") String selfExternalUserId);
void cleanStaffRelated(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffIds") List<String> staffIds);
/**
* 根据应用内的外部联系人获取信息
*
* @param wxEnterpriseId
* @param selfExternalUserId
* @return
*/
MemberUnionidRelated getBySelfExternalUserId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("selfExternalUserId") String selfExternalUserId);
List<MemberUnionidRelated> listBySelfExternalUserId(@Param("wxUserId") String wxUserId, @Param("wxEnterpriseId") String wxEnterpriseId, @Param("selfExternalUserId") String selfExternalUserId);
}
\ No newline at end of file
......@@ -87,7 +87,7 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService
@Override
public MemberUnionidRelatedDTO getBySelfExternalUserId(String wxUserId, String wxEnterpriseId, String selfExternalUserId) {
MemberUnionidRelated unionidRelated = mapper.getBySelfExternalUserId(wxUserId, wxEnterpriseId, selfExternalUserId);
MemberUnionidRelated unionidRelated = mapper.getBySelfExternalUserId(wxEnterpriseId, selfExternalUserId);
return EntityUtil.changeEntityNew(MemberUnionidRelatedDTO.class, unionidRelated);
}
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.gic.haoban.manage.service.dao.mapper.MemberUnionidRelatedMapper" >
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.MemberUnionidRelated" >
<id column="member_unionid_related_id" property="memberUnionidRelatedId" jdbcType="VARCHAR" />
<result column="member_id" property="memberId" jdbcType="VARCHAR" />
<result column="unionid" property="unionid" jdbcType="VARCHAR" />
<result column="wx_enterprise_id" property="wxEnterpriseId" jdbcType="VARCHAR" />
<result column="enterprise_id" property="enterpriseId" jdbcType="VARCHAR" />
<result column="status_flag" property="statusFlag" jdbcType="INTEGER" />
<result column="external_userid" property="externalUserid" jdbcType="VARCHAR" />
<result column="wx_user_id" property="wxUserId" jdbcType="VARCHAR" />
<result column="self_external_userid" property="selfExternalUserid" jdbcType="VARCHAR" />
<result column="add_create_time" property="addCreateTime" jdbcType="VARCHAR" />
<result column="external_name" property="externalName" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
member_unionid_related_id, member_id, unionid, wx_enterprise_id, status_flag, external_userid,
<mapper namespace="com.gic.haoban.manage.service.dao.mapper.MemberUnionidRelatedMapper">
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.MemberUnionidRelated">
<id column="member_unionid_related_id" property="memberUnionidRelatedId" jdbcType="VARCHAR"/>
<result column="member_id" property="memberId" jdbcType="VARCHAR"/>
<result column="unionid" property="unionid" jdbcType="VARCHAR"/>
<result column="wx_enterprise_id" property="wxEnterpriseId" jdbcType="VARCHAR"/>
<result column="enterprise_id" property="enterpriseId" jdbcType="VARCHAR"/>
<result column="status_flag" property="statusFlag" jdbcType="INTEGER"/>
<result column="external_userid" property="externalUserid" jdbcType="VARCHAR"/>
<result column="wx_user_id" property="wxUserId" jdbcType="VARCHAR"/>
<result column="self_external_userid" property="selfExternalUserid" jdbcType="VARCHAR"/>
<result column="add_create_time" property="addCreateTime" jdbcType="VARCHAR"/>
<result column="external_name" property="externalName" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
member_unionid_related_id, member_id, unionid, wx_enterprise_id, status_flag, external_userid,
wx_user_id, create_time, update_time,add_create_time,self_external_userid,external_name,enterprise_id
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_member_unionid_related
where member_unionid_related_id = #{memberUnionidRelatedId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from tab_haoban_member_unionid_related
where member_unionid_related_id = #{memberUnionidRelatedId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated" >
insert into tab_haoban_member_unionid_related (member_unionid_related_id, member_id,
unionid, wx_enterprise_id, status_flag,
external_userid, wx_user_id, create_time,
update_time,add_create_time,self_external_userid,external_name,enterprise_id)
values (#{memberUnionidRelatedId,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR},
#{unionid,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER},
#{externalUserid,jdbcType=VARCHAR}, #{wxUserId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},#{addCreateTime},#{selfExternalUserid},#{externalName},#{enterpriseId})
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated" >
insert into tab_haoban_member_unionid_related
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="memberUnionidRelatedId != null" >
member_unionid_related_id,
</if>
<if test="memberId != null" >
member_id,
</if>
<if test="unionid != null" >
unionid,
</if>
<if test="wxEnterpriseId != null" >
wx_enterprise_id,
</if>
<if test="enterpriseId != null" >
enterprise_id,
</if>
<if test="statusFlag != null" >
status_flag,
</if>
<if test="externalUserid != null" >
external_userid,
</if>
<if test="wxUserId != null" >
wx_user_id,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="updateTime != null" >
update_time,
</if>
<if test="addCreateTime != null" >
add_create_time,
</if>
<if test="selfExternalUserid != null" >
self_external_userid,
</if>
<if test="externalName != null" >
external_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="memberUnionidRelatedId != null" >
#{memberUnionidRelatedId,jdbcType=VARCHAR},
</if>
<if test="memberId != null" >
#{memberId,jdbcType=VARCHAR},
</if>
<if test="unionid != null" >
#{unionid,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseId != null" >
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="enterpriseId != null" >
#{enterpriseId,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null" >
#{statusFlag,jdbcType=INTEGER},
</if>
<if test="externalUserid != null" >
#{externalUserid,jdbcType=VARCHAR},
</if>
<if test="wxUserId != null" >
#{wxUserId,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="addCreateTime != null" >
#{addCreateTime},
</if>
<if test="selfExternalUserid != null" >
#{selfExternalUserid},
</if>
<if test="externalName != null" >
#{externalName},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated" >
update tab_haoban_member_unionid_related
<set >
<if test="memberId != null" >
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="unionid != null" >
unionid = #{unionid,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseId != null" >
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="enterpriseId != null" >
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null" >
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
<if test="externalUserid != null" >
external_userid = #{externalUserid,jdbcType=VARCHAR},
</if>
<if test="wxUserId != null" >
wx_user_id = #{wxUserId,jdbcType=VARCHAR},
</if>
<if test="addCreateTime != null" >
add_create_time = #{addCreateTime,jdbcType=VARCHAR},
</if>
<if test="selfExternalUserid != null" >
self_external_userid = #{selfExternalUserid,jdbcType=VARCHAR},
</if>
<if test="externalName != null" >
external_name = #{externalName,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
update_time = now()
</set>
where member_unionid_related_id = #{memberUnionidRelatedId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated" >
update tab_haoban_member_unionid_related
set member_id = #{memberId,jdbcType=VARCHAR},
unionid = #{unionid,jdbcType=VARCHAR},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER},
external_userid = #{externalUserid,jdbcType=VARCHAR},
wx_user_id = #{wxUserId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
self_external_userid = #{selfExternalUserid,jdbcType=VARCHAR},
external_name = #{externalName,jdbcType=VARCHAR},
add_create_time = #{addCreateTime,jdbcType=VARCHAR}
where member_unionid_related_id = #{memberUnionidRelatedId,jdbcType=VARCHAR}
</update>
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_member_unionid_related
where member_unionid_related_id = #{memberUnionidRelatedId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete
from tab_haoban_member_unionid_related
where member_unionid_related_id = #{memberUnionidRelatedId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated">
insert into tab_haoban_member_unionid_related (member_unionid_related_id, member_id,
unionid, wx_enterprise_id, status_flag,
external_userid, wx_user_id, create_time,
update_time, add_create_time, self_external_userid,
external_name, enterprise_id)
values (#{memberUnionidRelatedId,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR},
#{unionid,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER},
#{externalUserid,jdbcType=VARCHAR}, #{wxUserId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{addCreateTime}, #{selfExternalUserid}, #{externalName},
#{enterpriseId})
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated">
insert into tab_haoban_member_unionid_related
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="memberUnionidRelatedId != null">
member_unionid_related_id,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="unionid != null">
unionid,
</if>
<if test="wxEnterpriseId != null">
wx_enterprise_id,
</if>
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="statusFlag != null">
status_flag,
</if>
<if test="externalUserid != null">
external_userid,
</if>
<if test="wxUserId != null">
wx_user_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="addCreateTime != null">
add_create_time,
</if>
<if test="selfExternalUserid != null">
self_external_userid,
</if>
<if test="externalName != null">
external_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="memberUnionidRelatedId != null">
#{memberUnionidRelatedId,jdbcType=VARCHAR},
</if>
<if test="memberId != null">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="unionid != null">
#{unionid,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseId != null">
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null">
#{statusFlag,jdbcType=INTEGER},
</if>
<if test="externalUserid != null">
#{externalUserid,jdbcType=VARCHAR},
</if>
<if test="wxUserId != null">
#{wxUserId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="addCreateTime != null">
#{addCreateTime},
</if>
<if test="selfExternalUserid != null">
#{selfExternalUserid},
</if>
<if test="externalName != null">
#{externalName},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated">
update tab_haoban_member_unionid_related
<set>
<if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="unionid != null">
unionid = #{unionid,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseId != null">
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null">
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
<if test="externalUserid != null">
external_userid = #{externalUserid,jdbcType=VARCHAR},
</if>
<if test="wxUserId != null">
wx_user_id = #{wxUserId,jdbcType=VARCHAR},
</if>
<if test="addCreateTime != null">
add_create_time = #{addCreateTime,jdbcType=VARCHAR},
</if>
<if test="selfExternalUserid != null">
self_external_userid = #{selfExternalUserid,jdbcType=VARCHAR},
</if>
<if test="externalName != null">
external_name = #{externalName,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
update_time = now()
</set>
where member_unionid_related_id = #{memberUnionidRelatedId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated">
update tab_haoban_member_unionid_related
set member_id = #{memberId,jdbcType=VARCHAR},
unionid = #{unionid,jdbcType=VARCHAR},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER},
external_userid = #{externalUserid,jdbcType=VARCHAR},
wx_user_id = #{wxUserId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
self_external_userid = #{selfExternalUserid,jdbcType=VARCHAR},
external_name = #{externalName,jdbcType=VARCHAR},
add_create_time = #{addCreateTime,jdbcType=VARCHAR}
where member_unionid_related_id = #{memberUnionidRelatedId,jdbcType=VARCHAR}
</update>
<update id="cleanByCid">
update tab_haoban_member_unionid_related
set
status_flag = 0,
update_time=now()
where member_id is null
<if test="cid !=null">
and wx_enterprise_id = #{cid}
</if>
</update>
<select id="getByUnionId" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_member_unionid_related
where wx_user_id = #{wxUserId}
and wx_enterprise_id=#{wxEnterpriseId}
and status_flag = 1
and unionid = #{unionid}
limit 1
</select>
<select id="getByMemberId" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_member_unionid_related
where wx_user_id = #{wxUserId}
and status_flag = 1
and member_id = #{memberId}
limit 1
</select>
<update id="deleteByUnionidAndUserId" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated">
update tab_haoban_member_unionid_related
set status_flag = 0,
update_time=now()
where external_userid = #{externalUserid,jdbcType=VARCHAR}
and wx_user_id = #{wxUserId}
</update>
<update id="delMemberUnionidRelatedBatch" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated">
update tab_haoban_member_unionid_related
set status_flag = 0,update_time=now()
where
wx_enterprise_id=#{wxEnterpriseId}
and wx_user_id = #{wxUserId}
and external_userid in
<foreach collection="externalUserids" open="(" close=")" separator="," item="item">
#{item}
</foreach>
</update>
<update id="cleanByCid" >
update tab_haoban_member_unionid_related
set
status_flag = 0,
update_time=now()
where member_id is null
<if test="cid !=null">
and wx_enterprise_id = #{cid}
</if>
</update>
<select id="getByUnionId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_member_unionid_related
where wx_user_id = #{wxUserId}
and wx_enterprise_id=#{wxEnterpriseId}
and status_flag = 1
and unionid = #{unionid}
limit 1
</select>
<select id="getByMemberId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_member_unionid_related
where wx_user_id = #{wxUserId}
and status_flag = 1
and member_id = #{memberId}
limit 1
</select>
<update id="deleteByUnionidAndUserId" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated" >
update tab_haoban_member_unionid_related
set status_flag = 0 ,update_time=now()
where external_userid = #{externalUserid,jdbcType=VARCHAR}
and wx_user_id = #{wxUserId}
</update>
<select id="getByWxUserIdAndWxEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_member_unionid_related
where wx_user_id = #{wxUserId}
and status_flag in(1,3,4)
and wx_enterprise_id = #{wxEnterpriseId}
</select>
<select id="listByEnterpriseIdAndDate" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_member_unionid_related
where status_flag = 1
and enterprise_id = #{enterpriseId}
<if test="date != null">
and TO_DAYS(create_time) <![CDATA[ >= ]]> TO_DAYS(#{date,jdbcType=TIMESTAMP})
</if>
</select>
<select id="listByExTernalUseridAndWxUserId" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_member_unionid_related
where wx_user_id = #{wxUserId}
and status_flag = 1
and external_userid = #{externalUserid}
</select>
<select id="getByParams" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_member_unionid_related
where wx_user_id = #{wxUserId}
and status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
and external_name = #{externalName}
and add_create_time = #{addCreateTime}
</select>
<select id="pageMemberUnionByParams" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_member_unionid_related
where enterprise_id = #{enterpriseId}
and status_flag = 1
and member_id in
<foreach item="memberId" index="index" collection="sendMemberIds" open="(" separator="," close=")">
#{memberId, jdbcType=CHAR}
</foreach>
and wx_user_id in
<foreach item="wxUserId" index="index" collection="userIdList" open="(" separator="," close=")">
#{wxUserId, jdbcType=CHAR}
</foreach>
and member_id is not null
group by external_userid
</select>
<select id="getByWxUserIdListAndWxEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_member_unionid_related
where wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1
and wx_user_id in
<foreach item="wxUserId" index="index" collection="userIdList" open="(" separator="," close=")">
#{wxUserId, jdbcType=CHAR}
</foreach>
</select>
<update id="cleanStaffRelated" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated">
update tab_haoban_member_unionid_related
set status_flag = 0,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and wx_user_id in
(select wx_user_id from tab_haoban_staff where staff_id in
<foreach collection="staffIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
)
and status_flag = 1
</update>
<update id="delMemberUnionidRelatedBatch" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated">
update tab_haoban_member_unionid_related
set status_flag = 0,update_time=now()
where
wx_enterprise_id=#{wxEnterpriseId}
and wx_user_id = #{wxUserId}
and external_userid in
<foreach collection="externalUserids" open="(" close=")" separator="," item="item">
#{item}
</foreach>
</update>
<select id="getByWxUserIdAndWxEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_member_unionid_related
where wx_user_id = #{wxUserId}
and status_flag in(1,3,4)
and wx_enterprise_id = #{wxEnterpriseId}
</select>
<select id="listByEnterpriseIdAndDate" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_member_unionid_related
where status_flag = 1
and enterprise_id = #{enterpriseId}
<if test="date != null" >
and TO_DAYS(create_time) <![CDATA[ >= ]]> TO_DAYS(#{date,jdbcType=TIMESTAMP})
</if>
</select>
<select id="listByExTernalUseridAndWxUserId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_member_unionid_related
where wx_user_id = #{wxUserId}
and status_flag = 1
and external_userid = #{externalUserid}
</select>
<select id="getByParams" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_member_unionid_related
where wx_user_id = #{wxUserId}
and status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
and external_name = #{externalName}
and add_create_time = #{addCreateTime}
</select>
<select id="pageMemberUnionByParams" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_member_unionid_related
where enterprise_id = #{enterpriseId}
and status_flag = 1
and member_id in
<foreach item="memberId" index="index" collection="sendMemberIds" open="(" separator="," close=")">
#{memberId, jdbcType=CHAR}
</foreach>
and wx_user_id in
<foreach item="wxUserId" index="index" collection="userIdList" open="(" separator="," close=")">
#{wxUserId, jdbcType=CHAR}
</foreach>
and member_id is not null
group by external_userid
</select>
<select id="getByWxUserIdListAndWxEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_member_unionid_related
where wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1
and wx_user_id in
<foreach item="wxUserId" index="index" collection="userIdList" open="(" separator="," close=")">
#{wxUserId, jdbcType=CHAR}
</foreach>
</select>
<update id="cleanStaffRelated" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated" >
update tab_haoban_member_unionid_related
set status_flag = 0,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and wx_user_id in
(select wx_user_id from tab_haoban_staff where staff_id in
<foreach collection="staffIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
)
and status_flag = 1
</update>
<select id="getBySelfExternalUserId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_member_unionid_related
where wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1
and self_external_userid = #{selfExternalUserId} order by create_time desc limit 1
</select>
<select id="getBySelfExternalUserId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_member_unionid_related
where wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1
and wx_user_id = #{wxUserId, jdbcType=CHAR}
and self_external_userid = #{selfExternalUserId}
</select>
<select id="listBySelfExternalUserId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_member_unionid_related
where wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1
and wx_user_id = #{wxUserId, jdbcType=CHAR}
and self_external_userid = #{selfExternalUserId}
</select>
<select id="listBySelfExternalUserId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_member_unionid_related
where wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1
and wx_user_id = #{wxUserId, jdbcType=CHAR}
and self_external_userid = #{selfExternalUserId}
</select>
</mapper>
\ No newline at end of file
......@@ -407,10 +407,6 @@ public class WxEnterpriseInfoController extends WebBaseController {
logger.info("企业不存在没有绑定");
return resultResponse(HaoBanErrCode.ERR_400002);
}
//if (enterpriseBindInfo.getMemberOpenCardFlag() != 1) {
// logger.info("该企业在同一个开平,无需手动关联:wxEid:{}, eid:{}", wxEnterpriseId, gicEnterpriseId);
// return resultResponse(HaoBanErrCode.ERR_11125);
//}
MemberUnionidRelatedDTO memberUnionidRelatedDTO = memberUnionidRelatedApiService.getExternalUseridInfoBySelfExternalUserId(wxEnterpriseId, wxUserId, externalUserid);
if (null == memberUnionidRelatedDTO) {
logger.info("请刷新好友");
......@@ -438,7 +434,6 @@ public class WxEnterpriseInfoController extends WebBaseController {
memberSendMessageVo.setWxaHandUrl(enterpriseDTO.getMallMiniprogramLogoUrl());
memberSendMessageVo.setBindFlag(clerkRelatedDTO.getStatusFlag() == 1 ? 1 : 0);
memberSendMessageVo.setWxaName(settingDTO.getMiniprogramName());
return resultResponse(HaoBanErrCode.ERR_1, memberSendMessageVo);
}
......
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