修改注解名称

This commit is contained in:
yulichang 2023-05-10 16:08:26 +08:00
parent df769aa863
commit ef520f3944
5 changed files with 10 additions and 12 deletions

View File

@ -8,7 +8,7 @@ package com.github.yulichang.annotation;
* @since 1.2.0 * @since 1.2.0
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")
public @interface MPJMappingApply { public @interface Apply {
/** /**
* sql片段 * sql片段

View File

@ -10,7 +10,7 @@ import com.github.yulichang.annotation.enums.SqlKeyword;
* @since 1.2.0 * @since 1.2.0
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")
public @interface MPJMappingCondition { public @interface Condition {
/** /**
* 条件枚举 * 条件枚举

View File

@ -57,12 +57,12 @@ public @interface EntityMapping {
* 映射表查询条件之 apply<br/> * 映射表查询条件之 apply<br/>
* 等效于 Wrappers.<T>query().apply(xxx); * 等效于 Wrappers.<T>query().apply(xxx);
*/ */
MPJMappingApply[] apply() default {}; Apply[] apply() default {};
/** /**
* 映射表查询条件 * 映射表查询条件
*/ */
MPJMappingCondition[] condition() default {}; Condition[] condition() default {};
/** /**
* 映射表查询条件之 orderBy<br/> * 映射表查询条件之 orderBy<br/>

View File

@ -55,12 +55,12 @@ public @interface FieldMapping {
* 映射表查询条件之 apply<br/> * 映射表查询条件之 apply<br/>
* 等效于 Wrappers.<T>query().apply(xxx); * 等效于 Wrappers.<T>query().apply(xxx);
*/ */
MPJMappingApply[] apply() default {}; Apply[] apply() default {};
/** /**
* 映射表查询条件 * 映射表查询条件
*/ */
MPJMappingCondition[] condition() default {}; Condition[] condition() default {};
/** /**
* 映射表查询条件之 orderBy<br/> * 映射表查询条件之 orderBy<br/>

View File

@ -4,8 +4,6 @@ package com.github.yulichang.extension.mapping.mapper;
import com.baomidou.mybatisplus.core.enums.SqlKeyword; import com.baomidou.mybatisplus.core.enums.SqlKeyword;
import com.baomidou.mybatisplus.core.toolkit.StringPool; import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.github.yulichang.annotation.MPJMappingApply;
import com.github.yulichang.annotation.MPJMappingCondition;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@ -44,8 +42,8 @@ public class MPJMappingWrapper {
private final boolean hasOrderByDesc; private final boolean hasOrderByDesc;
private List<String> orderByDesc; private List<String> orderByDesc;
public MPJMappingWrapper(String first, String select, MPJMappingApply[] applys, public MPJMappingWrapper(String first, String select, com.github.yulichang.annotation.Apply[] applys,
MPJMappingCondition[] conditions, String last, String orderByAsc, String orderByDesc) { com.github.yulichang.annotation.Condition[] conditions, String last, String orderByAsc, String orderByDesc) {
this.hasFirst = StringUtils.isNotBlank(first); this.hasFirst = StringUtils.isNotBlank(first);
if (this.hasFirst) { if (this.hasFirst) {
this.first = first; this.first = first;
@ -59,7 +57,7 @@ public class MPJMappingWrapper {
this.hasApply = applys.length > 0; this.hasApply = applys.length > 0;
if (this.hasApply) { if (this.hasApply) {
this.applyList = new ArrayList<>(); this.applyList = new ArrayList<>();
for (MPJMappingApply apply : applys) { for (com.github.yulichang.annotation.Apply apply : applys) {
this.applyList.add(new Apply(apply.value(), apply.args())); this.applyList.add(new Apply(apply.value(), apply.args()));
} }
} }
@ -67,7 +65,7 @@ public class MPJMappingWrapper {
this.hasCondition = conditions.length > 0; this.hasCondition = conditions.length > 0;
if (this.hasCondition) { if (this.hasCondition) {
this.conditionList = new ArrayList<>(); this.conditionList = new ArrayList<>();
for (MPJMappingCondition condition : conditions) { for (com.github.yulichang.annotation.Condition condition : conditions) {
conditionList.add(new Condition(convert(condition.keyWord()), condition.column(), condition.value())); conditionList.add(new Condition(convert(condition.keyWord()), condition.column(), condition.value()));
} }
} }