package com.yolo.keyboard.dal.mysql.character;

import java.util.*;

import com.yolo.keyboard.dal.dataobject.character.CharacterI18nDO;
import com.yolo.keyboard.framework.common.pojo.PageResult;
import com.yolo.keyboard.framework.common.pojo.PageParam;
import com.yolo.keyboard.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yolo.keyboard.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;

/**
 * 键盘人设国际化内容 Mapper
 *
 * @author ziin
 */
@Mapper
public interface CharacterI18nMapper extends BaseMapperX<CharacterI18nDO> {

    default PageResult<CharacterI18nDO> selectPage(PageParam reqVO, Long characterId) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CharacterI18nDO>()
            .eq(CharacterI18nDO::getCharacterId, characterId)
            .orderByDesc(CharacterI18nDO::getId));
    }

    default int deleteByCharacterId(Long characterId) {
        return delete(CharacterI18nDO::getCharacterId, characterId);
    }

	default int deleteByCharacterIds(List<Long> characterIds) {
	    return deleteBatch(CharacterI18nDO::getCharacterId, characterIds);
	}

}