|
@@ -7,6 +7,7 @@ import org.junit.jupiter.api.Test;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -40,6 +41,16 @@ public class StructureMapperTests {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
|
|
+ void deleteByIds() {
|
|
|
|
+ ArrayList<Integer> ids = new ArrayList<>();
|
|
|
|
+ ids.add(55);
|
|
|
|
+ ids.add(56);
|
|
|
|
+ ids.add(57);
|
|
|
|
+ int rows = structureMapper.deleteByIds(ids);
|
|
|
|
+ log.info("根据id批量删除数据完成,受影响的行数为:{}", rows);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Test
|
|
void update() {
|
|
void update() {
|
|
Structure structure = new Structure()
|
|
Structure structure = new Structure()
|
|
.setParentId(0)
|
|
.setParentId(0)
|
|
@@ -53,7 +64,7 @@ public class StructureMapperTests {
|
|
|
|
|
|
@Test
|
|
@Test
|
|
void countByparentIdAndStructureName() {
|
|
void countByparentIdAndStructureName() {
|
|
- int count = structureMapper.countByparentIdAndStructureName(0, "手机后壳");
|
|
|
|
|
|
+ int count = structureMapper.countByparentIdAndStructureName(0, "手机后壳", null);
|
|
log.info("根据名称统计数量完成,数量为:{}", count);
|
|
log.info("根据名称统计数量完成,数量为:{}", count);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -65,7 +76,7 @@ public class StructureMapperTests {
|
|
|
|
|
|
@Test
|
|
@Test
|
|
void selectByParentId() {
|
|
void selectByParentId() {
|
|
- List<StructureVO> structureVOs = structureMapper.selectByParentId(3);
|
|
|
|
|
|
+ List<StructureVO> structureVOs = structureMapper.selectByParentIdAndProductId(3, 0);
|
|
log.info("根据父级id查询子级架构完成,数据信息为:");
|
|
log.info("根据父级id查询子级架构完成,数据信息为:");
|
|
for (StructureVO structureVO : structureVOs) {
|
|
for (StructureVO structureVO : structureVOs) {
|
|
log.info("{}", structureVO);
|
|
log.info("{}", structureVO);
|
|
@@ -73,10 +84,10 @@ public class StructureMapperTests {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
- void selectByProductId() {
|
|
|
|
- List<StructureVO> structureVOs = structureMapper.selectByProductId(22);
|
|
|
|
- log.info("根据产品id查询数据完成,数据信息为:");
|
|
|
|
- for (StructureVO structureVO : structureVOs) {
|
|
|
|
|
|
+ void selectByFindInSetPath() {
|
|
|
|
+ List<StructureVO> queryResults = structureMapper.selectByFindInSetPath("0");
|
|
|
|
+ log.info("根据模糊路径查询数据完成,数据信息为:");
|
|
|
|
+ for (StructureVO structureVO : queryResults) {
|
|
log.info("{}", structureVO);
|
|
log.info("{}", structureVO);
|
|
}
|
|
}
|
|
}
|
|
}
|