package jnpf.permission.mapper; import cn.hutool.core.collection.CollectionUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import jnpf.base.mapper.SuperMapper; import jnpf.permission.entity.SocialsUserEntity; import java.util.List; /** * 流程设计 * * @author JNPF开发平台组 * @version V3.4.2 * @copyright 引迈信息技术有限公司 * @date 2022/7/14 9:49:19 */ public interface SocialsUserMapper extends SuperMapper { default List getListByUserId(String userId) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(SocialsUserEntity::getUserId, userId); return this.selectList(queryWrapper); } default List getUserIfnoBySocialIdAndType(String socialId, String socialType) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(SocialsUserEntity::getSocialId, socialId); queryWrapper.lambda().eq(SocialsUserEntity::getSocialType, socialType); return this.selectList(queryWrapper); } default List getListByUserIdAndSource(String userId, String socialType) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(SocialsUserEntity::getUserId, userId); queryWrapper.lambda().eq(SocialsUserEntity::getSocialType, socialType); return this.selectList(queryWrapper); } default SocialsUserEntity getInfoBySocialId(String socialId, String socialType) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(SocialsUserEntity::getSocialId, socialId); queryWrapper.lambda().eq(SocialsUserEntity::getSocialType, socialType); return this.selectOne(queryWrapper); } default void deleteAllByUserId(List userId) { if (CollectionUtil.isEmpty(userId)) { return; } QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().in(SocialsUserEntity::getUserId, userId); this.deleteByIds(selectList(queryWrapper)); } }