package com.iailab.module.infra.dal.mysql.demo.demo02; import com.iailab.framework.mybatis.core.mapper.BaseMapperX; import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; import com.iailab.module.infra.controller.admin.demo.demo02.vo.Demo02CategoryListReqVO; import com.iailab.module.infra.dal.dataobject.demo.demo02.Demo02CategoryDO; import org.apache.ibatis.annotations.Mapper; import java.util.List; /** * 示例分类 Mapper * * @author iailab */ @Mapper public interface Demo02CategoryMapper extends BaseMapperX { default List selectList(Demo02CategoryListReqVO reqVO) { return selectList(new LambdaQueryWrapperX() .likeIfPresent(Demo02CategoryDO::getName, reqVO.getName()) .eqIfPresent(Demo02CategoryDO::getParentId, reqVO.getParentId()) .betweenIfPresent(Demo02CategoryDO::getCreateTime, reqVO.getCreateTime()) .orderByDesc(Demo02CategoryDO::getId)); } default Demo02CategoryDO selectByParentIdAndName(Long parentId, String name) { return selectOne(Demo02CategoryDO::getParentId, parentId, Demo02CategoryDO::getName, name); } default Long selectCountByParentId(Long parentId) { return selectCount(Demo02CategoryDO::getParentId, parentId); } }