package com.iailab.module.infra.dal.mysql.demo;
|
|
import java.util.*;
|
|
import com.iailab.framework.common.pojo.PageResult;
|
import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.iailab.framework.mybatis.core.mapper.BaseMapperX;
|
import com.iailab.module.infra.dal.dataobject.demo.InfraCategoryDO;
|
import org.apache.ibatis.annotations.Mapper;
|
import com.iailab.module.infra.controller.admin.demo.vo.*;
|
|
/**
|
* 分类 Mapper
|
*
|
* @author iailab
|
*/
|
@Mapper
|
public interface InfraCategoryMapper extends BaseMapperX<InfraCategoryDO> {
|
|
default List<InfraCategoryDO> selectList(InfraCategoryListReqVO reqVO) {
|
return selectList(new LambdaQueryWrapperX<InfraCategoryDO>()
|
.likeIfPresent(InfraCategoryDO::getName, reqVO.getName())
|
.orderByDesc(InfraCategoryDO::getId));
|
}
|
|
default InfraCategoryDO selectByParentIdAndName(Long parentId, String name) {
|
return selectOne(InfraCategoryDO::getParentId, parentId, InfraCategoryDO::getName, name);
|
}
|
|
default Long selectCountByParentId(Long parentId) {
|
return selectCount(InfraCategoryDO::getParentId, parentId);
|
}
|
|
}
|