Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
1bdf468e
Commit
1bdf468e
authored
Jul 11, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
1d20db5e
af7b4caf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
4 deletions
+71
-4
Controller.java.vm
...fu-codegen/src/main/resources/template/Controller.java.vm
+12
-1
Mapper.java.vm
...l/yifu-codegen/src/main/resources/template/Mapper.java.vm
+6
-1
Mapper.xml.vm
...al/yifu-codegen/src/main/resources/template/Mapper.xml.vm
+38
-0
Service.java.vm
.../yifu-codegen/src/main/resources/template/Service.java.vm
+6
-1
ServiceImpl.java.vm
...u-codegen/src/main/resources/template/ServiceImpl.java.vm
+9
-1
No files found.
yifu-visual/yifu-codegen/src/main/resources/template/Controller.java.vm
View file @
1bdf468e
...
...
@@ -48,7 +48,7 @@ public class ${className}Controller {
private
final
${
className
}
Service
${
classname
}
Service
;
/**
#*
/**
*
分页查询
*
@
param
page
分页对象
*
@
param
${
classname
}
${
comments
}
...
...
@@ -59,6 +59,17 @@ public class ${className}Controller {
//@
PreAuthorize
(
"@pms.hasPermission('${moduleName}_${pathName}_get')"
)
public
R
<
IPage
<${
className
}>>
get
${
className
}
Page
(
Page
page
,
${
className
}
${
classname
})
{
return
R
.
ok
(${
classname
}
Service
.
page
(
page
,
Wrappers
.
query
(${
classname
})));
}*#
/**
*
简单分页查询
*
@
param
page
分页对象
*
@
param
${
classname
}
${
comments
}
*
@
return
*/
@
ApiOperation
(
value
=
"简单分页查询"
)
@
GetMapping
(
"/page"
)
public
R
<
IPage
<${
className
}>>
get
${
className
}
Page
(
Page
<${
className
}>
page
,
${
className
}
${
classname
})
{
return
new
R
<>(${
classname
}
Service
.
get
${
className
}
Page
(
page
,${
classname
}));
}
/**
*
不分页查询
...
...
yifu-visual/yifu-codegen/src/main/resources/template/Mapper.java.vm
View file @
1bdf468e
...
...
@@ -29,5 +29,10 @@ import org.apache.ibatis.annotations.Mapper;
*/
@
Mapper
public
interface
${
className
}
Mapper
extends
BaseMapper
<${
className
}>
{
/**
*
${
comments
}
简单分页查询
*
@
param
${
classname
}
${
comments
}
*
@
return
*/
IPage
<${
className
}>
get
${
className
}
Page
(
Page
<${
className
}>
page
,
@
Param
(
"${classname}"
)
${
className
}
${
classname
});
}
yifu-visual/yifu-codegen/src/main/resources/template/Mapper.xml.vm
View file @
1bdf468e
...
...
@@ -32,4 +32,42 @@
#end
#end
</resultMap>
<sql
id=
"Base_Column_List"
>
#foreach($column in $columns)
#if($foreach.count==$!{columns.size()})
a.${column.columnName}
#else
a.${column.columnName},
#end
#end
</sql>
<sql
id=
"${classname}_where"
>
<if
test=
"${classname} != null"
>
#foreach($column in $columns)
#if($column.attrType=='String')
<if
test=
"${classname}.$column.lowerAttrName != null and ${classname}.${column.lowerAttrName}.trim() != ''"
>
AND a.${column.columnName} = #{${classname}.$column.lowerAttrName}
</if>
#elseif($column.attrType=='char')
<if
test=
"${classname}.$column.lowerAttrName != null and ${classname}.${column.lowerAttrName} != ''"
>
AND a.${column.columnName} = #{${classname}.$column.lowerAttrName}
</if>
#else
<if
test=
"${classname}.$column.lowerAttrName != null"
>
AND a.${column.columnName} = #{${classname}.$column.lowerAttrName}
</if>
#end
#end
</if>
</sql>
<!--${classname}简单分页查询-->
<select
id=
"get${className}Page"
resultMap=
"${classname}Map"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM ${tableName} a
<where>
1=1
<include
refid=
"${classname}_where"
/>
</where>
</select>
</mapper>
yifu-visual/yifu-codegen/src/main/resources/template/Service.java.vm
View file @
1bdf468e
...
...
@@ -27,5 +27,10 @@ import ${package}.${moduleName}.entity.${className};
*
@
date
${
datetime
}
*/
public
interface
${
className
}
Service
extends
IService
<${
className
}>
{
/**
*
${
comments
}
简单分页查询
*
@
param
${
classname
}
${
comments
}
*
@
return
*/
IPage
<${
className
}>
get
${
className
}
Page
(
Page
<${
className
}>
page
,
${
className
}
${
classname
});
}
yifu-visual/yifu-codegen/src/main/resources/template/ServiceImpl.java.vm
View file @
1bdf468e
...
...
@@ -30,5 +30,13 @@ import org.springframework.stereotype.Service;
*/
@
Service
public
class
${
className
}
ServiceImpl
extends
ServiceImpl
<${
className
}
Mapper
,
${
className
}>
implements
${
className
}
Service
{
/**
*
${
comments
}
简单分页查询
*
@
param
${
classname
}
${
comments
}
*
@
return
*/
@
Override
public
IPage
<${
className
}>
get
${
className
}
Page
(
Page
<${
className
}>
page
,
${
className
}
${
classname
}){
return
baseMapper
.
get
${
className
}
Page
(
page
,${
classname
});
}
}
Write
Preview
Markdown
is supported
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