|
|
@@ -1,356 +1,199 @@
|
|
|
package com.ruoyi;
|
|
|
|
|
|
-import com.agentsflex.chain.node.JsExecNode;
|
|
|
-import com.agentsflex.core.chain.Chain;
|
|
|
-import org.jasypt.encryption.StringEncryptor;
|
|
|
-import org.junit.jupiter.api.Test;
|
|
|
-import org.slf4j.Logger;
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
+import com.ruoyi.model.dpp.dal.dataobject.etl.DppEtlTaskDO;
|
|
|
+import com.ruoyi.model.etl.mapper.DppEtlTaskMapper;
|
|
|
+import com.ruoyi.model.etl.mapper.TestDppEtlTaskMapper;
|
|
|
+import org.junit.Test;
|
|
|
+import org.junit.runner.RunWith;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
-import org.springframework.test.context.TestPropertySource;
|
|
|
+import org.springframework.context.ApplicationContext;
|
|
|
+import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
-@SpringBootTest(classes = RuoYiApplication.class)
|
|
|
-@TestPropertySource(properties = {"spring.profiles.active=druid"})
|
|
|
+import static org.junit.jupiter.api.Assertions.assertNotNull;
|
|
|
+
|
|
|
+
|
|
|
+@SpringBootTest(classes = RuoYiApplication.class,webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
|
|
+@RunWith(SpringRunner.class)
|
|
|
public class JasyptTest {
|
|
|
- private static final Logger log = LoggerFactory.getLogger(JasyptTest.class);
|
|
|
+
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void comprehensiveDiagnosis() {
|
|
|
+ System.out.println("=== 全面诊断 MyBatis-Plus Join 问题 ===");
|
|
|
+
|
|
|
+ // 1. 检查上下文
|
|
|
+ assertNotNull(applicationContext);
|
|
|
+
|
|
|
+ // 2. 检查 Mapper 注入
|
|
|
+ assertNotNull(dppEtlTaskMapper);
|
|
|
+ System.out.println("✅ Mapper 注入成功");
|
|
|
+
|
|
|
+ // 3. 检查 BaseMapperX 继承
|
|
|
+ testBaseMapperXInheritance();
|
|
|
+
|
|
|
+ // 4. 检查 MyBatis-Plus Join 配置
|
|
|
+ checkMyBatisPlusJoinAutoConfiguration();
|
|
|
+
|
|
|
+ // 5. 测试其他 MPJ 方法(如果 selectJoinPage 不行)
|
|
|
+ testOtherMPJMethods();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void testOtherMPJMethods() {
|
|
|
+ System.out.println("=== 测试其他 MyBatis-Plus Join 方法 ===");
|
|
|
+
|
|
|
+ MPJLambdaWrapper<DppEtlTaskDO> wrapper = new MPJLambdaWrapper<>();
|
|
|
+ wrapper.eq(DppEtlTaskDO::getDelFlag, "0");
|
|
|
+
|
|
|
+ // 测试 selectJoinList
|
|
|
+ try {
|
|
|
+ List<DppEtlTaskDO> result = dppEtlTaskMapper.selectJoinList(DppEtlTaskDO.class, wrapper);
|
|
|
+ System.out.println("✅ selectJoinList 工作正常,结果数量: " + result.size());
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println("❌ selectJoinList 也失败: " + e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 测试 selectJoinOne
|
|
|
+ try {
|
|
|
+ DppEtlTaskDO result = dppEtlTaskMapper.selectJoinOne(DppEtlTaskDO.class, wrapper);
|
|
|
+ System.out.println("✅ selectJoinOne 工作正常");
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println("❌ selectJoinOne 失败: " + e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void checkMyBatisPlusJoinAutoConfiguration() {
|
|
|
+ System.out.println("=== 检查 MyBatis-Plus Join 自动配置 ===");
|
|
|
+
|
|
|
+ try {
|
|
|
+ // 检查 MPJInterceptor 是否存在
|
|
|
+ Object mpjInterceptor = applicationContext.getBean("mpjInterceptor");
|
|
|
+ System.out.println("✅ MPJInterceptor 存在: " + mpjInterceptor.getClass().getName());
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println("❌ MPJInterceptor 不存在: " + e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 检查 MyBatis-Plus Join 相关的 Bean
|
|
|
+ String[] beanNames = applicationContext.getBeanNamesForType(com.github.yulichang.interceptor.MPJInterceptor.class);
|
|
|
+ System.out.println("找到的 MPJInterceptor Beans: " + Arrays.toString(beanNames));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testBaseMapperXInheritance() {
|
|
|
+ System.out.println("=== 验证 BaseMapperX 继承关系 ===");
|
|
|
+
|
|
|
+ // 检查 Mapper 的实际类型
|
|
|
+ Class<?> mapperClass = dppEtlTaskMapper.getClass();
|
|
|
+ System.out.println("Mapper 实际类: " + mapperClass.getName());
|
|
|
+
|
|
|
+ // 检查实现的接口
|
|
|
+ Class<?>[] interfaces = mapperClass.getInterfaces();
|
|
|
+ for (Class<?> iface : interfaces) {
|
|
|
+ System.out.println("实现的接口: " + iface.getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 检查是否是 MPJBaseMapper 的实例
|
|
|
+ boolean isMPJBaseMapper = dppEtlTaskMapper instanceof com.github.yulichang.base.MPJBaseMapper;
|
|
|
+ System.out.println("是否是 MPJBaseMapper 实例: " + isMPJBaseMapper);
|
|
|
+
|
|
|
+ // 尝试通过反射查看方法
|
|
|
+ try {
|
|
|
+ java.lang.reflect.Method method = dppEtlTaskMapper.getClass().getMethod("selectJoinPage",
|
|
|
+ com.baomidou.mybatisplus.core.metadata.IPage.class, Class.class, com.github.yulichang.wrapper.MPJLambdaWrapper.class);
|
|
|
+ System.out.println("找到 selectJoinPage 方法: " + method);
|
|
|
+ } catch (NoSuchMethodException e) {
|
|
|
+ System.out.println("未找到 selectJoinPage 方法");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired(required = false) // 设置为非必需,避免启动失败
|
|
|
+ private TestDppEtlTaskMapper dppEtlTaskMapper;
|
|
|
+
|
|
|
@Autowired
|
|
|
- private StringEncryptor stringEncryptor;
|
|
|
+ private ApplicationContext applicationContext;
|
|
|
|
|
|
@Test
|
|
|
- public void encryptPwd() {
|
|
|
-
|
|
|
- String code = "{\n" +
|
|
|
- " \"edges\": [\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"g1MbfnZ5Gwb90H8H\",\n" +
|
|
|
- " \"source\": \"node_ncZomj9VYJSr3P3V\",\n" +
|
|
|
- " \"target\": \"node_6ajjEYlMDPcYl3ae\",\n" +
|
|
|
- " \"selected\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"jC3w6Thci7Ua8tFO\",\n" +
|
|
|
- " \"source\": \"U6DteBZHGQfaBvpP\",\n" +
|
|
|
- " \"target\": \"node_6ajjEYlMDPcYl3ae\",\n" +
|
|
|
- " \"selected\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"LY9hCUFEEqq0AoZl\",\n" +
|
|
|
- " \"source\": \"ucHhhciLB2U9snEM\",\n" +
|
|
|
- " \"target\": \"node_6ajjEYlMDPcYl3ae\",\n" +
|
|
|
- " \"selected\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"EIOzuvcuPaD4k9tb\",\n" +
|
|
|
- " \"source\": \"node_B3Lz55SHHuTTE3TC\",\n" +
|
|
|
- " \"target\": \"node_ncZomj9VYJSr3P3V\",\n" +
|
|
|
- " \"selected\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"t68rwPo1Q8UFcRZc\",\n" +
|
|
|
- " \"source\": \"node_1z5lKKFYhSYjDyKI\",\n" +
|
|
|
- " \"target\": \"node_B3Lz55SHHuTTE3TC\",\n" +
|
|
|
- " \"selected\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"M11hEF6ug1Wb79XB\",\n" +
|
|
|
- " \"source\": \"node_B3Lz55SHHuTTE3TC\",\n" +
|
|
|
- " \"target\": \"U6DteBZHGQfaBvpP\",\n" +
|
|
|
- " \"selected\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"6mL3Q2RAiHqiCkHm\",\n" +
|
|
|
- " \"source\": \"node_B3Lz55SHHuTTE3TC\",\n" +
|
|
|
- " \"target\": \"ucHhhciLB2U9snEM\",\n" +
|
|
|
- " \"selected\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"L8v1pqEBUdeqsk1e\",\n" +
|
|
|
- " \"source\": \"node_6ajjEYlMDPcYl3ae\",\n" +
|
|
|
- " \"target\": \"node_tciO7KE86u6PHgKr\"\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"aO2ayu7f6CkuKs0r\",\n" +
|
|
|
- " \"source\": \"node_tciO7KE86u6PHgKr\",\n" +
|
|
|
- " \"target\": \"node_At2IIxQgEILAOu4n\"\n" +
|
|
|
- " }\n" +
|
|
|
- " ],\n" +
|
|
|
- " \"nodes\": [\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"node_1z5lKKFYhSYjDyKI\",\n" +
|
|
|
- " \"data\": {\n" +
|
|
|
- " \"title\": \"开始节点\",\n" +
|
|
|
- " \"description\": \"开始定义输入参数\"\n" +
|
|
|
- " },\n" +
|
|
|
- " \"type\": \"startNode\",\n" +
|
|
|
- " \"dragging\": false,\n" +
|
|
|
- " \"measured\": {\n" +
|
|
|
- " \"width\": 306,\n" +
|
|
|
- " \"height\": 88\n" +
|
|
|
- " },\n" +
|
|
|
- " \"position\": {\n" +
|
|
|
- " \"x\": -547.0868680833916,\n" +
|
|
|
- " \"y\": 137.4465838737692\n" +
|
|
|
- " },\n" +
|
|
|
- " \"selected\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"node_ncZomj9VYJSr3P3V\",\n" +
|
|
|
- " \"data\": {\n" +
|
|
|
- " \"title\": \"获取雨量数据\",\n" +
|
|
|
- " \"expand\": false,\n" +
|
|
|
- " \"method\": \"get\",\n" +
|
|
|
- " \"outputDefs\": [\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"1tTsWjENoLfB4JJa\",\n" +
|
|
|
- " \"name\": \"headers\",\n" +
|
|
|
- " \"refType\": \"ref\",\n" +
|
|
|
- " \"dataType\": \"Object\",\n" +
|
|
|
- " \"nameDisabled\": true,\n" +
|
|
|
- " \"deleteDisabled\": true,\n" +
|
|
|
- " \"dataTypeDisabled\": true\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"9OP5JjlkBqARboVZ\",\n" +
|
|
|
- " \"name\": \"body\",\n" +
|
|
|
- " \"refType\": \"ref\",\n" +
|
|
|
- " \"dataType\": \"String\",\n" +
|
|
|
- " \"nameDisabled\": true,\n" +
|
|
|
- " \"deleteDisabled\": true\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"94bsldmZ4cbcx7Or\",\n" +
|
|
|
- " \"name\": \"statusCode\",\n" +
|
|
|
- " \"refType\": \"ref\",\n" +
|
|
|
- " \"dataType\": \"Number\",\n" +
|
|
|
- " \"nameDisabled\": true,\n" +
|
|
|
- " \"deleteDisabled\": true,\n" +
|
|
|
- " \"dataTypeDisabled\": true\n" +
|
|
|
- " }\n" +
|
|
|
- " ],\n" +
|
|
|
- " \"parameters\": [\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"xscx2BZ3xAx8FBdB\",\n" +
|
|
|
- " \"name\": \"STCD\",\n" +
|
|
|
- " \"refType\": \"ref\",\n" +
|
|
|
- " \"dataType\": \"String\"\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"tvzDXYZDpPHuCm1b\",\n" +
|
|
|
- " \"name\": \"\",\n" +
|
|
|
- " \"refType\": \"ref\",\n" +
|
|
|
- " \"dataType\": \"String\"\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"jGFiQp0F47cfUODL\",\n" +
|
|
|
- " \"name\": \"\",\n" +
|
|
|
- " \"refType\": \"ref\",\n" +
|
|
|
- " \"dataType\": \"String\"\n" +
|
|
|
- " }\n" +
|
|
|
- " ],\n" +
|
|
|
- " \"description\": \"通过 HTTP 请求获取数据\"\n" +
|
|
|
- " },\n" +
|
|
|
- " \"type\": \"httpNode\",\n" +
|
|
|
- " \"dragging\": false,\n" +
|
|
|
- " \"measured\": {\n" +
|
|
|
- " \"width\": 306,\n" +
|
|
|
- " \"height\": 88\n" +
|
|
|
- " },\n" +
|
|
|
- " \"position\": {\n" +
|
|
|
- " \"x\": 392.078125,\n" +
|
|
|
- " \"y\": 34.671875\n" +
|
|
|
- " },\n" +
|
|
|
- " \"selected\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"U6DteBZHGQfaBvpP\",\n" +
|
|
|
- " \"data\": {\n" +
|
|
|
- " \"title\": \"获取水位数据\",\n" +
|
|
|
- " \"expand\": false,\n" +
|
|
|
- " \"method\": \"get\",\n" +
|
|
|
- " \"outputDefs\": [\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"1tTsWjENoLfB4JJa\",\n" +
|
|
|
- " \"name\": \"headers\",\n" +
|
|
|
- " \"refType\": \"ref\",\n" +
|
|
|
- " \"dataType\": \"Object\",\n" +
|
|
|
- " \"nameDisabled\": true,\n" +
|
|
|
- " \"deleteDisabled\": true,\n" +
|
|
|
- " \"dataTypeDisabled\": true\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"9OP5JjlkBqARboVZ\",\n" +
|
|
|
- " \"name\": \"body\",\n" +
|
|
|
- " \"refType\": \"ref\",\n" +
|
|
|
- " \"dataType\": \"String\",\n" +
|
|
|
- " \"nameDisabled\": true,\n" +
|
|
|
- " \"deleteDisabled\": true\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"94bsldmZ4cbcx7Or\",\n" +
|
|
|
- " \"name\": \"statusCode\",\n" +
|
|
|
- " \"refType\": \"ref\",\n" +
|
|
|
- " \"dataType\": \"Number\",\n" +
|
|
|
- " \"nameDisabled\": true,\n" +
|
|
|
- " \"deleteDisabled\": true,\n" +
|
|
|
- " \"dataTypeDisabled\": true\n" +
|
|
|
- " }\n" +
|
|
|
- " ],\n" +
|
|
|
- " \"description\": \"通过 HTTP 请求获取数据\"\n" +
|
|
|
- " },\n" +
|
|
|
- " \"type\": \"httpNode\",\n" +
|
|
|
- " \"dragging\": false,\n" +
|
|
|
- " \"measured\": {\n" +
|
|
|
- " \"width\": 306,\n" +
|
|
|
- " \"height\": 88\n" +
|
|
|
- " },\n" +
|
|
|
- " \"position\": {\n" +
|
|
|
- " \"x\": 390.078125,\n" +
|
|
|
- " \"y\": 154.671875\n" +
|
|
|
- " },\n" +
|
|
|
- " \"selected\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"ucHhhciLB2U9snEM\",\n" +
|
|
|
- " \"data\": {\n" +
|
|
|
- " \"title\": \"获取气象数据\",\n" +
|
|
|
- " \"method\": \"get\",\n" +
|
|
|
- " \"outputDefs\": [\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"1tTsWjENoLfB4JJa\",\n" +
|
|
|
- " \"name\": \"headers\",\n" +
|
|
|
- " \"refType\": \"ref\",\n" +
|
|
|
- " \"dataType\": \"Object\",\n" +
|
|
|
- " \"nameDisabled\": true,\n" +
|
|
|
- " \"deleteDisabled\": true,\n" +
|
|
|
- " \"dataTypeDisabled\": true\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"9OP5JjlkBqARboVZ\",\n" +
|
|
|
- " \"name\": \"body\",\n" +
|
|
|
- " \"refType\": \"ref\",\n" +
|
|
|
- " \"dataType\": \"String\",\n" +
|
|
|
- " \"nameDisabled\": true,\n" +
|
|
|
- " \"deleteDisabled\": true\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"94bsldmZ4cbcx7Or\",\n" +
|
|
|
- " \"name\": \"statusCode\",\n" +
|
|
|
- " \"refType\": \"ref\",\n" +
|
|
|
- " \"dataType\": \"Number\",\n" +
|
|
|
- " \"nameDisabled\": true,\n" +
|
|
|
- " \"deleteDisabled\": true,\n" +
|
|
|
- " \"dataTypeDisabled\": true\n" +
|
|
|
- " }\n" +
|
|
|
- " ],\n" +
|
|
|
- " \"description\": \"通过 HTTP 请求获取数据\"\n" +
|
|
|
- " },\n" +
|
|
|
- " \"type\": \"httpNode\",\n" +
|
|
|
- " \"dragging\": false,\n" +
|
|
|
- " \"measured\": {\n" +
|
|
|
- " \"width\": 306,\n" +
|
|
|
- " \"height\": 88\n" +
|
|
|
- " },\n" +
|
|
|
- " \"position\": {\n" +
|
|
|
- " \"x\": 390.078125,\n" +
|
|
|
- " \"y\": 268.671875\n" +
|
|
|
- " },\n" +
|
|
|
- " \"selected\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"node_6ajjEYlMDPcYl3ae\",\n" +
|
|
|
- " \"data\": {\n" +
|
|
|
- " \"title\": \"模型计算\",\n" +
|
|
|
- " \"expand\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " \"type\": \"task-node\",\n" +
|
|
|
- " \"dragging\": false,\n" +
|
|
|
- " \"measured\": {\n" +
|
|
|
- " \"width\": 306,\n" +
|
|
|
- " \"height\": 88\n" +
|
|
|
- " },\n" +
|
|
|
- " \"position\": {\n" +
|
|
|
- " \"x\": 866.148775304685,\n" +
|
|
|
- " \"y\": 134.94990664309157\n" +
|
|
|
- " },\n" +
|
|
|
- " \"selected\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"node_At2IIxQgEILAOu4n\",\n" +
|
|
|
- " \"data\": {\n" +
|
|
|
- " \"title\": \"图表节点\",\n" +
|
|
|
- " \"expand\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " \"type\": \"chart-node\",\n" +
|
|
|
- " \"dragging\": false,\n" +
|
|
|
- " \"measured\": {\n" +
|
|
|
- " \"width\": 306,\n" +
|
|
|
- " \"height\": 88\n" +
|
|
|
- " },\n" +
|
|
|
- " \"position\": {\n" +
|
|
|
- " \"x\": 1707.2668779489672,\n" +
|
|
|
- " \"y\": 134.90843037541023\n" +
|
|
|
- " },\n" +
|
|
|
- " \"selected\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"node_B3Lz55SHHuTTE3TC\",\n" +
|
|
|
- " \"data\": {\n" +
|
|
|
- " \"title\": \"新建方案\"\n" +
|
|
|
- " },\n" +
|
|
|
- " \"type\": \"task-node\",\n" +
|
|
|
- " \"dragging\": false,\n" +
|
|
|
- " \"measured\": {\n" +
|
|
|
- " \"width\": 306,\n" +
|
|
|
- " \"height\": 88\n" +
|
|
|
- " },\n" +
|
|
|
- " \"position\": {\n" +
|
|
|
- " \"x\": -124.87829206235932,\n" +
|
|
|
- " \"y\": 142.06519629483878\n" +
|
|
|
- " },\n" +
|
|
|
- " \"selected\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " {\n" +
|
|
|
- " \"id\": \"node_tciO7KE86u6PHgKr\",\n" +
|
|
|
- " \"data\": {\n" +
|
|
|
- " \"title\": \"输出结果\",\n" +
|
|
|
- " \"expand\": false\n" +
|
|
|
- " },\n" +
|
|
|
- " \"type\": \"task-node\",\n" +
|
|
|
- " \"dragging\": false,\n" +
|
|
|
- " \"measured\": {\n" +
|
|
|
- " \"width\": 306,\n" +
|
|
|
- " \"height\": 88\n" +
|
|
|
- " },\n" +
|
|
|
- " \"position\": {\n" +
|
|
|
- " \"x\": 1291.991164789477,\n" +
|
|
|
- " \"y\": 134.31405390092667\n" +
|
|
|
- " },\n" +
|
|
|
- " \"selected\": false\n" +
|
|
|
- " }\n" +
|
|
|
- " ],\n" +
|
|
|
- " \"viewport\": {\n" +
|
|
|
- " \"x\": 830.8418078373795,\n" +
|
|
|
- " \"y\": 130.69047266353977,\n" +
|
|
|
- " \"zoom\": 1.741101126592249\n" +
|
|
|
- " }\n" +
|
|
|
- "}";
|
|
|
-
|
|
|
- Chain chain = new Chain();
|
|
|
-
|
|
|
- JsExecNode a = new JsExecNode();
|
|
|
- a.setCode(code);
|
|
|
- a.setId("a");
|
|
|
-// a.setCode(code);
|
|
|
- chain.addNode(a);
|
|
|
-
|
|
|
- Map<String, Object> result = chain.executeForResult(new HashMap<>());
|
|
|
- System.out.println(result.getClass());
|
|
|
- System.out.println(result);
|
|
|
+ public void testMyBatisPlusJoinConfiguration() {
|
|
|
+ System.out.println("=== 开始诊断 Mapper 注入问题 ===");
|
|
|
+
|
|
|
+ // 检查 ApplicationContext 是否正常
|
|
|
+ System.out.println("ApplicationContext: " + (applicationContext != null ? "正常" : "null"));
|
|
|
+
|
|
|
+ // 检查所有 Bean
|
|
|
+ String[] beanNames = applicationContext.getBeanDefinitionNames();
|
|
|
+ boolean foundMapper = false;
|
|
|
+ for (String beanName : beanNames) {
|
|
|
+ if (beanName.toLowerCase().contains("dppetltaskmapper") ||
|
|
|
+ beanName.contains("DppEtlTaskMapper")) {
|
|
|
+ System.out.println("找到 Mapper Bean: " + beanName);
|
|
|
+ foundMapper = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!foundMapper) {
|
|
|
+ System.out.println("未找到 DppEtlTaskMapper Bean");
|
|
|
+ // 检查所有 Mapper 类型的 Bean
|
|
|
+ try {
|
|
|
+ Map<String, Object> mappers = applicationContext.getBeansWithAnnotation(org.apache.ibatis.annotations.Mapper.class);
|
|
|
+ System.out.println("找到的 Mapper Beans: " + mappers.keySet());
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println("获取 Mapper Beans 时出错: " + e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 检查 Mapper 是否注入
|
|
|
+ if (dppEtlTaskMapper == null) {
|
|
|
+ System.out.println("❌ DppEtlTaskMapper 注入失败");
|
|
|
+ // 尝试手动获取
|
|
|
+ try {
|
|
|
+ TestDppEtlTaskMapper mapper = applicationContext.getBean(TestDppEtlTaskMapper.class);
|
|
|
+ System.out.println("✅ 通过 ApplicationContext 获取 Mapper 成功");
|
|
|
+ dppEtlTaskMapper = mapper;
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println("❌ 通过 ApplicationContext 获取 Mapper 也失败: " + e.getMessage());
|
|
|
+ return; // 如果获取不到,直接返回
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ System.out.println("✅ DppEtlTaskMapper 注入成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果 Mapper 存在,继续测试
|
|
|
+ if (dppEtlTaskMapper != null) {
|
|
|
+ testSelectJoinPage();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ private void testSelectJoinPage() {
|
|
|
+ System.out.println("=== 开始测试 selectJoinPage 方法 ===");
|
|
|
+
|
|
|
+ MPJLambdaWrapper<DppEtlTaskDO> wrapper = new MPJLambdaWrapper<>();
|
|
|
+ wrapper.eq(DppEtlTaskDO::getDelFlag, "0");
|
|
|
+
|
|
|
+ try {
|
|
|
+ IPage<DppEtlTaskDO> result = dppEtlTaskMapper.selectJoinPage(
|
|
|
+ new Page<>(1, 5),
|
|
|
+ DppEtlTaskDO.class,
|
|
|
+ wrapper
|
|
|
+ );
|
|
|
+ System.out.println("✅ MyBatis-Plus Join 工作正常!");
|
|
|
+ System.out.println("查询到 " + result.getRecords().size() + " 条记录");
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println("❌ MyBatis-Plus Join 配置有问题: " + e.getMessage());
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|