package com.iailab.module.system.dal.mysql.dept; import com.iailab.framework.mybatis.core.mapper.BaseMapperX; import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; import com.iailab.module.system.controller.admin.dept.vo.dept.DeptListReqVO; import com.iailab.module.system.dal.dataobject.dept.DeptDO; import org.apache.ibatis.annotations.Mapper; import java.util.Collection; import java.util.List; @Mapper public interface DeptMapper extends BaseMapperX { default List selectList(DeptListReqVO reqVO) { return selectList(new LambdaQueryWrapperX() .likeIfPresent(DeptDO::getName, reqVO.getName()) .eqIfPresent(DeptDO::getStatus, reqVO.getStatus())); } default DeptDO selectByParentIdAndName(Long parentId, String name) { return selectOne(DeptDO::getParentId, parentId, DeptDO::getName, name); } default Long selectCountByParentId(Long parentId) { return selectCount(DeptDO::getParentId, parentId); } default List selectListByParentId(Collection parentIds) { return selectList(DeptDO::getParentId, parentIds); } }