package com.iailab.module.system.dal.mysql.social; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.mybatis.core.mapper.BaseMapperX; import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; import com.iailab.module.system.controller.admin.socail.vo.user.SocialUserPageReqVO; import com.iailab.module.system.dal.dataobject.social.SocialUserDO; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.apache.ibatis.annotations.Mapper; @Mapper public interface SocialUserMapper extends BaseMapperX { default SocialUserDO selectByTypeAndCodeAnState(Integer type, String code, String state) { return selectOne(new LambdaQueryWrapper() .eq(SocialUserDO::getType, type) .eq(SocialUserDO::getCode, code) .eq(SocialUserDO::getState, state)); } default SocialUserDO selectByTypeAndOpenid(Integer type, String openid) { return selectOne(new LambdaQueryWrapper() .eq(SocialUserDO::getType, type) .eq(SocialUserDO::getOpenid, openid)); } default PageResult selectPage(SocialUserPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(SocialUserDO::getType, reqVO.getType()) .likeIfPresent(SocialUserDO::getNickname, reqVO.getNickname()) .likeIfPresent(SocialUserDO::getOpenid, reqVO.getOpenid()) .betweenIfPresent(SocialUserDO::getCreateTime, reqVO.getCreateTime()) .orderByDesc(SocialUserDO::getId)); } }