2026-06-26 20b96473f2520590a0dca6b775b81e3ea06a77a0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package cn.iocoder.yudao.module.infra.dal.mysql.demo;
 
import java.util.*;
 
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.InfraCategoryDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.infra.controller.admin.demo.vo.*;
 
/**
 * 分类 Mapper
 *
 * @author 芋道源码
 */
@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);
    }
 
}