瀏覽代碼

Merge remote-tracking branch 'origin/main'

classic_blue 1 月之前
父節點
當前提交
82969dfa8e

+ 9 - 0
edu-travel-common/edu-travel-common-datasource/src/main/java/edu/travel/annotation/LinkConst.java

@@ -7,6 +7,15 @@ import java.lang.annotation.*;
 @Target(ElementType.FIELD)
 @Inherited
 public @interface LinkConst {
+    /**
+     * 字典类
+     * @return
+     */
     Class clazz() ;
+
+    /**
+     * 需要字典翻译字段
+     * @return
+     */
     String fieldName();
 }

+ 14 - 0
edu-travel-common/edu-travel-common-datasource/src/main/java/edu/travel/annotation/LinkMany.java

@@ -9,7 +9,21 @@ import java.lang.annotation.*;
 @Target(ElementType.FIELD)
 @Inherited
 public @interface LinkMany {
+    /**
+     * 主表字段
+     * @return
+     */
     String linkField() ;
+
+    /**
+     * 使用哪个mapper来关联查询
+     * @return
+     */
     Class linkMapper();
+
+    /**
+     * 从表关联字段
+     * @return
+     */
     String linkPrimaryField();
 }

+ 14 - 0
edu-travel-common/edu-travel-common-datasource/src/main/java/edu/travel/annotation/LinkOne.java

@@ -9,7 +9,21 @@ import java.lang.annotation.*;
 @Target(ElementType.FIELD)
 @Inherited
 public @interface LinkOne {
+    /**
+     *  主表关联字段
+     * @return
+     */
     String linkField();
+
+    /**
+     * 使用哪个mapper来关联查询
+     * @return
+     */
     Class linkMapper();
+
+    /**
+     * 从表关联字段
+     * @return
+     */
     String linkPrimaryField();
 }

+ 1 - 2
edu-travel-common/edu-travel-common-datasource/src/main/java/edu/travel/datasource/ProjectInterceptor.java

@@ -33,7 +33,7 @@ public class ProjectInterceptor implements InnerInterceptor {
         String project = request.getHeader("project");
         if (StringUtils.isNotBlank(project)) {
             String originSql = boundSql.getSql();
-            // 获取 Statement 执行sql的对象
+            //获取 Statement 执行sql的对象
             Statement statement = null;
             try {
                 statement = CCJSqlParserUtil.parse(originSql);
@@ -56,7 +56,6 @@ public class ProjectInterceptor implements InnerInterceptor {
                 AndExpression andExpression = new AndExpression(where, projectEq);
                 plainSelect.setWhere(andExpression);
                 targetSql = plainSelect.toString();
-                System.out.println(targetSql);
             }
             // 修改完成的sql 再设置回去
             PluginUtils.MPBoundSql mpBoundSql = PluginUtils.mpBoundSql(boundSql);