Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Springboot Plus
Commits
4dd5b49f
"src/vscode:/vscode.git/clone" did not exist on "b9b3ac1a3493048ff8d1f688281c6dd7a0ac887d"
Commit
4dd5b49f
authored
Aug 27, 2021
by
闲.大赋
Committed by
Gitee
Aug 27, 2021
Browse files
!40 支持beetlsql3,多数据源
Merge pull request !40 from Andnnl/master
parents
5906a809
dab16bb3
Changes
45
Hide whitespace changes
Inline
Side-by-side
admin-core/src/main/resources/codeTemplate/java/dao.java
View file @
4dd5b49f
package
${
package
};
import
java.util.List
;
import
java.util.Map
;
import
com.ibeetl.admin.core.entity.CoreUser
;
import
org.beetl.sql.mapper.BaseMapper
;
...
...
@@ -9,6 +10,7 @@ import org.beetl.sql.core.page.PageRequest;
import
org.beetl.sql.core.page.PageResult
;
import
org.beetl.sql.mapper.BaseMapper
;
import
org.beetl.sql.mapper.annotation.Root
;
import
org.springframework.stereotype.Component
;
import
${
basePackage
}.
entity
.*;
...
...
@@ -16,6 +18,7 @@ import ${basePackage}.entity.*;
* ${entity.displayName} Dao
*/
\
@SqlResource
(
"${entity.system}.${entity.code}"
)
\
@Component
public
interface
${
entity
.
name
}
Dao
extends
BaseMapper
<
$
{
entity
.
name
}>{
public
PageResult
<
$
{
entity
.
name
}>
queryByCondition
(
PageRequest
request
,
\
@Root
Map
params
);
public
void
batchDel
$
{
entity
.
name
}
ByIds
(
List
<
Long
>
ids
);
...
...
admin-core/src/main/resources/codeTemplate/java/pojo.java
View file @
4dd5b49f
...
...
@@ -6,8 +6,13 @@ import javax.validation.constraints.NotBlank;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Null
;
import
org.beetl.sql.core.annotatoin.AutoID
;
import
org.beetl.sql.core.annotatoin.SeqID
;
import
com.ibeetl.admin.core.entity.BaseEntity
;
import
com.ibeetl.admin.core.util.ValidateConfig
;
import
org.beetl.sql.annotation.entity.AutoID
;
import
org.beetl.sql.annotation.entity.SeqID
;
import
org.beetl.sql.annotation.entity.InsertIgnore
;
import
org.beetl.sql.annotation.entity.UpdateIgnore
;
import
com.ibeetl.admin.core.util.ValidateConfig
;
...
...
@@ -17,9 +22,7 @@ import java.math.*;
import
com.ibeetl.admin.core.annotation.Dict
;
import
com.ibeetl.admin.core.entity.BaseEntity
;
import
org.beetl.sql.core.annotatoin.InsertIgnore
;
import
org.beetl.sql.core.annotatoin.Version
;
import
org.beetl.sql.core.annotatoin.LogicDelete
;
/*
...
...
@@ -34,7 +37,7 @@ public class ${className} extends BaseEntity{
@
}
@if
(
attr
.
isId
)
{
\
@NotNull
(
message
=
"ID不能为空"
,
groups
=
ValidateConfig
.
UPDATE
.
class
)
\
@SeqID
(
name
=
ORACLE_CORE_SEQ_NAME
)
//
\@SeqID(name = ORACLE_CORE_SEQ_NAME)
\
@AutoID
@
}
@if
(
isNotEmpty
(
attr
.
dictType
))
{
...
...
admin-core/src/main/resources/codeTemplate/java/query.java
View file @
4dd5b49f
...
...
@@ -17,12 +17,16 @@ public class ${entity.name}Query extends PageParam {
@
}
else
if
(
attr
.
dateRange
)
{
\
@Query
(
name
=
"${attr.displayName}"
,
display
=
true
,
type
=
Query
.
TYPE_DATE_BETWEEN
)
private
String
$
{
attr
.
name
};
\
@Query
(
name
=
"${attr.displayName}"
,
display
=
false
)
private
Date
$
{
strutil
.
replace
(
attr
.
name
,
"Range"
,
""
)}
Start
;
\
@Query
(
name
=
"${attr.displayName}"
,
display
=
false
)
private
Date
$
{
strutil
.
replace
(
attr
.
name
,
"Range"
,
""
)}
End
;
@
}
else
if
(
attr
.
dateTimeRange
)
{
\
@Query
(
name
=
"${attr.displayName}"
,
display
=
true
,
type
=
Query
.
TYPE_DATETIME_BETWEEN
)
private
String
$
{
attr
.
name
};
\
@Query
(
name
=
"${attr.displayName}"
,
display
=
false
)
private
Date
$
{
strutil
.
replace
(
attr
.
name
,
"Range"
,
""
)}
Start
;
\
@Query
(
name
=
"${attr.displayName}"
,
display
=
false
)
private
Date
$
{
strutil
.
replace
(
attr
.
name
,
"Range"
,
""
)}
End
;
@
}
else
{
\
@Query
(
name
=
"${attr.displayName}"
,
display
=
true
)
...
...
@@ -31,6 +35,7 @@ public class ${entity.name}Query extends PageParam {
@
}
@for
(
attr
in
attrs
)
{
@if
(
attr
.
dateRange
)
{
public
String
get
$
{
upperFirst
(
attr
.
name
)}(){
return
$
{
attr
.
name
};
}
...
...
admin-core/src/main/resources/codeTemplate/java/service.java
View file @
4dd5b49f
...
...
@@ -3,7 +3,7 @@ package ${package};
import
${
basePackage
}.
dao
.
$
{
entity
.
name
}
Dao
;
import
${
basePackage
}.
entity
.
$
{
entity
.
name
};
import
${
basePackage
}.
web
.
query
.
$
{
entity
.
name
}
Query
;
import
com.ibeetl.admin.core.service.CoreBaseService
;
...
...
@@ -13,7 +13,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
import
java.util.Map
;
import
org.beetl.sql.core.page.PageRequest
;
import
org.beetl.sql.core.page.PageResult
;
...
...
@@ -29,8 +31,16 @@ public class ${entity.name}Service extends CoreBaseService<${entity.name}>{
\
@Autowired
private
$
{
entity
.
name
}
Dao
$
{
entity
.
code
}
Dao
;
public
PageQuery
<
$
{
entity
.
name
}>
queryByCondition
(
PageQuery
query
){
PageQuery
ret
=
$
{
entity
.
code
}
Dao
.
queryByCondition
(
query
);
// public PageQuery<${entity.name}>queryByCondition(PageQuery query){
// PageQuery ret = ${entity.code}Dao.queryByCondition(query);
// queryListAfter(ret.getList());
// return ret;
// }
public
PageResult
<
$
{
entity
.
name
}>
queryByCondition
(
$
{
entity
.
name
}
Query
condition
)
{
PageRequest
pageRequest
=
condition
.
getPageRequest
();
Map
params
=
condition
.
getPageParam
();
PageResult
ret
=
$
{
entity
.
code
}
Dao
.
queryByCondition
(
pageRequest
,
params
);
queryListAfter
(
ret
.
getList
());
return
ret
;
}
...
...
pom.xml
View file @
4dd5b49f
...
...
@@ -51,6 +51,23 @@
<parameters>
true
</parameters>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-source-plugin
</artifactId>
<version>
3.0.0
</version>
<!-- 绑定source插件到Maven的生命周期,并在生命周期后执行绑定的source的goal -->
<executions>
<execution>
<!-- 绑定source插件到Maven的生命周期 -->
<phase>
compile
</phase>
<!--在生命周期后执行绑定的source插件的goals -->
<goals>
<goal>
jar-no-fork
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment