Commit 4fee465e by 墨竹

feat:会员登录bug修改

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