Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv-springboot
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bsoft
sv-springboot
Commits
bce74232
Commit
bce74232
authored
Nov 04, 2019
by
Suvalue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
指标查询页面以及接口
parent
79c20ae4
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
106 additions
and
18 deletions
+106
-18
bsoft-api/src/main/java/com/bsoft/api/controller/IndController.java
+8
-6
bsoft-api/src/main/java/com/bsoft/api/mapper/DicIndMapper.java
+5
-0
bsoft-api/src/main/java/com/bsoft/api/model/DicInd.java
+10
-0
bsoft-api/src/main/java/com/bsoft/api/service/DicIndService.java
+3
-0
bsoft-api/src/main/java/com/bsoft/api/service/Impl/DicIndServiceImpl.java
+7
-0
bsoft-api/src/main/resources/mapper/DicIndMapper.xml
+9
-0
bsoft-api/src/main/resources/templates/ind.html
+64
-12
No files found.
bsoft-api/src/main/java/com/bsoft/api/controller/IndController.java
View file @
bce74232
package
com
.
bsoft
.
api
.
controller
;
package
com
.
bsoft
.
api
.
controller
;
import
com.bsoft.api.service.DicIndService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
@@ -7,21 +9,21 @@ import org.springframework.web.bind.annotation.PostMapping;
...
@@ -7,21 +9,21 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.servlet.ModelAndView
;
import
org.springframework.web.servlet.ModelAndView
;
import
java.util.ArrayList
;
import
java.util.List
;
@RequestMapping
(
"ind"
)
@RequestMapping
(
"ind"
)
@Controller
@Controller
public
class
IndController
{
public
class
IndController
{
@Autowired
private
DicIndService
dicIndService
;
@GetMapping
@GetMapping
public
ModelAndView
index
(
Model
model
,
String
filter
){
public
ModelAndView
index
(
Model
model
,
String
filter
){
model
.
addAttribute
(
"title"
,
"指标搜索"
);
model
.
addAttribute
(
"title"
,
"指标搜索"
);
model
.
addAttribute
(
"indList"
,
dicIndService
.
selectAll
(
filter
));
model
.
addAttribute
(
"indList"
,
null
);
model
.
addAttribute
(
"filter"
,
filter
==
null
?
""
:
filter
);
model
.
addAttribute
(
"filter"
,
filter
==
null
?
""
:
filter
);
ModelAndView
mav
=
new
ModelAndView
(
"ind"
,
"indModel"
,
model
);
ModelAndView
mav
=
new
ModelAndView
(
"ind"
,
"indModel"
,
model
);
return
mav
;
return
mav
;
}
}
...
...
bsoft-api/src/main/java/com/bsoft/api/mapper/DicIndMapper.java
View file @
bce74232
package
com
.
bsoft
.
api
.
mapper
;
package
com
.
bsoft
.
api
.
mapper
;
import
com.bsoft.api.model.DicInd
;
import
com.bsoft.api.model.DicInd
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
public
interface
DicIndMapper
{
public
interface
DicIndMapper
{
...
@@ -12,5 +14,7 @@ public interface DicIndMapper {
...
@@ -12,5 +14,7 @@ public interface DicIndMapper {
List
<
DicInd
>
selectAll
();
List
<
DicInd
>
selectAll
();
List
<
DicInd
>
selectAllByFilter
(
@Param
(
"filter"
)
String
filter
);
int
updateByPrimaryKey
(
DicInd
record
);
int
updateByPrimaryKey
(
DicInd
record
);
}
}
\ No newline at end of file
bsoft-api/src/main/java/com/bsoft/api/model/DicInd.java
View file @
bce74232
...
@@ -15,6 +15,8 @@ public class DicInd {
...
@@ -15,6 +15,8 @@ public class DicInd {
private
String
indName
;
private
String
indName
;
private
String
indField
;
private
Short
computeMode
;
private
Short
computeMode
;
private
String
execSql
;
private
String
execSql
;
...
@@ -69,6 +71,14 @@ public class DicInd {
...
@@ -69,6 +71,14 @@ public class DicInd {
this
.
indName
=
indName
;
this
.
indName
=
indName
;
}
}
public
String
getIndField
()
{
return
indField
;
}
public
void
setIndField
(
String
indField
)
{
this
.
indField
=
indField
;
}
public
Short
getComputeMode
()
{
public
Short
getComputeMode
()
{
return
computeMode
;
return
computeMode
;
}
}
...
...
bsoft-api/src/main/java/com/bsoft/api/service/DicIndService.java
View file @
bce74232
...
@@ -2,5 +2,8 @@ package com.bsoft.api.service;
...
@@ -2,5 +2,8 @@ package com.bsoft.api.service;
import
com.bsoft.api.model.DicInd
;
import
com.bsoft.api.model.DicInd
;
import
java.util.List
;
public
interface
DicIndService
extends
ServiceBase
<
DicInd
>{
public
interface
DicIndService
extends
ServiceBase
<
DicInd
>{
List
<
DicInd
>
selectAll
(
String
filter
);
}
}
bsoft-api/src/main/java/com/bsoft/api/service/Impl/DicIndServiceImpl.java
View file @
bce74232
...
@@ -42,4 +42,11 @@ public class DicIndServiceImpl implements DicIndService {
...
@@ -42,4 +42,11 @@ public class DicIndServiceImpl implements DicIndService {
public
int
update
(
DicInd
dicInd
)
{
public
int
update
(
DicInd
dicInd
)
{
return
dicIndMapper
.
updateByPrimaryKey
(
dicInd
);
return
dicIndMapper
.
updateByPrimaryKey
(
dicInd
);
}
}
@Override
public
List
<
DicInd
>
selectAll
(
String
filter
)
{
List
<
DicInd
>
list
=
dicIndMapper
.
selectAllByFilter
(
filter
);
return
list
;
}
}
}
bsoft-api/src/main/resources/mapper/DicIndMapper.xml
View file @
bce74232
...
@@ -8,10 +8,12 @@
...
@@ -8,10 +8,12 @@
<result
column=
"STATE"
jdbcType=
"DECIMAL"
property=
"state"
/>
<result
column=
"STATE"
jdbcType=
"DECIMAL"
property=
"state"
/>
<result
column=
"IND_CODE"
jdbcType=
"VARCHAR"
property=
"indCode"
/>
<result
column=
"IND_CODE"
jdbcType=
"VARCHAR"
property=
"indCode"
/>
<result
column=
"IND_NAME"
jdbcType=
"VARCHAR"
property=
"indName"
/>
<result
column=
"IND_NAME"
jdbcType=
"VARCHAR"
property=
"indName"
/>
<result
column=
"IND_FIELD"
jdbcType=
"VARCHAR"
property=
"indField"
/>
<result
column=
"COMPUTE_MODE"
jdbcType=
"DECIMAL"
property=
"computeMode"
/>
<result
column=
"COMPUTE_MODE"
jdbcType=
"DECIMAL"
property=
"computeMode"
/>
<result
column=
"EXEC_SQL"
jdbcType=
"VARCHAR"
property=
"execSql"
/>
<result
column=
"EXEC_SQL"
jdbcType=
"VARCHAR"
property=
"execSql"
/>
<result
column=
"DESCRIBE"
jdbcType=
"VARCHAR"
property=
"describe"
/>
<result
column=
"DESCRIBE"
jdbcType=
"VARCHAR"
property=
"describe"
/>
</resultMap>
</resultMap>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from LL.DIC_IND
delete from LL.DIC_IND
where ID = #{id,jdbcType=DECIMAL}
where ID = #{id,jdbcType=DECIMAL}
...
@@ -50,4 +52,10 @@
...
@@ -50,4 +52,10 @@
DESCRIBE
DESCRIBE
from LL.DIC_IND
from LL.DIC_IND
</select>
</select>
<select
id=
"selectAllByFilter"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, STATE, IND_CODE, IND_NAME,IND_FIELD, COMPUTE_MODE, EXEC_SQL,
DESCRIBE
from LL.DIC_IND
where IND_NAME LIKE '%'||#{filter,jdbcType=VARCHAR}||'%'
</select>
</mapper>
</mapper>
\ No newline at end of file
bsoft-api/src/main/resources/templates/ind.html
View file @
bce74232
...
@@ -5,29 +5,81 @@
...
@@ -5,29 +5,81 @@
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<title>
Ind search
</title>
<title>
Ind search
</title>
</head>
</head>
<style
type=
"text/css"
>
.table
{
border-collapse
:
collapse
;
margin
:
0
auto
;
text-align
:
center
;
}
.table
td
,
table
th
{
border
:
1px
solid
#cad9ea
;
color
:
#666
;
height
:
30px
;
}
.table
thead
th
{
background-color
:
#CCE8EB
;
width
:
100px
;
}
.table
tr
:nth-child
(
odd
)
{
background
:
#fff
;
}
.table
tr
:nth-child
(
even
)
{
background
:
#F5FAFA
;
}
.filterTxt
{
font-size
:
15px
;
letter-spacing
:
2px
;
border-bottom
:
1px
solid
#dddddd
;
padding
:
5px
0px
3px
0px
;
margin
:
4px
0px
4px
0px
;
text-align
:
center
;
height
:
24px
;
}
.subBtn
{
width
:
50px
;
height
:
30px
;
color
:
white
;
background-color
:
cornflowerblue
;
border-radius
:
3px
;
border-width
:
0
;
margin
:
0
;
outline
:
none
;
font-family
:
KaiTi
;
font-size
:
15px
;
text-align
:
center
;
cursor
:
pointer
;
}
</style>
<body>
<body>
<h1
th:text=
"${indModel.title}"
>
指标查询
</h1>
<div
style=
"text-align: center"
>
<form
action=
"./ind/search"
method=
"post"
>
<h1
th:text=
"${indModel.title}"
>
指标查询
</h1>
<input
type =
"text"
name=
"filter"
th:value=
"${indModel.filter}"
/>
<form
action=
"http://localhost:8080/ind"
method=
"get"
>
<input
type=
"submit"
value=
"提交"
>
<input
type =
"text"
name=
"filter"
class=
"filterTxt"
th:value=
"${indModel.filter}"
/>
</form>
<input
type=
"submit"
class=
"subBtn"
value=
"提交"
>
<div>
</form>
<table
border=
"1"
>
</div>
<div
style=
"margin-top: 20px"
>
<table
width=
"60%"
class=
"table"
>
<thead>
<thead>
<tr>
<tr>
<t
d>
编码
</td
>
<t
h
style=
""
>
编码
</th
>
<t
d>
名称
</td
>
<t
h>
名称
</th
>
<t
d>
字段名
</td
>
<t
h>
字段名
</th
>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
th:if=
"${indModel.indList.size()} eq 0"
>
<tr
th:if=
"${indModel.indList.size()} eq 0"
>
<td
colspan=
"
2
"
>
无数据
</td>
<td
colspan=
"
3
"
>
无数据
</td>
</tr>
</tr>
<tr
th:each=
"ind : ${indModel.indList}"
>
<tr
th:each=
"ind : ${indModel.indList}"
>
<td
th:text=
"${ind.indCode}"
></td>
<td
th:text=
"${ind.indCode}"
></td>
<td
th:text=
"${ind.indName}"
></td>
<td
th:text=
"${ind.indName}"
></td>
<td
th:text=
"${ind.
computeMode
}"
></td>
<td
th:text=
"${ind.
indField
}"
></td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
...
...
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