Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
isc-core
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
isc-v3.1-tmp
isc-core
Commits
c8cc6237
Commit
c8cc6237
authored
Oct 31, 2024
by
hulei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XRT多实体调整
parent
005d1e10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
CbsRange.java
.../main/java/com/brilliance/isc/common/cbsmod/CbsRange.java
+1
-1
Utils.java
...e/src/main/java/com/brilliance/isc/common/util/Utils.java
+7
-5
No files found.
isc-common-service/src/main/java/com/brilliance/isc/common/cbsmod/CbsRange.java
View file @
c8cc6237
...
@@ -125,7 +125,7 @@ public class CbsRange {
...
@@ -125,7 +125,7 @@ public class CbsRange {
String
sql
=
""
;
String
sql
=
""
;
sql
+=
" WHERE CUR = '"
+
cur
+
"'"
;
sql
+=
" WHERE CUR = '"
+
cur
+
"'"
;
sql
+=
" AND date_format(BEGDAT, '%y%m%d') <= "
+
Utils
.
dbSqlDate
(
dat
)
+
" AND date_format(ENDDAT, '%y%m%d') > "
+
Utils
.
dbSqlDate
(
dat
)
+
" "
;
sql
+=
" AND date_format(BEGDAT, '%y%m%d') <= "
+
Utils
.
dbSqlDate
(
dat
)
+
" AND date_format(ENDDAT, '%y%m%d') > "
+
Utils
.
dbSqlDate
(
dat
)
+
" "
;
//
sql = Utils.sdbEtyGenSql("XRT",sql);
sql
=
Utils
.
sdbEtyGenSql
(
"XRT"
,
sql
);
List
<
Xrt
>
xrtList
=
xrtMapper
.
getXrtByConditionSql
(
sql
);
List
<
Xrt
>
xrtList
=
xrtMapper
.
getXrtByConditionSql
(
sql
);
if
(
xrtList
!=
null
&&
xrtList
.
size
()
>
0
)
{
if
(
xrtList
!=
null
&&
xrtList
.
size
()
>
0
)
{
BeanUtils
.
copyProperties
(
xrtList
.
get
(
0
),
xrt
);
//需要深拷贝,不然调用得到的对象指向的还是原来的地址
BeanUtils
.
copyProperties
(
xrtList
.
get
(
0
),
xrt
);
//需要深拷贝,不然调用得到的对象指向的还是原来的地址
...
...
isc-common-service/src/main/java/com/brilliance/isc/common/util/Utils.java
View file @
c8cc6237
...
@@ -402,7 +402,8 @@ public class Utils {
...
@@ -402,7 +402,8 @@ public class Utils {
//! (Normally the multientity selector condition created by SdbEtyGenInsSql or SdbEtyGenTblSql)
//! (Normally the multientity selector condition created by SdbEtyGenInsSql or SdbEtyGenTblSql)
//! The function returns a SQL condition incl. a leading where clause with optional parenthesis around the existing sql and logically ANDed condition.
//! The function returns a SQL condition incl. a leading where clause with optional parenthesis around the existing sql and logically ANDed condition.
boolean
argWhrFlg
=
false
;
boolean
argWhrFlg
=
false
;
if
(!
StringUtils
.
isEmpty
(
argSql
)
&&
(
argSql
.
startsWith
(
"WHERE"
)
||
argSql
.
startsWith
(
"where"
)))
{
// if (!StringUtils.isEmpty(argSql) && (argSql.startsWith("WHERE") || argSql.startsWith("where"))) {
if
(!
StringUtils
.
isEmpty
(
argSql
)
&&
(
argSql
.
matches
(
"(?i) *where.*"
)))
{
argWhrFlg
=
true
;
argWhrFlg
=
true
;
}
else
{
}
else
{
argWhrFlg
=
false
;
argWhrFlg
=
false
;
...
@@ -412,10 +413,10 @@ public class Utils {
...
@@ -412,10 +413,10 @@ public class Utils {
if
(
argWhrFlg
||
StringUtils
.
isEmpty
(
argSql
))
{
if
(
argWhrFlg
||
StringUtils
.
isEmpty
(
argSql
))
{
// if the passed sql is empty or already holds the where clause
// if the passed sql is empty or already holds the where clause
// the argument is directly returned
// the argument is directly returned
sql
=
StringUtils
.
trim
(
argSql
)
;
sql
=
argSql
;
}
else
{
}
else
{
// if no where was passed it has to be added
// if no where was passed it has to be added
sql
=
"WHERE "
+
StringUtils
.
trim
(
argSql
)
;
sql
=
"WHERE "
+
argSql
;
}
}
}
else
{
}
else
{
// If one of the two fields exists, the necessary query has to be
// If one of the two fields exists, the necessary query has to be
...
@@ -423,12 +424,13 @@ public class Utils {
...
@@ -423,12 +424,13 @@ public class Utils {
// beginning of the query, if no where clause exists.
// beginning of the query, if no where clause exists.
// In both cases the rest of the command has to be put into brakets.
// In both cases the rest of the command has to be put into brakets.
if
(
argWhrFlg
)
{
if
(
argWhrFlg
)
{
sql
=
"WHERE "
+
argCon
+
" and ( "
+
argSql
.
substring
(
5
)
+
" )"
;
String
upsql
=
argSql
.
toUpperCase
();
sql
=
"WHERE "
+
argCon
+
" and ( "
+
argSql
.
substring
(
upsql
.
lastIndexOf
(
"WHERE"
)+
5
)
+
" )"
;
}
else
{
}
else
{
if
(
MdaUtils
.
isEmpty
(
argSql
))
{
if
(
MdaUtils
.
isEmpty
(
argSql
))
{
sql
=
"WHERE "
+
argCon
;
sql
=
"WHERE "
+
argCon
;
}
else
{
}
else
{
sql
=
"WHERE "
+
argCon
+
" and ( "
+
StringUtils
.
trim
(
argSql
)
+
" )"
;
sql
=
"WHERE "
+
argCon
+
" and ( "
+
argSql
+
" )"
;
}
}
}
}
}
}
...
...
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