Authored by wangshusheng

身份证

... ... @@ -12,6 +12,7 @@ public interface UnionShareUserIdentityCardMapper {
UnionShareUserIdentityCard selectByPrimaryKey(Integer id);
UnionShareUserIdentityCard selectActiveByUid(@Param("uid") Integer uid);
UnionShareUserIdentityCard selectByUid(@Param("uid") Integer uid);
List<UnionShareUserIdentityCard> selectByUids(@Param("uids") List<Integer> uids);
... ...
... ... @@ -20,7 +20,7 @@
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByUid" resultMap="BaseResultMap" parameterType="java.lang.Integer">
<select id="selectActiveByUid" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List" />
from union_share_user_identity_card
... ... @@ -29,6 +29,14 @@
limit 1
</select>
<select id="selectByUid" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List" />
from union_share_user_identity_card
where uid = #{uid,jdbcType=INTEGER}
limit 1
</select>
<select id="selectByUids" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
... ...
... ... @@ -3725,7 +3725,13 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
identityCard.setUpdateTime(identityCard.getCreateTime());
// 查询是否存在
UnionShareUserIdentityCard identityCardDb = unionShareUserIdentityCardMapper.selectByUid(bo.getUid());
int result = unionShareUserIdentityCardMapper.insert(identityCard);
int result = 0;
if(identityCardDb==null){
result = unionShareUserIdentityCardMapper.insert(identityCard);
}else{
identityCard.setId(identityCardDb.getId());
result = unionShareUserIdentityCardMapper.updateByPrimaryKey(identityCard);
}
redisHashCache.delete(ShareOrdersKeyEnum.USER_SETTLEMENT.getPreKey(), bo.getUid());
return result;
}
... ... @@ -3741,7 +3747,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
logger.info("getUserIdentityCard end, get redis cache ,uid is {},cacheResult is {}",uid,cacheResult);
return cacheResult;
}
UnionShareUserIdentityCard identityCard = unionShareUserIdentityCardMapper.selectByUid(uid);
UnionShareUserIdentityCard identityCard = unionShareUserIdentityCardMapper.selectActiveByUid(uid);
if (identityCard==null) {
return null;
}
... ...