Merge branch 'master' into cc_20251028_decoration
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.wechat.ServiceAccountOpenIdDTO;
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import com.cool.store.mapper.HyPartnerUserInfoMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -112,4 +113,11 @@ public class HyPartnerUserInfoDAO {
|
||||
|
||||
return hyPartnerUserInfoMapper.selectPasswordIsNull();
|
||||
}
|
||||
|
||||
public List<ServiceAccountOpenIdDTO> selectLastBindRecord(List<String> mobileList){
|
||||
if (CollectionUtils.isEmpty(mobileList)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return hyPartnerUserInfoMapper.selectLastBindRecord(mobileList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,27 @@ public class PartnerUserWechatBindDAO {
|
||||
return partnerUserWechatBindMapper.insert(partnerUserWechatBindDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* @param partnerUserWechatBindDO
|
||||
* @return
|
||||
*/
|
||||
public Integer update(PartnerUserWechatBindDO partnerUserWechatBindDO) {
|
||||
if (partnerUserWechatBindDO == null) {
|
||||
return 0;
|
||||
}
|
||||
return partnerUserWechatBindMapper.update(partnerUserWechatBindDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新所有的unionId对应的服务号ID
|
||||
* @param unionId 开发平台的用户ID
|
||||
* @param serviceAccountOpenId 服务号ID
|
||||
* @return
|
||||
*/
|
||||
public Integer updateByUnionId(String unionId,String serviceAccountOpenId) {
|
||||
return partnerUserWechatBindMapper.updateByUnionId(unionId,serviceAccountOpenId);
|
||||
}
|
||||
|
||||
public PartnerUserWechatBindDO getByOpenIdAndPartnerId(String partnerId, String openId) {
|
||||
if (StringUtil.isEmpty(partnerId)|| StringUtil.isEmpty(openId)){
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.wechat.ServiceAccountOpenIdDTO;
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -55,4 +56,6 @@ public interface HyPartnerUserInfoMapper extends tk.mybatis.mapper.common.Mappe
|
||||
|
||||
List<HyPartnerUserInfoDO> selectPasswordIsNull();
|
||||
|
||||
List<ServiceAccountOpenIdDTO> selectLastBindRecord(@Param("mobileList") List<String> mobileList);
|
||||
|
||||
}
|
||||
@@ -18,6 +18,22 @@ public interface PartnerUserWechatBindMapper {
|
||||
*/
|
||||
Integer insert(PartnerUserWechatBindDO partnerUserWechatBindDO);
|
||||
|
||||
/**
|
||||
* 更新数据
|
||||
* @param partnerUserWechatBindDO
|
||||
* @return
|
||||
*/
|
||||
Integer update(PartnerUserWechatBindDO partnerUserWechatBindDO);
|
||||
|
||||
|
||||
/**
|
||||
* 更新所有的unionId对应的服务号ID
|
||||
* @param unionId 开发平台的用户ID
|
||||
* @param serviceAccountOpenId 服务号ID
|
||||
* @return
|
||||
*/
|
||||
Integer updateByUnionId(String unionId,String serviceAccountOpenId);
|
||||
|
||||
/**
|
||||
* 根据partnerId与openId查询
|
||||
* @param partnerId
|
||||
|
||||
@@ -195,4 +195,23 @@
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="selectLastBindRecord" resultType="com.cool.store.dto.wechat.ServiceAccountOpenIdDTO">
|
||||
select
|
||||
b.partner_id as partnerId,
|
||||
b.union_id as unionId,
|
||||
b.service_account_open_id as serviceAccountOpenId,
|
||||
MAX(b.update_time) as lastUpdateTime
|
||||
from xfsg_partner_user_info a
|
||||
left join xfsg_partner_user_wechat_bind b
|
||||
on a.partner_id = b.partner_id
|
||||
where b.partner_id is not null
|
||||
and service_account_open_id is not null
|
||||
<if test="mobileList !=null and mobileList.size>0">
|
||||
<foreach collection="mobileList" open="and mobile in (" close=")" separator="," item="mobile">
|
||||
#{mobile}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY b.partner_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -8,6 +8,8 @@
|
||||
<result column="open_id" property="openId" jdbcType="VARCHAR" />
|
||||
<result column="bind_time" property="bindTime" jdbcType="TIMESTAMP" />
|
||||
<result column="partner_id" property="partnerId" jdbcType="VARCHAR" />
|
||||
<result column="union_id" property="unionId" jdbcType="VARCHAR" />
|
||||
<result column="service_account_open_id" property="serviceAccountOpenId" jdbcType="VARCHAR" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
||||
</resultMap>
|
||||
@@ -17,15 +19,33 @@
|
||||
open_id,
|
||||
bind_time,
|
||||
partner_id,
|
||||
union_id,
|
||||
create_time
|
||||
) VALUES (
|
||||
#{openId, jdbcType=VARCHAR},
|
||||
#{bindTime, jdbcType=TIMESTAMP},
|
||||
#{partnerId, jdbcType=VARCHAR},
|
||||
#{unionId, jdbcType=VARCHAR},
|
||||
#{createTime, jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.cool.store.entity.PartnerUserWechatBindDO">
|
||||
UPDATE xfsg_partner_user_wechat_bind
|
||||
<set>
|
||||
<if test="unionId != null">
|
||||
union_id = #{unionId, jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateByUnionId" >
|
||||
UPDATE xfsg_partner_user_wechat_bind
|
||||
set service_account_open_id = #{serviceAccountOpenId}
|
||||
where union_id = #{unionId}
|
||||
</update>
|
||||
|
||||
<select id="selectByPartnerAndOpenId" resultMap="BaseResultMap">
|
||||
select * from xfsg_partner_user_wechat_bind where partner_id = #{partnerId} and open_id = #{openId}
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user