package com.njcn.rdms.module.system.dal.mysql.user;

import com.njcn.rdms.framework.mybatis.core.mapper.BaseMapperX;
import com.njcn.rdms.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.njcn.rdms.module.system.dal.dataobject.user.UserSignatureDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface UserSignatureMapper extends BaseMapperX<UserSignatureDO> {

    default UserSignatureDO selectByUserId(Long userId) {
        return selectOne(new LambdaQueryWrapperX<UserSignatureDO>()
                .eq(UserSignatureDO::getUserId, userId));
    }

    default int deleteByUserId(Long userId) {
        return delete(new LambdaQueryWrapperX<UserSignatureDO>()
                .eq(UserSignatureDO::getUserId, userId));
    }
}
