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
8183cb92
Commit
8183cb92
authored
Jun 17, 2020
by
Suvalue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
根据疾病名称搜索疾病
预算编制汇总数据根据用户科室查询
parent
66b068d4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
208 additions
and
171 deletions
+208
-171
bsoft-api/src/main/java/com/bsoft/api/mapper/SerProjMapper.java
+2
-1
bsoft-api/src/main/java/com/bsoft/api/service/Impl/SerProjValueServiceImpl.java
+54
-54
bsoft-api/src/main/resources/application-test.properties
+1
-1
bsoft-api/src/main/resources/mapper/SerDiseaseMapper.xml
+38
-27
bsoft-api/src/main/resources/mapper/SerProjMapper.xml
+113
-88
No files found.
bsoft-api/src/main/java/com/bsoft/api/mapper/SerProjMapper.java
View file @
8183cb92
...
...
@@ -22,5 +22,5 @@ public interface SerProjMapper {
List
<
ProjectInfo
>
selectState
(
@Param
(
"projType"
)
Integer
projType
,
@Param
(
"typeState"
)
Integer
typeState
);
List
<
Summary
>
selectDept
(
@Param
(
"date"
)
Integer
date
,
@Param
(
"budgetType"
)
Integer
budgetType
);
List
<
Summary
>
selectDept
(
@Param
(
"date"
)
Integer
date
,
@Param
(
"budgetType"
)
Integer
budgetType
,
@Param
(
"userId"
)
Long
userId
);
}
\ No newline at end of file
bsoft-api/src/main/java/com/bsoft/api/service/Impl/SerProjValueServiceImpl.java
View file @
8183cb92
...
...
@@ -38,39 +38,39 @@ public class SerProjValueServiceImpl implements SerProjValueService {
//查询项目数值
@Override
public
Object
getValue
(
Integer
projectType
,
Integer
date
,
String
deptCode
,
Long
userId
)
throws
Throwable
{
public
Object
getValue
(
Integer
projectType
,
Integer
date
,
String
deptCode
,
Long
userId
)
throws
Throwable
{
List
<
DicOrg
>
orgList
=
dicOrgMapper
.
selectByUser
(
userId
);
String
orgCode
=
orgList
!=
null
&&
orgList
.
size
()
>
0
?
orgList
.
get
(
0
).
getOrgCode
()
:
null
;
List
<
ProjectValue
>
result
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
enumList
=
TypeState
.
all
();
if
(
enumList
!=
null
&&
enumList
.
size
()
>
0
)
{
List
<
Map
<
String
,
Object
>>
enumList
=
TypeState
.
all
();
if
(
enumList
!=
null
&&
enumList
.
size
()
>
0
)
{
ProjectValue
projectValue
=
null
;
List
<
ProjectInfo
>
projectInfo
=
null
;
List
<
SerProjValueResp
>
values
=
null
;
List
<
SerProjValueResp
>
resultValues
=
null
;
SerProjValueSz
valueSz
=
null
;
for
(
Map
<
String
,
Object
>
enumInfo
:
enumList
)
{
for
(
Map
<
String
,
Object
>
enumInfo
:
enumList
)
{
projectValue
=
new
ProjectValue
();
projectValue
.
setTypeId
((
Integer
)
enumInfo
.
get
(
"value"
));
projectValue
.
setTypeId
((
Integer
)
enumInfo
.
get
(
"value"
));
projectInfo
=
new
ArrayList
<>();
projectInfo
=
serProjMapper
.
selectState
(
projectType
,
(
Integer
)
enumInfo
.
get
(
"value"
));
if
(
projectInfo
!=
null
&&
projectInfo
.
size
()
>
0
)
{
for
(
ProjectInfo
projInfo
:
projectInfo
)
{
values
=
serProjValueMapper
.
selectValue
(
projectType
,
(
Integer
)
enumInfo
.
get
(
"value"
),
projInfo
.
getExponentId
(),
deptCode
,
date
,
BudgetType
.
NOT
.
getValue
(),
orgCode
);
if
(
values
!=
null
&&
values
.
size
()
>
0
)
{
for
(
SerProjValueResp
value
:
values
)
{
valueSz
=
projValueSzMapper
.
selectByProj
(
value
.
getProjId
(),
date
,
deptCode
,
orgCode
);
if
(
valueSz
!=
null
)
{
projectInfo
=
serProjMapper
.
selectState
(
projectType
,
(
Integer
)
enumInfo
.
get
(
"value"
));
if
(
projectInfo
!=
null
&&
projectInfo
.
size
()
>
0
)
{
for
(
ProjectInfo
projInfo
:
projectInfo
)
{
values
=
serProjValueMapper
.
selectValue
(
projectType
,
(
Integer
)
enumInfo
.
get
(
"value"
),
projInfo
.
getExponentId
(),
deptCode
,
date
,
BudgetType
.
NOT
.
getValue
(),
orgCode
);
if
(
values
!=
null
&&
values
.
size
()
>
0
)
{
for
(
SerProjValueResp
value
:
values
)
{
valueSz
=
projValueSzMapper
.
selectByProj
(
value
.
getProjId
(),
date
,
deptCode
,
orgCode
);
if
(
valueSz
!=
null
)
{
value
.
setSz
(
valueSz
.
getSz
());
value
.
setZxpl
(
valueSz
.
getZxpl
());
valueSz
=
null
;
}
}
}
resultValues
=
getLevelData
(
values
,
BigDecimal
.
valueOf
(
PROJ_TOP_PARENT_ID
));
if
(
resultValues
!=
null
&&
resultValues
.
size
()
>
0
)
resultValues
=
getLevelData
(
values
,
BigDecimal
.
valueOf
(
PROJ_TOP_PARENT_ID
));
if
(
resultValues
!=
null
&&
resultValues
.
size
()
>
0
)
projInfo
.
setProjectValues
(
resultValues
);
}
}
...
...
@@ -83,19 +83,19 @@ public class SerProjValueServiceImpl implements SerProjValueService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
save
(
Long
userId
,
AddBudgetValue
request
)
{
public
boolean
save
(
Long
userId
,
AddBudgetValue
request
)
{
int
result
=
0
;
List
<
DicOrg
>
orgList
=
dicOrgMapper
.
selectByUser
(
userId
);
String
orgCode
=
orgList
.
get
(
0
).
getOrgCode
();
if
(
request
!=
null
&&
request
.
getBudgetValues
()
!=
null
&&
request
.
getBudgetValues
().
size
()
>
0
)
{
if
(
request
!=
null
&&
request
.
getBudgetValues
()
!=
null
&&
request
.
getBudgetValues
().
size
()
>
0
)
{
//先将记录插入历史表
result
=
serProjValueMapper
.
insertToHistory
(
request
.
getDeptCode
(),
request
.
getDate
(),
request
.
getProjType
(),
orgCode
);
result
=
serProjValueMapper
.
insertToHistory
(
request
.
getDeptCode
(),
request
.
getDate
(),
request
.
getProjType
(),
orgCode
);
//先进行删除操作
result
=
serProjValueMapper
.
deleteByDeptWithDate
(
request
.
getDeptCode
(),
request
.
getDate
(),
request
.
getProjType
(),
orgCode
);
result
=
serProjValueMapper
.
deleteByDeptWithDate
(
request
.
getDeptCode
(),
request
.
getDate
(),
request
.
getProjType
(),
orgCode
);
SerProjValue
info
=
null
;
long
version
=
System
.
currentTimeMillis
();
for
(
BudgetValue
budgetValue
:
request
.
getBudgetValues
())
{
if
(
budgetValue
.
getProjId
()
!=
null
)
{
for
(
BudgetValue
budgetValue
:
request
.
getBudgetValues
())
{
if
(
budgetValue
.
getProjId
()
!=
null
)
{
info
=
new
SerProjValue
(
budgetValue
);
info
.
setDate
(
request
.
getDate
());
info
.
setDeptCode
(
request
.
getDeptCode
());
...
...
@@ -107,35 +107,35 @@ public class SerProjValueServiceImpl implements SerProjValueService {
}
}
//调用计算数值存储过程
serProjValueMapper
.
updateValue
(
request
.
getDate
(),
orgCode
);
serProjValueMapper
.
updateValue
(
request
.
getDate
(),
orgCode
);
}
return
result
>
0
;
}
@Override
public
Object
getSummary
(
Integer
date
,
Integer
budgetType
,
Long
userId
)
{
public
Object
getSummary
(
Integer
date
,
Integer
budgetType
,
Long
userId
)
{
List
<
DicOrg
>
orgList
=
dicOrgMapper
.
selectByUser
(
userId
);
String
orgCode
=
orgList
.
get
(
0
).
getOrgCode
();
List
<
Summary
>
result
=
serProjMapper
.
selectDept
(
date
,
budgetType
);
if
(
result
!=
null
&&
result
.
size
()
>
0
)
{
for
(
Summary
summary
:
result
)
{
List
<
Summary
>
result
=
serProjMapper
.
selectDept
(
date
,
budgetType
,
userId
);
if
(
result
!=
null
&&
result
.
size
()
>
0
)
{
for
(
Summary
summary
:
result
)
{
summary
.
setProjTypeList
(
new
ArrayList
<>());
List
<
Map
<
String
,
Object
>>
enumList
=
ProjectType
.
all
();
List
<
Map
<
String
,
Object
>>
enumList
=
ProjectType
.
all
();
SummaryProjType
projType
=
null
;
List
<
ProjectInfo
>
projectInfo
=
null
;
SerProjValueSz
valueSz
=
null
;
List
<
SerProjValueResp
>
values
=
null
;
if
(
enumList
!=
null
&&
enumList
.
size
()
>
0
)
{
for
(
Map
<
String
,
Object
>
enumInfo
:
enumList
)
{
if
(
enumList
!=
null
&&
enumList
.
size
()
>
0
)
{
for
(
Map
<
String
,
Object
>
enumInfo
:
enumList
)
{
projType
=
new
SummaryProjType
();
projType
.
setProjTypeName
(
String
.
valueOf
(
enumInfo
.
get
(
"description"
)));
values
=
serProjValueMapper
.
selectValue
((
Integer
)
enumInfo
.
get
(
"value"
),
null
,
null
,
summary
.
getDeptCode
(),
date
,
budgetType
,
orgCode
);
if
(
values
!=
null
&&
values
.
size
()
>
0
)
{
for
(
SerProjValueResp
value
:
values
)
{
valueSz
=
projValueSzMapper
.
selectByProj
(
value
.
getProjId
(),
date
,
summary
.
getDeptCode
(),
orgCode
);
if
(
valueSz
!=
null
)
{
values
=
serProjValueMapper
.
selectValue
((
Integer
)
enumInfo
.
get
(
"value"
),
null
,
null
,
summary
.
getDeptCode
(),
date
,
budgetType
,
orgCode
);
if
(
values
!=
null
&&
values
.
size
()
>
0
)
{
for
(
SerProjValueResp
value
:
values
)
{
valueSz
=
projValueSzMapper
.
selectByProj
(
value
.
getProjId
(),
date
,
summary
.
getDeptCode
(),
orgCode
);
if
(
valueSz
!=
null
)
{
value
.
setSz
(
valueSz
.
getSz
());
value
.
setZxpl
(
valueSz
.
getZxpl
());
valueSz
=
null
;
...
...
@@ -145,7 +145,7 @@ public class SerProjValueServiceImpl implements SerProjValueService {
}
summary
.
getProjTypeList
().
add
(
projType
);
}
}
else
{
}
else
{
summary
.
setProjTypeList
(
null
);
}
}
...
...
@@ -154,11 +154,11 @@ public class SerProjValueServiceImpl implements SerProjValueService {
}
@Override
public
Object
getData
(
Integer
date
,
Integer
page
)
{
List
<
SummaryNew
>
result
=
pageProjValueMapper
.
selectDept
(
date
,
page
);
if
(
result
!=
null
&&
result
.
size
()
>
0
)
{
for
(
SummaryNew
summary
:
result
)
{
List
<
SummaryValue
>
values
=
pageProjValueMapper
.
selectValue
(
date
,
page
,
summary
.
getDeptCode
());
public
Object
getData
(
Integer
date
,
Integer
page
)
{
List
<
SummaryNew
>
result
=
pageProjValueMapper
.
selectDept
(
date
,
page
);
if
(
result
!=
null
&&
result
.
size
()
>
0
)
{
for
(
SummaryNew
summary
:
result
)
{
List
<
SummaryValue
>
values
=
pageProjValueMapper
.
selectValue
(
date
,
page
,
summary
.
getDeptCode
());
summary
.
setProjTypeList
(
values
);
}
}
...
...
@@ -166,34 +166,34 @@ public class SerProjValueServiceImpl implements SerProjValueService {
}
@Override
public
Object
getDataNew
(
Integer
page
,
Map
<
String
,
String
>
dim
)
{
public
Object
getDataNew
(
Integer
page
,
Map
<
String
,
String
>
dim
)
{
SerPageValueConfig
pageValueConfig
=
pageValueConfigMapper
.
selectByPage
(
page
);
if
(
pageValueConfig
!=
null
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>()
{
if
(
pageValueConfig
!=
null
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>()
{
{
put
(
"sqlStr"
,
pageValueConfig
.
getSqlstr
());
put
(
"sqlStr"
,
pageValueConfig
.
getSqlstr
());
putAll
(
dim
);
}
};
List
<
Map
<
String
,
Object
>>
dataList
=
pageValueConfigMapper
.
selectSqlStr
(
map
);
List
<
Map
<
String
,
Object
>>
dataList
=
pageValueConfigMapper
.
selectSqlStr
(
map
);
return
dataList
;
}
return
null
;
}
private
List
<
SerProjValueResp
>
getLevelData
(
List
<
SerProjValueResp
>
list
,
BigDecimal
parentcode
)
{
private
List
<
SerProjValueResp
>
getLevelData
(
List
<
SerProjValueResp
>
list
,
BigDecimal
parentcode
)
{
List
<
SerProjValueResp
>
resultList
=
new
ArrayList
<>();
for
(
SerProjValueResp
data
:
list
)
{
if
(
data
.
getParent
().
equals
(
parentcode
))
{
List
<
SerProjValueResp
>
childList
=
getLevelData
(
list
,
data
.
getProjId
());
try
{
if
(
data
.
getSort
()
!=
null
)
{
for
(
SerProjValueResp
data
:
list
)
{
if
(
data
.
getParent
().
equals
(
parentcode
))
{
List
<
SerProjValueResp
>
childList
=
getLevelData
(
list
,
data
.
getProjId
());
try
{
if
(
data
.
getSort
()
!=
null
)
{
childList
=
childList
.
stream
().
sorted
(
Comparator
.
comparing
(
SerProjValueResp:
:
getSort
)).
collect
(
Collectors
.
toList
());
}
data
.
setChilds
(
childList
);
resultList
.
add
(
data
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
bsoft-api/src/main/resources/application-test.properties
View file @
8183cb92
#### \u6D4B\u8BD5\u73AF\u5883 ###################################################
spring.datasource.url
=
jdbc:mysql://192.168.18.176:3306/scml_
zp_cs
?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=TRUE&serverTimezone=UTC
spring.datasource.url
=
jdbc:mysql://192.168.18.176:3306/scml_
sy_test1.0
?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=TRUE&serverTimezone=UTC
spring.datasource.username
=
root
spring.datasource.password
=
Suvalue2016
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
...
...
bsoft-api/src/main/resources/mapper/SerDiseaseMapper.xml
View file @
8183cb92
...
...
@@ -2,30 +2,30 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.bsoft.api.mapper.SerDiseaseMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.bsoft.api.model.SerDisease"
>
<result
column=
"ID"
jdbcType=
"DECIMAL"
property=
"id"
/>
<result
column=
"CREATE_DATE"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"CREATE_USERID"
jdbcType=
"DECIMAL"
property=
"createUserid"
/>
<result
column=
"STATE"
jdbcType=
"DECIMAL"
property=
"state"
/>
<result
column=
"MDC_CODE"
jdbcType=
"VARCHAR"
property=
"mdcCode"
/>
<result
column=
"MDC_NAME"
jdbcType=
"VARCHAR"
property=
"mdcName"
/>
<result
column=
"DATE"
jdbcType=
"DECIMAL"
property=
"date"
/>
<result
column=
"MDC_NUM"
jdbcType=
"VARCHAR"
property=
"mdcNum"
/>
<result
column=
"PARENT_ID"
jdbcType=
"DECIMAL"
property=
"parentId"
/>
<result
column=
"LEVEL"
jdbcType=
"DECIMAL"
property=
"level"
/>
<result
column=
"ORG_ID"
jdbcType=
"DECIMAL"
property=
"orgId"
/>
<result
column=
"ORG_NAME"
jdbcType=
"VARCHAR"
property=
"orgName"
/>
<result
column=
"PARENT_CODE"
jdbcType=
"VARCHAR"
property=
"parentCode"
/>
<result
column=
"ID"
jdbcType=
"DECIMAL"
property=
"id"
/>
<result
column=
"CREATE_DATE"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"CREATE_USERID"
jdbcType=
"DECIMAL"
property=
"createUserid"
/>
<result
column=
"STATE"
jdbcType=
"DECIMAL"
property=
"state"
/>
<result
column=
"MDC_CODE"
jdbcType=
"VARCHAR"
property=
"mdcCode"
/>
<result
column=
"MDC_NAME"
jdbcType=
"VARCHAR"
property=
"mdcName"
/>
<result
column=
"DATE"
jdbcType=
"DECIMAL"
property=
"date"
/>
<result
column=
"MDC_NUM"
jdbcType=
"VARCHAR"
property=
"mdcNum"
/>
<result
column=
"PARENT_ID"
jdbcType=
"DECIMAL"
property=
"parentId"
/>
<result
column=
"LEVEL"
jdbcType=
"DECIMAL"
property=
"level"
/>
<result
column=
"ORG_ID"
jdbcType=
"DECIMAL"
property=
"orgId"
/>
<result
column=
"ORG_NAME"
jdbcType=
"VARCHAR"
property=
"orgName"
/>
<result
column=
"PARENT_CODE"
jdbcType=
"VARCHAR"
property=
"parentCode"
/>
</resultMap>
<resultMap
id=
"DiseaseLevel"
type=
"com.bsoft.api.model.respmodel.DiseaseLevel"
>
<id
column=
"ID"
jdbcType=
"DECIMAL"
property=
"id"
/>
<result
column=
"MDC_CODE"
jdbcType=
"VARCHAR"
property=
"mdcCode"
/>
<result
column=
"MDC_NAME"
jdbcType=
"VARCHAR"
property=
"mdcName"
/>
<result
column=
"DATE"
jdbcType=
"DECIMAL"
property=
"date"
/>
<result
column=
"MDC_NUM"
jdbcType=
"VARCHAR"
property=
"mdcNum"
/>
<result
column=
"PARENT_ID"
jdbcType=
"DECIMAL"
property=
"parentId"
/>
<result
column=
"LEVEL"
jdbcType=
"DECIMAL"
property=
"level"
/>
<result
column=
"ORG_ID"
jdbcType=
"DECIMAL"
property=
"orgId"
/>
<result
column=
"ORG_NAME"
jdbcType=
"VARCHAR"
property=
"orgName"
/>
<id
column=
"ID"
jdbcType=
"DECIMAL"
property=
"id"
/>
<result
column=
"MDC_CODE"
jdbcType=
"VARCHAR"
property=
"mdcCode"
/>
<result
column=
"MDC_NAME"
jdbcType=
"VARCHAR"
property=
"mdcName"
/>
<result
column=
"DATE"
jdbcType=
"DECIMAL"
property=
"date"
/>
<result
column=
"MDC_NUM"
jdbcType=
"VARCHAR"
property=
"mdcNum"
/>
<result
column=
"PARENT_ID"
jdbcType=
"DECIMAL"
property=
"parentId"
/>
<result
column=
"LEVEL"
jdbcType=
"DECIMAL"
property=
"level"
/>
<result
column=
"ORG_ID"
jdbcType=
"DECIMAL"
property=
"orgId"
/>
<result
column=
"ORG_NAME"
jdbcType=
"VARCHAR"
property=
"orgName"
/>
</resultMap>
<insert
id=
"insert"
parameterType=
"com.bsoft.api.model.SerDisease"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.math.BigDecimal"
>
...
...
@@ -43,10 +43,21 @@
)
</insert>
<select
id=
"selectAll"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, `STATE`, MDC_CODE, MDC_NAME, `DATE`, MDC_NUM,
PARENT_ID, `LEVEL`, ORG_ID, ORG_NAME, PARENT_CODE
from SER_DISEASE
</select>
select ID,
CREATE_DATE,
CREATE_USERID,
`STATE`,
MDC_CODE,
MDC_NAME,
`DATE`,
MDC_NUM,
PARENT_ID,
`LEVEL`,
ORG_ID,
ORG_NAME,
PARENT_CODE
from SER_DISEASE
</select>
<select
id=
"selectByCode"
resultMap=
"BaseResultMap"
>
select DISTINCT d.ID, d.CREATE_DATE, d.CREATE_USERID, d.`STATE`, d.MDC_CODE, d.MDC_NAME, d.`DATE`,d.MDC_NUM,
d.PARENT_ID, d.`LEVEL`, d.ORG_ID, d.ORG_NAME
...
...
@@ -66,7 +77,7 @@
and rs.DEPT_CODE=#{deptCode,jdbcType=VARCHAR}
</if>
<if
test=
"mdcName!=null"
>
and
d.MDC_NAME like '%'||#{mdcName,jdbcType=VARCHAR}||'%'
and
INSTR(d.MDC_NAME,#{mdcName,jdbcType=VARCHAR})>0
</if>
order by d.MDC_NUM
</select>
...
...
bsoft-api/src/main/resources/mapper/SerProjMapper.xml
View file @
8183cb92
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.bsoft.api.mapper.SerProjMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.bsoft.api.model.SerProj"
>
<result
column=
"ID"
jdbcType=
"DECIMAL"
property=
"id"
/>
<result
column=
"CREATE_DATE"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"CREATE_USERID"
jdbcType=
"DECIMAL"
property=
"createUserid"
/>
<result
column=
"STATE"
jdbcType=
"DECIMAL"
property=
"state"
/>
<result
column=
"TYPE"
jdbcType=
"DECIMAL"
property=
"type"
/>
<result
column=
"PROJ_TYPE"
jdbcType=
"DECIMAL"
property=
"projType"
/>
<result
column=
"PROJ_NAME"
jdbcType=
"VARCHAR"
property=
"projName"
/>
<result
column=
"IS_BUDGET"
jdbcType=
"DECIMAL"
property=
"isBudget"
/>
<result
column=
"TYPE_STATE"
jdbcType=
"DECIMAL"
property=
"typeState"
/>
<result
column=
"SORT"
jdbcType=
"DECIMAL"
property=
"sort"
/>
<result
column=
"PARENT"
jdbcType=
"DECIMAL"
property=
"parent"
/>
</resultMap>
<resultMap
id=
"Summary"
type=
"com.bsoft.api.model.respmodel.Summary"
>
<result
column=
"DEPT_CODE"
jdbcType=
"VARCHAR"
property=
"deptCode"
/>
</resultMap>
<resultMap
id=
"ProjectInfo"
type=
"com.bsoft.api.model.respmodel.ProjectInfo"
>
<result
column=
"EXPONENT_ID"
jdbcType=
"DECIMAL"
property=
"exponentId"
/>
<result
column=
"EXPONENT_NAME"
jdbcType=
"VARCHAR"
property=
"exponentName"
/>
</resultMap>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.math.BigDecimal"
>
delete from SER_PROJ
where ID = #{id,jdbcType=DECIMAL}
</delete>
<insert
id=
"insert"
parameterType=
"com.bsoft.api.model.SerProj"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.math.BigDecimal"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into SER_PROJ (CREATE_DATE, CREATE_USERID, `STATE`,
`TYPE`, PROJ_TYPE, PROJ_NAME,
IS_BUDGET, TYPE_STATE, SORT
)
values (#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{type,jdbcType=DECIMAL}, #{projType,jdbcType=DECIMAL}, #{projName,jdbcType=VARCHAR},
#{isBudget,jdbcType=DECIMAL}, #{typeState,jdbcType=DECIMAL}, #{sort,jdbcType=DECIMAL}
)
</insert>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.bsoft.api.model.SerProj"
>
update SER_PROJ
set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
`STATE` = #{state,jdbcType=DECIMAL},
`TYPE` = #{type,jdbcType=DECIMAL},
PROJ_TYPE = #{projType,jdbcType=DECIMAL},
PROJ_NAME = #{projName,jdbcType=VARCHAR},
IS_BUDGET = #{isBudget,jdbcType=DECIMAL},
TYPE_STATE = #{typeState,jdbcType=DECIMAL},
SORT = #{sort,jdbcType=DECIMAL}
where ID = #{id,jdbcType=DECIMAL}
</update>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.math.BigDecimal"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, `STATE`, `TYPE`, PROJ_TYPE, PROJ_NAME, IS_BUDGET,
TYPE_STATE, SORT
from SER_PROJ
where ID = #{id,jdbcType=DECIMAL}
</select>
<select
id=
"selectAll"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, `STATE`, `TYPE`, PROJ_TYPE, PROJ_NAME, IS_BUDGET,
TYPE_STATE, SORT
from SER_PROJ
</select>
<select
id=
"selectState"
resultMap=
"ProjectInfo"
>
select DISTINCT p.TYPE as EXPONENT_ID,e.EXPONENT_NAME,e.SORT
from ser_proj p
join DIC_EXPONENT e on e.EXPONENT_ID=p.`TYPE` and e.STATE = 1
where p.`STATE` = 1
<if
test=
"projType!=null"
>
and p.PROJ_TYPE = #{projType,jdbcType=DECIMAL}
</if>
<if
test=
"typeState!=null"
>
and p.TYPE_STATE = #{typeState,jdbcType=DECIMAL}
</if>
order by e.SORT
</select>
<select
id=
"selectDept"
resultMap=
"Summary"
>
select v.DEPT_CODE
from SER_PROJ_VALUE v
join SER_PROJ p on p.ID =v.PROJ_ID and p.STATE = 1
where 1=1
<if
test=
"date!=null"
>
and v.`DATE`= LEFT(#{date,jdbcType=DECIMAL},4)
</if>
<if
test=
"budgetType!=null"
>
and IS_BUDGET
&
#{budgetType,jdbcType=DECIMAL}>0
</if>
GROUP BY v.DEPT_CODE,v.SORT
order by v.SORT
</select>
<resultMap
id=
"BaseResultMap"
type=
"com.bsoft.api.model.SerProj"
>
<result
column=
"ID"
jdbcType=
"DECIMAL"
property=
"id"
/>
<result
column=
"CREATE_DATE"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"CREATE_USERID"
jdbcType=
"DECIMAL"
property=
"createUserid"
/>
<result
column=
"STATE"
jdbcType=
"DECIMAL"
property=
"state"
/>
<result
column=
"TYPE"
jdbcType=
"DECIMAL"
property=
"type"
/>
<result
column=
"PROJ_TYPE"
jdbcType=
"DECIMAL"
property=
"projType"
/>
<result
column=
"PROJ_NAME"
jdbcType=
"VARCHAR"
property=
"projName"
/>
<result
column=
"IS_BUDGET"
jdbcType=
"DECIMAL"
property=
"isBudget"
/>
<result
column=
"TYPE_STATE"
jdbcType=
"DECIMAL"
property=
"typeState"
/>
<result
column=
"SORT"
jdbcType=
"DECIMAL"
property=
"sort"
/>
<result
column=
"PARENT"
jdbcType=
"DECIMAL"
property=
"parent"
/>
</resultMap>
<resultMap
id=
"Summary"
type=
"com.bsoft.api.model.respmodel.Summary"
>
<result
column=
"DEPT_CODE"
jdbcType=
"VARCHAR"
property=
"deptCode"
/>
</resultMap>
<resultMap
id=
"ProjectInfo"
type=
"com.bsoft.api.model.respmodel.ProjectInfo"
>
<result
column=
"EXPONENT_ID"
jdbcType=
"DECIMAL"
property=
"exponentId"
/>
<result
column=
"EXPONENT_NAME"
jdbcType=
"VARCHAR"
property=
"exponentName"
/>
</resultMap>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.math.BigDecimal"
>
delete
from SER_PROJ
where ID = #{id,jdbcType=DECIMAL}
</delete>
<insert
id=
"insert"
parameterType=
"com.bsoft.api.model.SerProj"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.math.BigDecimal"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into SER_PROJ (CREATE_DATE, CREATE_USERID, `STATE`,
`TYPE`, PROJ_TYPE, PROJ_NAME,
IS_BUDGET, TYPE_STATE, SORT
)
values (#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{type,jdbcType=DECIMAL}, #{projType,jdbcType=DECIMAL}, #{projName,jdbcType=VARCHAR},
#{isBudget,jdbcType=DECIMAL}, #{typeState,jdbcType=DECIMAL}, #{sort,jdbcType=DECIMAL}
)
</insert>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.bsoft.api.model.SerProj"
>
update SER_PROJ
set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
`STATE` = #{state,jdbcType=DECIMAL},
`TYPE` = #{type,jdbcType=DECIMAL},
PROJ_TYPE = #{projType,jdbcType=DECIMAL},
PROJ_NAME = #{projName,jdbcType=VARCHAR},
IS_BUDGET = #{isBudget,jdbcType=DECIMAL},
TYPE_STATE = #{typeState,jdbcType=DECIMAL},
SORT = #{sort,jdbcType=DECIMAL}
where ID = #{id,jdbcType=DECIMAL}
</update>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.math.BigDecimal"
resultMap=
"BaseResultMap"
>
select ID,
CREATE_DATE,
CREATE_USERID,
`STATE`,
`TYPE`,
PROJ_TYPE,
PROJ_NAME,
IS_BUDGET,
TYPE_STATE,
SORT
from SER_PROJ
where ID = #{id,jdbcType=DECIMAL}
</select>
<select
id=
"selectAll"
resultMap=
"BaseResultMap"
>
select ID,
CREATE_DATE,
CREATE_USERID,
`STATE`,
`TYPE`,
PROJ_TYPE,
PROJ_NAME,
IS_BUDGET,
TYPE_STATE,
SORT
from SER_PROJ
</select>
<select
id=
"selectState"
resultMap=
"ProjectInfo"
>
select DISTINCT p.TYPE as EXPONENT_ID,e.EXPONENT_NAME,e.SORT
from ser_proj p
join DIC_EXPONENT e on e.EXPONENT_ID=p.`TYPE` and e.STATE = 1
where p.`STATE` = 1
<if
test=
"projType!=null"
>
and p.PROJ_TYPE = #{projType,jdbcType=DECIMAL}
</if>
<if
test=
"typeState!=null"
>
and p.TYPE_STATE = #{typeState,jdbcType=DECIMAL}
</if>
order by e.SORT
</select>
<select
id=
"selectDept"
resultMap=
"Summary"
>
select v.DEPT_CODE
from SER_PROJ_VALUE v
join SER_PROJ p on p.ID =v.PROJ_ID and p.STATE = 1
where 1=1
and EXISTS(select o2.ORG_CODE as DEPT_CODE
from SYS_USER_ORG_RS rs2
join DIC_ORG o2 on o2.id = rs2.ORG_ID and rs2.STATE = 1
where o2.STATE = 1
and rs2.USER_ID = #{userId,jdbcType=DECIMAL}
and o2.ORG_CODE = v.DEPT_CODE
)
<if
test=
"date!=null"
>
and v.`DATE`= LEFT(#{date,jdbcType=DECIMAL},4)
</if>
<if
test=
"budgetType!=null"
>
and IS_BUDGET
&
#{budgetType,jdbcType=DECIMAL}>0
</if>
GROUP BY v.DEPT_CODE,v.SORT
order by v.SORT
</select>
</mapper>
\ No newline at end of file
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