| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.code.mapper; |
| | | |
| | | import com.vci.starter.web.pagemodel.PageHelper; |
| | | import com.vci.starter.web.wrapper.VciQueryWrapperForDO; |
| | | import com.vci.web.pageModel.BatchCBO; |
| | | import com.vci.ubcs.code.entity.CodeClassifyDO; |
| | | import com.vci.ubcs.code.entity.CodeClassify; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; |
| | | import org.apache.ibatis.annotations.MapKey; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 主题库分类数据操作层 |
| | | * 主题库定义表 Mapper 接口 |
| | | * |
| | | * @author weidy |
| | | * @date 2022-01-20 |
| | | * @author yuxc |
| | | * @since 2023-04-06 |
| | | */ |
| | | public interface CodeClassifyMapper { |
| | | public interface CodeClassifyMapper extends BaseMapper<CodeClassify> { |
| | | |
| | | /** |
| | | * 使用主键删除 |
| | | * @param oid 数据主键 |
| | | * @return 执行结果 |
| | | */ |
| | | BatchCBO deleteByPrimaryKey(String oid); |
| | | |
| | | /** |
| | | * 添加数据 |
| | | * @param record 主题库分类数据对象 |
| | | * @return 执行结果 |
| | | */ |
| | | BatchCBO insert(CodeClassifyDO record); |
| | | |
| | | /** |
| | | * 批量添加数据 |
| | | * @param records 主题库分类数据对象集合 |
| | | * @return 执行结果数 |
| | | */ |
| | | BatchCBO batchInsert(List<CodeClassifyDO> records); |
| | | |
| | | /** |
| | | * 根据主键查询 |
| | | * @param oid 数据主键 |
| | | * @return 数据对象 |
| | | */ |
| | | CodeClassifyDO selectByPrimaryKey(String oid); |
| | | |
| | | /** |
| | | * 根据主键批量获取对象 |
| | | * @param oids 主键,包含单引号,但是不能超过1000 |
| | | * @return 数据对象列表 |
| | | */ |
| | | List<CodeClassifyDO> selectByPrimaryKeys(String oids); |
| | | |
| | | /** |
| | | * 根据主键批量查询对象 |
| | | * @param oids 对象主键,使用逗号分隔,但是不能超过1000 |
| | | * @return 业务对象 |
| | | */ |
| | | List<CodeClassifyDO> selectByPrimaryKeyCollection(Collection<String> oids); |
| | | |
| | | /** |
| | | * 查询所有分类 |
| | | * @return 查询结果 |
| | | */ |
| | | List<CodeClassifyDO> selectAll(); |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param record 主题库分类数据对象 |
| | | * @return 执行结果 |
| | | */ |
| | | BatchCBO updateByPrimaryKey(CodeClassifyDO record); |
| | | |
| | | /** |
| | | * 批量更新 |
| | | * @param records 主题库分类数据对象集合 |
| | | * @return 执行结果行数 |
| | | */ |
| | | BatchCBO batchUpdate(List<CodeClassifyDO> records); |
| | | |
| | | /** |
| | | * 根据查询条件查询数据 |
| | | * @param conditionMap 查询条件, |
| | | * @param pageHelper 包括分页,排序 |
| | | * @return 数据对象列表 |
| | | */ |
| | | List<CodeClassifyDO> selectByCondition(Map<String,String> conditionMap, PageHelper pageHelper); |
| | | |
| | | /** |
| | | * 根据查询条件来查询总数 |
| | | * @param conditionMap 查询条件 |
| | | * @return 总数 |
| | | */ |
| | | Long countByCondition(Map<String,String> conditionMap); |
| | | |
| | | /** |
| | | * 使用查询封装器来查询 |
| | | * @param queryWrapper 查询封装器 |
| | | * @return 数据对象 |
| | | */ |
| | | List<CodeClassifyDO> selectByWrapper(VciQueryWrapperForDO queryWrapper); |
| | | |
| | | /** |
| | | * 使用查询封装器查询总数 |
| | | * @param queryWrapper 查询封装器 |
| | | * @return 总数 |
| | | */ |
| | | Long countByWrapper(VciQueryWrapperForDO queryWrapper); |
| | | |
| | | /** |
| | | * 根据主键获取名称 |
| | | * @param oid 主键 |
| | | * @return 中文名称 |
| | | */ |
| | | String selectNameByOid(String oid); |
| | | |
| | | /** |
| | | * 获取所有层级下级的主键 |
| | | * @param oid 数据主键 |
| | | * @return 查询结果 key是主键,value是本次查询的层级 |
| | | */ |
| | | Map<String,String> selectAllLevelChildOid(String oid); |
| | | |
| | | /** |
| | | * 获取所有层级上级关联业务类型数据 |
| | | * @param oid 当前分类的oid |
| | | * @return oid,id,name,btmtypeid,btmtypename |
| | | */ |
| | | List<CodeClassifyDO> selectAllLevelParents(String oid); |
| | | |
| | | /** |
| | | * 获取当前分类的所有上级分类(含本次查询层级号) |
| | | * @param oid 主键 |
| | | * @return 所有的上级 |
| | | */ |
| | | List<CodeClassifyDO> selectAllLevelParentByOid(String oid); |
| | | |
| | | /** |
| | | * 获取这个分类下的业务类型,当前没有就获取上级的第一个业务类型 |
| | | * @param oid 当前分类的oid |
| | | * @return oid,id,name,btmtypeid,btmtypename |
| | | */ |
| | | CodeClassifyDO selectBtmOrParentBtm(String oid); |
| | | |
| | | /** |
| | | * 获取所有下级数据 |
| | | * @param oid 数据主键 |
| | | * @return 查询结果 |
| | | */ |
| | | List<CodeClassifyDO> selectAllLevelChild(String oid); |
| | | |
| | | /** |
| | | * 查询所有的下级,并包含层级的路径 |
| | | * @param oid 上级的主键 |
| | | * @param fieldInPath 字段在路径中的内容 |
| | | * @param enable 是否只查询启用 |
| | | * @return 分类的数据内容 |
| | | */ |
| | | List<CodeClassifyDO> selectAllLevelChildHasPath(String oid, String fieldInPath,boolean enable); |
| | | |
| | | /** |
| | | * 查询某个节点的所有层级下级的个数 |
| | | * @param oid 主键 |
| | | * @return 总数 |
| | | */ |
| | | long countAllLevelChildOid(String oid); |
| | | |
| | | /** |
| | | * 反向从子级获取父级的主题库分类 |
| | | * 自定义分页 |
| | | * |
| | | * @param codeClassifyOid 分类的主键 |
| | | * @return 分类的显示对象 |
| | | * @param page |
| | | * @param plCodeClassify |
| | | * @return |
| | | */ |
| | | List<CodeClassifyDO> listParentClassify(String codeClassifyOid); |
| | | List<CodeClassifyVO> selectPlCodeClassifyPage(IPage page, CodeClassifyVO plCodeClassify); |
| | | |
| | | /** |
| | | * 查询这个分类的root节点oid |
| | | */ |
| | | CodeClassifyDO getRootClassify(String codeClassifyOid); |
| | | |
| | | /** |
| | | * 判断这个分类是否属于wupin分类树 |
| | | * 查找子类 |
| | | * |
| | | * @param oid |
| | | * @return |
| | | */ |
| | | boolean isWupin(String oid); |
| | | /** |
| | | * 批量修改生命周期的状态 |
| | | * @param oids 主键集合,不能大于1000 |
| | | * @param lcStatus 生命周期的值 |
| | | * @return 执行的结果 |
| | | */ |
| | | long batchUpdateLcStatus(Collection<String> oids, String lcStatus); |
| | | /** |
| | | * 根据主键更新状态 |
| | | * @param oid 主键 |
| | | * @param lcStatus 生命周期状态 |
| | | * @return 受影响的行数 |
| | | */ |
| | | int updateLcStatus( String oid, String lcStatus); |
| | | |
| | | /** |
| | | * 批量删除对象 |
| | | * @param oids 对象的主键集合 |
| | | * @return 受影响的行数 |
| | | */ |
| | | BatchCBO batchDeleteByOids(Collection<String> oids); |
| | | @MapKey("oid") |
| | | Map<String,String> selectAllLevelChildOid(@Param("oid") String oid); |
| | | |
| | | /** |
| | | * 校验是否包含子节点 |
| | | * |
| | | * @param oid 分类的主键 |
| | | * @return true 表示包含 |
| | | */ |
| | | boolean checkHasChild(String oid); |
| | | // @MapKey("oid") |
| | | Boolean checkHasChild(@Param("oid") String oid); |
| | | |
| | | /** |
| | | * 使用字段的路径,查询对象 |
| | | * @param fieldPath 字段的路径,必须从顶层节点开始 xxx/yyy/zz的格式 |
| | | * @param field 字段的英文名称 |
| | | * @return 分类的对象 |
| | | * 查找树形结构 |
| | | * |
| | | * @param oid 分类的主键 |
| | | * @return 数据集合 |
| | | */ |
| | | CodeClassifyDO selectByFieldPath(String fieldPath, String field); |
| | | List<CodeClassify> selectCodeClassifyVOByTree(@Param("oid") String oid); |
| | | |
| | | /*** |
| | | * 根据上级节点获取下级节点代号路径和名称路径 |
| | | * @param classifyId |
| | | * @param enable |
| | | * @return |
| | | /** |
| | | * 查找树形结构 |
| | | * |
| | | * @param oid 分类的主键 |
| | | * @return 数据集合 |
| | | */ |
| | | public List<CodeClassifyDO>getIdPathToNamePathByParentId(String classifyId,boolean enable); |
| | | List<CodeClassify> selectAllLevelChildHasPath(@Param("oid") String oid); |
| | | |
| | | |
| | | @MapKey("oid") |
| | | List<Map<String,Object>> selectAllLevelParentByOid(@Param("oid") String oid); |
| | | |
| | | |
| | | @MapKey("oid") |
| | | List<Map<String,Object>> selectByFieldPath(@Param("fieldPath") String fieldPath); |
| | | |
| | | } |