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
JSH ERP
Commits
99e7db36
Commit
99e7db36
authored
Jun 09, 2021
by
季圣华
Browse files
日期和sql优化
parent
f04dcd22
Changes
30
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/constants/BusinessConstants.java
View file @
99e7db36
...
...
@@ -13,6 +13,14 @@ public class BusinessConstants {
* 默认的日期格式
*/
public
static
final
String
DEFAULT_DATETIME_FORMAT
=
"yyyy-MM-dd HH:mm:ss"
;
/**
* 一天的初始时间
*/
public
static
final
String
DAY_FIRST_TIME
=
" 00:00:00"
;
/**
* 一天的结束时间
*/
public
static
final
String
DAY_LAST_TIME
=
" 23:59:59"
;
/**
* 默认的分页起始页页码
*/
...
...
jshERP-boot/src/main/java/com/jsh/erp/controller/AccountHeadController.java
View file @
99e7db36
package
com.jsh.erp.controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jsh.erp.constants.BusinessConstants
;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.datasource.entities.AccountHeadVo4Body
;
import
com.jsh.erp.datasource.entities.AccountHeadVo4ListEx
;
...
...
@@ -76,7 +77,7 @@ public class AccountHeadController {
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
try
{
JSONObject
outer
=
new
JSONObject
();
endTime
=
endTime
+
" 23:59:59"
;
endTime
=
endTime
+
BusinessConstants
.
DAY_LAST_TIME
;
BigDecimal
sum
=
accountHeadService
.
findTotalPay
(
supplierId
,
endTime
,
supType
);
outer
.
put
(
"getAllMoney"
,
sum
);
map
.
put
(
"rows"
,
outer
);
...
...
jshERP-boot/src/main/java/com/jsh/erp/controller/DepotHeadController.java
View file @
99e7db36
...
...
@@ -2,6 +2,7 @@ package com.jsh.erp.controller;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jsh.erp.constants.BusinessConstants
;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.datasource.entities.DepotHead
;
import
com.jsh.erp.datasource.entities.DepotHeadVo4Body
;
...
...
@@ -96,6 +97,8 @@ public class DepotHeadController {
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
try
{
List
<
DepotHeadVo4InDetail
>
resList
=
new
ArrayList
<
DepotHeadVo4InDetail
>();
beginTime
=
Tools
.
parseDayToTime
(
beginTime
,
BusinessConstants
.
DAY_FIRST_TIME
);
endTime
=
Tools
.
parseDayToTime
(
endTime
,
BusinessConstants
.
DAY_LAST_TIME
);
List
<
DepotHeadVo4InDetail
>
list
=
depotHeadService
.
findByAll
(
beginTime
,
endTime
,
type
,
materialParam
,
depotId
,
oId
,
(
currentPage
-
1
)*
pageSize
,
pageSize
);
int
total
=
depotHeadService
.
findByAllCount
(
beginTime
,
endTime
,
type
,
materialParam
,
depotId
,
oId
);
map
.
put
(
"total"
,
total
);
...
...
@@ -143,8 +146,8 @@ public class DepotHeadController {
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
try
{
List
<
DepotHeadVo4InOutMCount
>
resList
=
new
ArrayList
<>();
beginTime
=
beginTime
+
" 00:00:00"
;
endTime
=
endTime
+
" 23:59:59"
;
beginTime
=
Tools
.
parseDayToTime
(
beginTime
,
BusinessConstants
.
DAY_FIRST_TIME
)
;
endTime
=
Tools
.
parseDayToTime
(
endTime
,
BusinessConstants
.
DAY_LAST_TIME
)
;
List
<
DepotHeadVo4InOutMCount
>
list
=
depotHeadService
.
findInOutMaterialCount
(
beginTime
,
endTime
,
type
,
materialParam
,
depotId
,
oId
,
(
currentPage
-
1
)*
pageSize
,
pageSize
);
int
total
=
depotHeadService
.
findInOutMaterialCountTotal
(
beginTime
,
endTime
,
type
,
materialParam
,
depotId
,
oId
);
map
.
put
(
"total"
,
total
);
...
...
@@ -193,8 +196,8 @@ public class DepotHeadController {
}
else
if
(
supType
.
equals
(
"供应商"
))
{
//供应商
j
=
-
1
;
}
beginTime
=
beginTime
+
" 00:00:00"
;
endTime
=
endTime
+
" 23:59:59"
;
beginTime
=
Tools
.
parseDayToTime
(
beginTime
,
BusinessConstants
.
DAY_FIRST_TIME
)
;
endTime
=
Tools
.
parseDayToTime
(
endTime
,
BusinessConstants
.
DAY_LAST_TIME
)
;
List
<
DepotHeadVo4StatementAccount
>
resList
=
new
ArrayList
<
DepotHeadVo4StatementAccount
>();
List
<
DepotHeadVo4StatementAccount
>
list
=
depotHeadService
.
findStatementAccount
(
beginTime
,
endTime
,
organId
,
supType
,
(
currentPage
-
1
)*
pageSize
,
pageSize
);
int
total
=
depotHeadService
.
findStatementAccountCount
(
beginTime
,
endTime
,
organId
,
supType
);
...
...
@@ -277,7 +280,7 @@ public class DepotHeadController {
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
try
{
JSONObject
outer
=
new
JSONObject
();
endTime
=
endTime
+
" 23:59:59"
;
endTime
=
endTime
+
BusinessConstants
.
DAY_LAST_TIME
;
BigDecimal
sum
=
depotHeadService
.
findTotalPay
(
supplierId
,
endTime
,
supType
);
outer
.
put
(
"getAllMoney"
,
sum
);
map
.
put
(
"rows"
,
outer
);
...
...
@@ -369,8 +372,8 @@ public class DepotHeadController {
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
try
{
String
today
=
Tools
.
getNow
()
+
" 00:00:00"
;
String
firstDay
=
Tools
.
getCurrentMonth
()
+
"-01 00:00:00"
;
String
today
=
Tools
.
getNow
()
+
BusinessConstants
.
DAY_FIRST_TIME
;
String
firstDay
=
Tools
.
firstDayOfMonth
(
Tools
.
getCurrentMonth
()
)
+
BusinessConstants
.
DAY_FIRST_TIME
;
BigDecimal
todaySale
=
depotHeadService
.
getBuyAndSaleStatistics
(
"出库"
,
"销售"
,
1
,
today
,
getNow3
());
//今日销售出库
BigDecimal
todayRetailSale
=
depotHeadService
.
getBuyAndSaleRetailStatistics
(
"出库"
,
"零售"
,
...
...
jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java
View file @
99e7db36
...
...
@@ -265,8 +265,8 @@ public class DepotItemController {
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Long
tenantId
=
redisService
.
getTenantId
(
request
);
String
timeA
=
monthTime
+
"-01 00:00:00"
;
String
timeB
=
Tools
.
lastDayOfMonth
(
monthTime
)
+
" 23:59:59"
;
String
timeA
=
Tools
.
firstDayOfMonth
(
monthTime
)
+
BusinessConstants
.
DAY_FIRST_TIME
;
String
timeB
=
Tools
.
lastDayOfMonth
(
monthTime
)
+
BusinessConstants
.
DAY_LAST_TIME
;
try
{
List
<
DepotItemVo4WithInfoEx
>
dataList
=
depotItemService
.
findByAll
(
StringUtil
.
toNull
(
materialParam
),
timeB
,(
currentPage
-
1
)*
pageSize
,
pageSize
);
...
...
@@ -335,8 +335,8 @@ public class DepotItemController {
@RequestParam
(
"materialParam"
)
String
materialParam
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
Long
tenantId
=
redisService
.
getTenantId
(
request
);
String
timeA
=
monthTime
+
"-01 00:00:00"
;
String
timeB
=
Tools
.
lastDayOfMonth
(
monthTime
)
+
" 23:59:59"
;
String
timeA
=
Tools
.
firstDayOfMonth
(
monthTime
)
+
BusinessConstants
.
DAY_FIRST_TIME
;
String
timeB
=
Tools
.
lastDayOfMonth
(
monthTime
)
+
BusinessConstants
.
DAY_LAST_TIME
;
try
{
List
<
DepotItemVo4WithInfoEx
>
dataList
=
depotItemService
.
findByAll
(
StringUtil
.
toNull
(
materialParam
),
timeB
,
null
,
null
);
...
...
@@ -385,7 +385,7 @@ public class DepotItemController {
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Long
tenantId
=
redisService
.
getTenantId
(
request
);
String
endTime
=
Tools
.
lastDayOfMonth
(
monthTime
)
+
" 23:59:59"
;
String
endTime
=
Tools
.
lastDayOfMonth
(
monthTime
)
+
BusinessConstants
.
DAY_LAST_TIME
;
try
{
List
<
DepotItemVo4WithInfoEx
>
dataList
=
depotItemService
.
findByAll
(
StringUtil
.
toNull
(
materialParam
),
endTime
,
null
,
null
);
...
...
@@ -431,7 +431,7 @@ public class DepotItemController {
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
String
endTime
=
Tools
.
lastDayOfMonth
(
monthTime
)
+
" 23:59:59"
;
String
endTime
=
Tools
.
lastDayOfMonth
(
monthTime
)
+
BusinessConstants
.
DAY_LAST_TIME
;
try
{
List
<
DepotItemVo4WithInfoEx
>
dataList
=
depotItemService
.
findByAll
(
StringUtil
.
toNull
(
materialParam
),
endTime
,
(
currentPage
-
1
)*
pageSize
,
pageSize
);
...
...
@@ -493,7 +493,7 @@ public class DepotItemController {
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
String
endTime
=
Tools
.
lastDayOfMonth
(
monthTime
)
+
" 23:59:59"
;
String
endTime
=
Tools
.
lastDayOfMonth
(
monthTime
)
+
BusinessConstants
.
DAY_LAST_TIME
;
try
{
List
<
DepotItemVo4WithInfoEx
>
dataList
=
depotItemService
.
findByAll
(
StringUtil
.
toNull
(
materialParam
),
endTime
,(
currentPage
-
1
)*
pageSize
,
pageSize
);
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/account/AccountService.java
View file @
99e7db36
...
...
@@ -272,9 +272,9 @@ public class AccountService {
try
{
DepotHeadExample
example
=
new
DepotHeadExample
();
if
(!
timeStr
.
equals
(
""
))
{
Date
bTime
=
StringUtil
.
getDateByString
(
timeStr
+
"-01 00:00:00"
,
null
);
Date
eTime
=
StringUtil
.
getDateByString
(
timeStr
+
"-31 00:00:00"
,
null
);
Date
mTime
=
StringUtil
.
getDateByString
(
timeStr
+
"-01 00:00:00"
,
null
);
Date
bTime
=
StringUtil
.
getDateByString
(
Tools
.
firstDayOfMonth
(
timeStr
)
+
BusinessConstants
.
DAY_FIRST_TIME
,
null
);
Date
eTime
=
StringUtil
.
getDateByString
(
Tools
.
lastDayOfMonth
(
timeStr
)
+
BusinessConstants
.
DAY_LAST_TIME
,
null
);
Date
mTime
=
StringUtil
.
getDateByString
(
Tools
.
firstDayOfMonth
(
timeStr
)
+
BusinessConstants
.
DAY_FIRST_TIME
,
null
);
if
(
type
.
equals
(
"month"
))
{
example
.
createCriteria
().
andAccountIdEqualTo
(
id
).
andPayTypeNotEqualTo
(
"预付款"
)
.
andOperTimeGreaterThanOrEqualTo
(
bTime
).
andOperTimeLessThanOrEqualTo
(
eTime
)
...
...
@@ -317,9 +317,9 @@ public class AccountService {
try
{
AccountHeadExample
example
=
new
AccountHeadExample
();
if
(!
timeStr
.
equals
(
""
))
{
Date
bTime
=
StringUtil
.
getDateByString
(
timeStr
+
"-01 00:00:00"
,
null
);
Date
eTime
=
StringUtil
.
getDateByString
(
timeStr
+
"-31 00:00:00"
,
null
);
Date
mTime
=
StringUtil
.
getDateByString
(
timeStr
+
"-01 00:00:00"
,
null
);
Date
bTime
=
StringUtil
.
getDateByString
(
Tools
.
firstDayOfMonth
(
timeStr
)
+
BusinessConstants
.
DAY_FIRST_TIME
,
null
);
Date
eTime
=
StringUtil
.
getDateByString
(
Tools
.
lastDayOfMonth
(
timeStr
)
+
BusinessConstants
.
DAY_LAST_TIME
,
null
);
Date
mTime
=
StringUtil
.
getDateByString
(
Tools
.
firstDayOfMonth
(
timeStr
)
+
BusinessConstants
.
DAY_FIRST_TIME
,
null
);
if
(
type
.
equals
(
"month"
))
{
example
.
createCriteria
().
andAccountIdEqualTo
(
id
)
.
andBillTimeGreaterThanOrEqualTo
(
bTime
).
andBillTimeLessThanOrEqualTo
(
eTime
)
...
...
@@ -363,9 +363,9 @@ public class AccountService {
try
{
AccountHeadExample
example
=
new
AccountHeadExample
();
if
(!
timeStr
.
equals
(
""
))
{
Date
bTime
=
StringUtil
.
getDateByString
(
timeStr
+
"-01 00:00:00"
,
null
);
Date
eTime
=
StringUtil
.
getDateByString
(
timeStr
+
"-31 00:00:00"
,
null
);
Date
mTime
=
StringUtil
.
getDateByString
(
timeStr
+
"-01 00:00:00"
,
null
);
Date
bTime
=
StringUtil
.
getDateByString
(
Tools
.
firstDayOfMonth
(
timeStr
)
+
BusinessConstants
.
DAY_FIRST_TIME
,
null
);
Date
eTime
=
StringUtil
.
getDateByString
(
Tools
.
lastDayOfMonth
(
timeStr
)
+
BusinessConstants
.
DAY_LAST_TIME
,
null
);
Date
mTime
=
StringUtil
.
getDateByString
(
Tools
.
firstDayOfMonth
(
timeStr
)
+
BusinessConstants
.
DAY_FIRST_TIME
,
null
);
if
(
type
.
equals
(
"month"
))
{
example
.
createCriteria
().
andBillTimeGreaterThanOrEqualTo
(
bTime
).
andBillTimeLessThanOrEqualTo
(
eTime
)
.
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
...
...
@@ -422,9 +422,9 @@ public class AccountService {
try
{
DepotHeadExample
example
=
new
DepotHeadExample
();
if
(!
timeStr
.
equals
(
""
))
{
Date
bTime
=
StringUtil
.
getDateByString
(
timeStr
+
"-01 00:00:00"
,
null
);
Date
eTime
=
StringUtil
.
getDateByString
(
timeStr
+
"-31 00:00:00"
,
null
);
Date
mTime
=
StringUtil
.
getDateByString
(
timeStr
+
"-01 00:00:00"
,
null
);
Date
bTime
=
StringUtil
.
getDateByString
(
Tools
.
firstDayOfMonth
(
timeStr
)
+
BusinessConstants
.
DAY_FIRST_TIME
,
null
);
Date
eTime
=
StringUtil
.
getDateByString
(
Tools
.
lastDayOfMonth
(
timeStr
)
+
BusinessConstants
.
DAY_LAST_TIME
,
null
);
Date
mTime
=
StringUtil
.
getDateByString
(
Tools
.
firstDayOfMonth
(
timeStr
)
+
BusinessConstants
.
DAY_FIRST_TIME
,
null
);
if
(
type
.
equals
(
"month"
))
{
example
.
createCriteria
().
andAccountIdListLike
(
"%"
+
id
.
toString
()
+
"%"
)
.
andOperTimeGreaterThanOrEqualTo
(
bTime
).
andOperTimeLessThanOrEqualTo
(
eTime
)
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java
View file @
99e7db36
...
...
@@ -15,6 +15,7 @@ import com.jsh.erp.service.log.LogService;
import
com.jsh.erp.service.orgaUserRel.OrgaUserRelService
;
import
com.jsh.erp.service.user.UserService
;
import
com.jsh.erp.utils.StringUtil
;
import
com.jsh.erp.utils.Tools
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Service
;
...
...
@@ -88,6 +89,8 @@ public class AccountHeadService {
List
<
AccountHeadVo4ListEx
>
list
=
null
;
try
{
String
[]
creatorArray
=
getCreatorArray
(
roleType
);
beginTime
=
Tools
.
parseDayToTime
(
beginTime
,
BusinessConstants
.
DAY_FIRST_TIME
);
endTime
=
Tools
.
parseDayToTime
(
endTime
,
BusinessConstants
.
DAY_LAST_TIME
);
list
=
accountHeadMapperEx
.
selectByConditionAccountHead
(
type
,
creatorArray
,
billNo
,
beginTime
,
endTime
,
offset
,
rows
);
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
...
...
@@ -111,6 +114,8 @@ public class AccountHeadService {
Long
result
=
null
;
try
{
String
[]
creatorArray
=
getCreatorArray
(
roleType
);
beginTime
=
Tools
.
parseDayToTime
(
beginTime
,
BusinessConstants
.
DAY_FIRST_TIME
);
endTime
=
Tools
.
parseDayToTime
(
endTime
,
BusinessConstants
.
DAY_LAST_TIME
);
result
=
accountHeadMapperEx
.
countsByAccountHead
(
type
,
creatorArray
,
billNo
,
beginTime
,
endTime
);
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
View file @
99e7db36
...
...
@@ -24,6 +24,7 @@ import com.jsh.erp.service.serialNumber.SerialNumberService;
import
com.jsh.erp.service.supplier.SupplierService
;
import
com.jsh.erp.service.user.UserService
;
import
com.jsh.erp.utils.StringUtil
;
import
com.jsh.erp.utils.Tools
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Service
;
...
...
@@ -101,6 +102,8 @@ public class DepotHeadService {
String
[]
creatorArray
=
getCreatorArray
(
roleType
);
Map
<
Long
,
String
>
personMap
=
personService
.
getPersonMap
();
Map
<
Long
,
String
>
accountMap
=
accountService
.
getAccountMap
();
beginTime
=
Tools
.
parseDayToTime
(
beginTime
,
BusinessConstants
.
DAY_FIRST_TIME
);
endTime
=
Tools
.
parseDayToTime
(
endTime
,
BusinessConstants
.
DAY_LAST_TIME
);
list
=
depotHeadMapperEx
.
selectByConditionDepotHead
(
type
,
subType
,
creatorArray
,
status
,
number
,
beginTime
,
endTime
,
materialParam
,
depotIds
,
offset
,
rows
);
if
(
null
!=
list
)
{
for
(
DepotHeadVo4List
dh
:
list
)
{
...
...
@@ -144,6 +147,8 @@ public class DepotHeadService {
try
{
String
depotIds
=
depotService
.
findDepotStrByCurrentUser
();
String
[]
creatorArray
=
getCreatorArray
(
roleType
);
beginTime
=
Tools
.
parseDayToTime
(
beginTime
,
BusinessConstants
.
DAY_FIRST_TIME
);
endTime
=
Tools
.
parseDayToTime
(
endTime
,
BusinessConstants
.
DAY_LAST_TIME
);
result
=
depotHeadMapperEx
.
countsByDepotHead
(
type
,
subType
,
creatorArray
,
status
,
number
,
beginTime
,
endTime
,
materialParam
,
depotIds
);
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java
View file @
99e7db36
...
...
@@ -263,8 +263,8 @@ public class DepotItemService {
public
BigDecimal
buyOrSale
(
String
type
,
String
subType
,
Long
MId
,
String
monthTime
,
String
sumType
)
throws
Exception
{
BigDecimal
result
=
BigDecimal
.
ZERO
;
try
{
String
beginTime
=
monthTime
+
"-01 00:00:00"
;
String
endTime
=
Tools
.
lastDayOfMonth
(
monthTime
)
+
" 23:59:59"
;
String
beginTime
=
Tools
.
firstDayOfMonth
(
monthTime
)
+
BusinessConstants
.
DAY_FIRST_TIME
;
String
endTime
=
Tools
.
lastDayOfMonth
(
monthTime
)
+
BusinessConstants
.
DAY_LAST_TIME
;
if
(
SUM_TYPE
.
equals
(
sumType
))
{
result
=
depotItemMapperEx
.
buyOrSaleNumber
(
type
,
subType
,
MId
,
beginTime
,
endTime
,
sumType
);
}
else
{
...
...
@@ -288,8 +288,8 @@ public class DepotItemService {
public
BigDecimal
inOrOutPrice
(
String
type
,
String
subType
,
String
month
)
throws
Exception
{
BigDecimal
result
=
BigDecimal
.
ZERO
;
try
{
String
beginTime
=
month
+
"-01 00:00:00"
;
String
endTime
=
Tools
.
lastDayOfMonth
(
month
)
+
" 23:59:59"
;
String
beginTime
=
Tools
.
firstDayOfMonth
(
month
)
+
BusinessConstants
.
DAY_FIRST_TIME
;
String
endTime
=
Tools
.
lastDayOfMonth
(
month
)
+
BusinessConstants
.
DAY_LAST_TIME
;
result
=
depotItemMapperEx
.
inOrOutPrice
(
type
,
subType
,
beginTime
,
endTime
);
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
...
...
jshERP-boot/src/main/java/com/jsh/erp/utils/Tools.java
View file @
99e7db36
...
...
@@ -85,6 +85,14 @@ public class Tools {
return
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
date
);
}
public
static
String
parseDayToTime
(
String
day
,
String
timeStr
)
{
if
(
StringUtil
.
isNotEmpty
(
day
)){
return
day
+
timeStr
;
}
else
{
return
null
;
}
}
/**
* 获得指定时间,格式为mm:ss
*
...
...
@@ -134,7 +142,7 @@ public class Tools {
/**
* 判断字符串是否全部为数字
*
* @param
accountWaste
* @param
checkStr
* @return boolean值
*/
public
static
boolean
checkStrIsNum
(
String
checkStr
)
{
...
...
@@ -434,7 +442,7 @@ public class Tools {
/**
* 获取当前日期的前XX个月
*
* @param
之前的第几个月
* @param
beforeMonth
* @return 前XX个月字符串
*/
public
static
String
getBeforeMonth
(
int
beforeMonth
)
{
...
...
@@ -443,6 +451,16 @@ public class Tools {
return
new
SimpleDateFormat
(
"yyyy-MM"
).
format
(
c
.
getTime
());
}
/**
* 根据月份获取当月第一天
* @param monthTime
* @return
* @throws ParseException
*/
public
static
String
firstDayOfMonth
(
String
monthTime
)
throws
ParseException
{
return
monthTime
+
"-01"
;
}
/**
* 根据月份获取当月最后一天
* @param monthTime
...
...
@@ -461,7 +479,7 @@ public class Tools {
/**
* 获取email用户姓名
*
* @param
arg
s
* @param
emailAddres
s
*/
public
static
String
getEmailUserName
(
String
emailAddress
)
{
return
emailAddress
.
substring
(
0
,
emailAddress
.
lastIndexOf
(
"@"
));
...
...
@@ -470,7 +488,7 @@ public class Tools {
/**
* 获取中文编码,邮件附件乱码问题解决
*
* @param
str
* @param
emailAttchmentTitle
* @return
*/
public
static
String
getChineseString
(
String
emailAttchmentTitle
)
{
...
...
@@ -501,7 +519,7 @@ public class Tools {
/**
* 模糊判断电话号码是否合法,只能是数字
*
* @param
macAddress
* @param
userTel
* @return
*/
public
static
boolean
isTelNumberBySlur
(
String
userTel
)
{
...
...
jshERP-boot/src/main/resources/mapper_xml/AccountHeadMapperEx.xml
View file @
99e7db36
...
...
@@ -18,16 +18,17 @@
left join jsh_account a on ah.account_id=a.id and ifnull(a.delete_Flag,'0') !='1'
where 1=1
<if
test=
"billNo != null"
>
and ah.bill_no like '%${billNo}%'
<bind
name=
"bindBillNo"
value=
"'%'+billNo+'%'"
/>
and ah.bill_no like #{bindBillNo}
</if>
<if
test=
"type != null"
>
and ah.type=
'$
{type}
'
and ah.type=
#
{type}
</if>
<if
test=
"beginTime != null"
>
and ah.bill_time
>
=
'$
{beginTime}
00:00:00'
and ah.bill_time
>
=
#
{beginTime}
</if>
<if
test=
"endTime != null"
>
and ah.bill_time
<
=
'$
{endTime}
23:59:59'
and ah.bill_time
<
=
#
{endTime}
</if>
<if
test=
"creatorArray != null"
>
and ah.creator in (
...
...
@@ -50,16 +51,17 @@
FROM jsh_account_head
WHERE 1=1
<if
test=
"billNo != null"
>
and bill_no like '%${billNo}%'
<bind
name=
"bindBillNo"
value=
"'%'+billNo+'%'"
/>
and bill_no like #{bindBillNo}
</if>
<if
test=
"type != null"
>
and type=
'$
{type}
'
and type=
#
{type}
</if>
<if
test=
"beginTime != null"
>
and bill_time
>
=
'$
{beginTime}
00:00:00'
and bill_time
>
=
#
{beginTime}
</if>
<if
test=
"endTime != null"
>
and bill_time
<
=
'$
{endTime}
23:59:59'
and bill_time
<
=
#
{endTime}
</if>
<if
test=
"creatorArray != null"
>
and creator in (
...
...
@@ -73,8 +75,8 @@
<select
id=
"findAllMoney"
resultType=
"java.math.BigDecimal"
>
select sum(${modeName}) as allMoney from jsh_account_head
where type=
'$
{type}
'
and organ_id =
$
{supplierId} and bill_time
<![CDATA[ <='$
{endTime}
']]>
where type=
#
{type}
and organ_id =
#
{supplierId} and bill_time
<
= #
{endTime}
and ifnull(delete_flag,'0') !='1'
</select>
...
...
@@ -86,7 +88,7 @@
left join jsh_account a on ah.account_id=a.id and ifnull(a.delete_Flag,'0') !='1'
where 1=1
<if
test=
"billNo != null"
>
and ah.bill_no =
'$
{billNo}
'
and ah.bill_no =
#
{billNo}
</if>
and ifnull(ah.delete_flag,'0') !='1'
</select>
...
...
jshERP-boot/src/main/resources/mapper_xml/AccountItemMapperEx.xml
View file @
99e7db36
...
...
@@ -12,13 +12,15 @@
FROM jsh_account_item
where 1=1
<if
test=
"name != null"
>
and name like '%${name}%'
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and name like #{bindName}
</if>
<if
test=
"type != null"
>
and type=
$
{type}
and type=
#
{type}
</if>
<if
test=
"remark != null"
>
and remark like '%${remark}%'
<bind
name=
"bindRemark"
value=
"'%'+remark+'%'"
/>
and remark like #{bindRemark}
</if>
and ifnull(delete_flag,'0') !='1'
<if
test=
"offset != null and rows != null"
>
...
...
@@ -31,13 +33,15 @@
FROM jsh_account_item
WHERE 1=1
<if
test=
"name != null"
>
and name like '%${name}%'
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and name like #{bindName}
</if>
<if
test=
"type != null"
>
and type=
$
{type}
and type=
#
{type}
</if>
<if
test=
"remark != null"
>
and remark like '%${remark}%'
<bind
name=
"bindRemark"
value=
"'%'+remark+'%'"
/>
and remark like #{bindRemark}
</if>
and ifnull(delete_flag,'0') !='1'
</select>
...
...
@@ -46,7 +50,7 @@
select ai.*,a.Name AccountName,ioi.Name InOutItemName
from jsh_account_item ai left join jsh_account a on ai.account_id=a.id and ifnull(a.delete_Flag,'0') !='1'
left join jsh_in_out_item ioi on ai.in_out_item_id = ioi.id and ifnull(ioi.delete_Flag,'0') !='1'
where ai.header_id =
$
{headerId}
where ai.header_id =
#
{headerId}
and ifnull(ai.delete_flag,'0') !='1'
order by ai.id asc
</select>
...
...
jshERP-boot/src/main/resources/mapper_xml/AccountMapperEx.xml
View file @
99e7db36
...
...
@@ -35,13 +35,16 @@
FROM jsh_account
where 1=1
<if
test=
"name != null"
>
and name like '%${name}%'
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and name like #{bindName}
</if>
<if
test=
"serialNo != null"
>
and serial_no like '%${serialNo}%'
<if
test=
"serialNo != null and serialNo !=''"
>
<bind
name=
"bindSerialNo"
value=
"'%'+serialNo+'%'"
/>
and serial_no like #{bindSerialNo}
</if>
<if
test=
"remark != null"
>
and remark like '%${remark}%'
<bind
name=
"bindRemark"
value=
"'%'+remark+'%'"
/>
and remark like #{bindRemark}
</if>
and ifnull(delete_flag,'0') !='1'
<if
test=
"offset != null and rows != null"
>
...
...
@@ -55,13 +58,16 @@
FROM jsh_account
WHERE 1=1
<if
test=
"name != null"
>
and name like '%${name}%'
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and name like #{bindName}
</if>
<if
test=
"serialNo != null"
>
and serial_no like '%${serialNo}%'
<if
test=
"serialNo != null and serialNo !=''"
>
<bind
name=
"bindSerialNo"
value=
"'%'+serialNo+'%'"
/>
and serial_no like #{bindSerialNo}
</if>
<if
test=
"remark != null"
>
and remark like '%${remark}%'
<bind
name=
"bindRemark"
value=
"'%'+remark+'%'"
/>
and remark like #{bindRemark}
</if>
and ifnull(delete_flag,'0') !='1'
</select>
...
...
@@ -72,7 +78,7 @@
from jsh_depot_head dh left join jsh_supplier s on dh.organ_id = s.id and ifnull(s.delete_flag,'0') !='1'
where 1=1
<if
test=
"accountId != null"
>
and dh.account_id=
$
{accountId}
and dh.account_id=
#
{accountId}
</if>
and ifnull(dh.delete_flag,'0') !='1'
...
...
@@ -82,7 +88,7 @@
from jsh_account_head ah left join jsh_supplier s on ah.organ_id=s.id and ifnull(s.delete_flag,'0') !='1'
where 1=1
<if
test=
"accountId != null"
>
and ah.account_id=
$
{accountId}
and ah.account_id=
#
{accountId}
</if>
and ifnull(ah.delete_flag,'0') !='1'
<!--明细中涉及的账户(收款,付款,收预付款) -->
...
...
@@ -92,7 +98,7 @@
inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1'
where ah.type in ('收款','付款','收预付款')
<if
test=
"accountId != null"
>
and ai.account_id=
$
{accountId}
and ai.account_id=
#
{accountId}
</if>
and ifnull(ah.delete_flag,'0') !='1'
<!--主表中转出的账户 -->
...
...
@@ -101,7 +107,7 @@
from jsh_account_head ah inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1'
where ah.type='转账'
<if
test=
"accountId != null"
>
and ah.account_id=
$
{accountId}
and ah.account_id=
#
{accountId}
</if>
and ifnull(ah.delete_flag,'0') !='1'
<!--明细中被转入的账户 -->
...
...
@@ -110,7 +116,7 @@
from jsh_account_head ah inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1'
where ah.type='转账'
<if
test=
"accountId != null"
>
and ai.account_id=
$
{accountId}
and ai.account_id=
#
{accountId}
</if>
and ifnull(ah.delete_flag,'0') !='1'
<!--多账户的情况 -->
...
...
@@ -120,7 +126,8 @@
from jsh_depot_head dh left join jsh_supplier s on dh.organ_id = s.id and ifnull(s.delete_flag,'0') !='1'
where 1=1
<if
test=
"accountId != null"
>
and dh.account_id_list like '%${accountId}%'
<bind
name=
"bindAccountId"
value=
"'%'+accountId+'%'"
/>
and dh.account_id_list like #{bindAccountId}
</if>
and ifnull(dh.delete_flag,'0') !='1'
ORDER BY oTime desc
...
...
@@ -137,7 +144,7 @@
from jsh_depot_head dh left join jsh_supplier s on dh.organ_id = s.id and ifnull(s.delete_flag,'0') !='1'
where 1=1
<if
test=
"accountId != null"
>
and dh.account_id=
$
{accountId}
and dh.account_id=
#
{accountId}
</if>
and ifnull(dh.delete_flag,'0') !='1'
<!--主表收入和支出涉及的账户 -->
...
...
@@ -146,7 +153,7 @@
from jsh_account_head ah left join jsh_supplier s on ah.organ_id=s.id and ifnull(s.delete_flag,'0') !='1'
where 1=1
<if
test=
"accountId != null"
>
and ah.account_id=
$
{accountId}
and ah.account_id=
#
{accountId}
</if>
and ifnull(ah.delete_flag,'0') !='1'
<!--明细中涉及的账户(收款,付款,收预付款) -->
...
...
@@ -156,7 +163,7 @@
inner join jsh_account_item ai on ai.header_id=ah.Id and ifnull(ai.delete_flag,'0') !='1'
where ah.Type in ('收款','付款','收预付款')
<if
test=
"accountId != null"
>
and ai.account_id=
$
{accountId}
and ai.account_id=
#
{accountId}
</if>
and ifnull(ah.delete_flag,'0') !='1'
<!--主表中转出的账户 -->
...
...
@@ -165,7 +172,7 @@
from jsh_account_head ah inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1'
where ah.type='转账'
<if
test=
"accountId != null"
>
and ah.account_id=
$
{accountId}
and ah.account_id=
#
{accountId}
</if>
and ifnull(ah.delete_flag,'0') !='1'
<!--明细中被转入的账户 -->
...
...
@@ -174,7 +181,7 @@
from jsh_account_head ah inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1'
where ah.type='转账'
<if
test=
"accountId != null"
>
and ai.account_id=
$
{accountId}
and ai.account_id=
#
{accountId}
</if>
and ifnull(ah.delete_flag,'0') !='1'
<!--多账户的情况 -->
...
...
@@ -183,7 +190,8 @@
from jsh_depot_head dh left join jsh_supplier s on dh.organ_id = s.id and ifnull(s.delete_flag,'0') !='1'
where 1=1
<if
test=
"accountId != null"
>
and dh.account_id_list like '%${accountId}%'
<bind
name=
"bindAccountId"
value=
"'%'+accountId+'%'"
/>
and dh.account_id_list like #{bindAccountId}
</if>
and ifnull(dh.delete_flag,'0') !='1'
) cc
...
...
jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml
View file @
99e7db36
...
...
@@ -52,29 +52,30 @@
left join jsh_material m on di.material_id = m.id and ifnull(m.delete_flag,'0') !='1'
where 1=1
<if
test=
"type != null"
>
and dh.type=
'$
{type}
'
and dh.type=
#
{type}
</if>
<if
test=
"subType != null"
>
and dh.sub_type=
'$
{subType}
'
and dh.sub_type=
#
{subType}
</if>
<if
test=
"status != null"
>
and dh.status =
'$
{status}
'
and dh.status =
#
{status}
</if>
<if
test=
"number != null"
>
and dh.number like '%${number}%'
<bind
name=
"bindNumber"
value=
"'%'+number+'%'"
/>
and dh.number like #{bindNumber}
</if>
<if
test=
"beginTime != null"
>
and dh.oper_time >=
'$
{beginTime}
00:00:00'
and dh.oper_time >=
#
{beginTime}
</if>
<if
test=
"endTime != null"
>
and dh.oper_time
<
=
'$
{endTime}
23:59:59'
and dh.oper_time
<
=
#
{endTime}
</if>
<if
test=
"materialParam != null and materialParam !=''"
>
<bind
name=
"bindKey"
value=
"'%'+materialParam+'%'"
/>
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
</if>
<if
test=
"depotIds != null and depotIds !=''"
>
and di.depot_id in (
$
{depotIds})
and di.depot_id in (
#
{depotIds})
</if>
<if
test=
"creatorArray != null"
>
and dh.creator in (
...
...
@@ -97,29 +98,30 @@
left join jsh_material m on di.material_id = m.Id and ifnull(m.delete_Flag,'0') !='1'
WHERE 1=1
<if
test=
"type != null"
>
and dh.type=
'$
{type}
'
and dh.type=
#
{type}
</if>
<if
test=
"subType != null"
>
and dh.sub_type=
'$
{subType}
'
and dh.sub_type=
#
{subType}
</if>
<if
test=
"status != null"
>
and dh.status =
'$
{status}
'
and dh.status =
#
{status}
</if>
<if
test=
"number != null"
>
and dh.number like '%${number}%'
<bind
name=
"bindNumber"
value=
"'%'+number+'%'"
/>
and dh.number like #{bindNumber}
</if>
<if
test=
"beginTime != null"
>
and dh.oper_time >=
'$
{beginTime}
00:00:00'
and dh.oper_time >=
#
{beginTime}
</if>
<if
test=
"endTime != null"
>
and dh.oper_time
<
=
'$
{endTime}
23:59:59'
and dh.oper_time
<
=
#
{endTime}
</if>
<if
test=
"materialParam != null and materialParam !=''"
>
<bind
name=
"bindKey"
value=
"'%'+materialParam+'%'"
/>
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
</if>
<if
test=
"depotIds != null and depotIds !=''"
>
and di.depot_id in (
$
{depotIds})
and di.depot_id in (
#
{depotIds})
</if>
<if
test=
"creatorArray != null"
>
and dh.creator in (
...
...
@@ -135,7 +137,7 @@
select group_concat(concat(jsh_material.name,' ',ifnull(jsh_material.standard,''),' ',ifnull(jsh_material.model,''))) as mName
from jsh_depot_item
inner join jsh_material on jsh_depot_item.material_id = jsh_material.Id and ifnull(jsh_material.delete_Flag,'0') !='1'
where jsh_depot_item.header_id =
$
{id}
where jsh_depot_item.header_id =
#
{id}
and ifnull(jsh_depot_item.delete_flag,'0') !='1'
</select>
...
...
@@ -147,15 +149,15 @@
inner join jsh_material m on m.id=di.material_id and ifnull(m.delete_flag,'0') !='1'
inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1'
inner join (select id,name as dName,delete_Flag from jsh_depot ) d on d.id=di.depot_id and ifnull(d.delete_Flag,'0') !='1'
where dh.oper_time >=
'$
{beginTime}
00:00:00'
and dh.oper_time
<
=
'$
{endTime}
23:59:59'
where dh.oper_time >=
#
{beginTime} and dh.oper_time
<
=
#
{endTime}
<if
test=
"oId != null"
>
and dh.organ_id =
$
{oId}
and dh.organ_id =
#
{oId}
</if>
<if
test=
"depotId != null"
>
and di.depot_id =
$
{depotId}
and di.depot_id =
#
{depotId}
</if>
<if
test=
"type != null"
>
and dh.type=
'$
{type}
'
and dh.type=
#
{type}
</if>
<if
test=
"materialParam != null and materialParam !=''"
>
<bind
name=
"bindKey"
value=
"'%'+materialParam+'%'"
/>
...
...
@@ -175,15 +177,15 @@
inner join jsh_material m on m.id=di.material_id and ifnull(m.delete_Flag,'0') !='1'
inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1'
inner join (select id,name as dName,delete_Flag from jsh_depot) d on d.id=di.depot_id and ifnull(d.delete_Flag,'0') !='1'
where dh.oper_time >=
'$
{beginTime}
00:00:00'
and dh.oper_time
<
=
'$
{endTime}
23:59:59'
where dh.oper_time >=
#
{beginTime} and dh.oper_time
<
=
#
{endTime}
<if
test=
"oId != null"
>
and dh.organ_id =
$
{oId}
and dh.organ_id =
#
{oId}
</if>
<if
test=
"depotId != null"
>
and di.depot_id =
$
{depotId}
and di.depot_id =
#
{depotId}
</if>
<if
test=
"type != null"
>
and dh.type=
'$
{type}
'
and dh.type=
#
{type}
</if>
<if
test=
"materialParam != null and materialParam !=''"
>
<bind
name=
"bindKey"
value=
"'%'+materialParam+'%'"
/>
...
...
@@ -198,24 +200,24 @@
(select sum(jdi.basic_number) numSum from jsh_depot_head jdh
INNER JOIN jsh_depot_item jdi on jdh.id=jdi.header_id and ifnull(jdi.delete_flag,'0') !='1'
where jdi.material_id=di.material_id
and jdh.type=
'$
{type}
'
and jdh.oper_time >=
'$
{beginTime}
'
and jdh.oper_time
<
=
'$
{endTime}
'
and jdh.type=
#
{type} and jdh.oper_time >=
#
{beginTime} and jdh.oper_time
<
=
#
{endTime}
<if
test=
"oId != null"
>
and jdh.organ_id =
$
{oId}
and jdh.organ_id =
#
{oId}
</if>
<if
test=
"depotId != null"
>
and jdi.depot_id =
$
{depotId}
and jdi.depot_id =
#
{depotId}
</if>
and ifnull(jdh.delete_flag,'0') !='1'
) numSum,
(select sum(jdi.all_price) priceSum from jsh_depot_head jdh
INNER JOIN jsh_depot_item jdi on jdh.id=jdi.header_id and ifnull(jdi.delete_flag,'0') !='1'
where jdi.material_id=di.material_id
and jdh.type=
'$
{type}
'
and jdh.oper_time >=
'$
{beginTime}
'
and jdh.oper_time
<
=
'$
{endTime}
'
and jdh.type=
#
{type} and jdh.oper_time >=
#
{beginTime} and jdh.oper_time
<
=
#
{endTime}
<if
test=
"oId != null"
>
and jdh.organ_id =
$
{oId}
and jdh.organ_id =
#
{oId}
</if>
<if
test=
"depotId != null"
>
and jdi.depot_id =
$
{depotId}
and jdi.depot_id =
#
{depotId}
</if>
and ifnull(jdh.delete_flag,'0') !='1'
) priceSum
...
...
@@ -226,12 +228,12 @@
LEFT JOIN jsh_material_category on jsh_material.category_id=jsh_material_category.Id and ifnull(jsh_material_category.delete_flag,'0') !='1'
where ifnull(jsh_material.delete_Flag,'0') !='1'
) m
on m.Id=di.material_id where dh.type=
'$
{type}
'
and dh.oper_time >=
'$
{beginTime}
'
and dh.oper_time
<
=
'$
{endTime}
'
on m.Id=di.material_id where dh.type=
#
{type} and dh.oper_time >=
#
{beginTime} and dh.oper_time
<
=
#
{endTime}
<if
test=
"oId != null"
>
and dh.organ_id =
$
{oId}
and dh.organ_id =
#
{oId}
</if>
<if
test=
"depotId != null"
>
and di.depot_id =
$
{depotId}
and di.depot_id =
#
{depotId}
</if>
<if
test=
"materialParam != null and materialParam !=''"
>
<bind
name=
"bindKey"
value=
"'%'+materialParam+'%'"
/>
...
...
@@ -252,12 +254,12 @@
from jsh_material
LEFT JOIN jsh_material_category on jsh_material.category_id=jsh_material_category.Id and ifnull(jsh_material_category.delete_flag,'0') !='1'
where ifnull(jsh_material.delete_Flag,'0') !='1'
) m on m.Id=di.material_id where dh.type=
'$
{type}
'
and dh.oper_time >=
'$
{beginTime}
'
and dh.oper_time
<
=
'$
{endTime}
'
) m on m.Id=di.material_id where dh.type=
#
{type} and dh.oper_time >=
#
{beginTime} and dh.oper_time
<
=
#
{endTime}
<if
test=
"oId != null"
>
and dh.organ_id =
$
{oId}
and dh.organ_id =
#
{oId}
</if>
<if
test=
"depotId != null"
>
and di.depot_id =
$
{depotId}
and di.depot_id =
#
{depotId}
</if>
<if
test=
"materialParam != null and materialParam !=''"
>
<bind
name=
"bindKey"
value=
"'%'+materialParam+'%'"
/>
...
...
@@ -271,20 +273,20 @@
select dh.number,concat(dh.sub_type,dh.type) as type,dh.discount_last_money,dh.other_money,dh.change_amount,s.supplier supplierName,
date_format(dh.oper_time,'%Y-%m-%d %H:%i:%S') as oTime from jsh_depot_head dh
inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1'
where s.type=
'$
{supType}
'
and (dh.sub_type!='其它' and dh.sub_type!='采购订单' and dh.sub_type!='销售订单')
and dh.oper_time >=
'$
{beginTime}
'
and dh.oper_time
<
=
'$
{endTime}
'
where s.type=
#
{supType} and (dh.sub_type!='其它' and dh.sub_type!='采购订单' and dh.sub_type!='销售订单')
and dh.oper_time >=
#
{beginTime} and dh.oper_time
<
=
#
{endTime}
<if
test=
"organId != null"
>
and dh.organ_id=
$
{organId}
and dh.organ_id=
#
{organId}
</if>
and ifnull(dh.delete_flag,'0') !='1'
UNION ALL
select ah.bill_no number,ah.type as newType,ah.total_price discount_last_money, 0 other_money,ah.change_amount,s.supplier supplierName,
date_format(ah.bill_time,'%Y-%m-%d %H:%i:%S') as oTime from jsh_account_head ah
inner join jsh_supplier s on s.id=ah.organ_id and ifnull(s.delete_Flag,'0') !='1'
where s.type=
'$
{supType}
'
and ah.bill_time >=
'$
{beginTime}
'
and ah.bill_time
<
=
'$
{endTime}
'
where s.type=
#
{supType}
and ah.bill_time >=
#
{beginTime} and ah.bill_time
<
=
#
{endTime}
<if
test=
"organId != null"
>
and ah.organ_id=
$
{organId}
and ah.organ_id=
#
{organId}
</if>
and ifnull(ah.delete_flag,'0') !='1'
ORDER BY oTime
...
...
@@ -298,33 +300,33 @@
(
select count(1) a from jsh_depot_head dh
inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1'
where s.type=
'$
{supType}
'
and (dh.sub_type!='其它' and dh.sub_type!='采购订单' and dh.sub_type!='销售订单')
and dh.oper_time >=
'$
{beginTime}
'
and dh.oper_time
<
=
'$
{endTime}
'
where s.type=
#
{supType} and (dh.sub_type!='其它' and dh.sub_type!='采购订单' and dh.sub_type!='销售订单')
and dh.oper_time >=
#
{beginTime} and dh.oper_time
<
=
#
{endTime}
<if
test=
"organId != null"
>
and dh.organ_id=
$
{organId}
and dh.organ_id=
#
{organId}
</if>
and ifnull(dh.delete_flag,'0') !='1'
UNION ALL
select count(1) a from jsh_account_head ah
inner join jsh_supplier s on s.id=ah.organ_id and ifnull(s.delete_Flag,'0') !='1'
where s.type=
'$
{supType}
'
and ah.bill_time >=
'$
{beginTime}
'
and ah.bill_time
<
=
'$
{endTime}
'
where s.type=
#
{supType}
and ah.bill_time >=
#
{beginTime} and ah.bill_time
<
=
#
{endTime}
<if
test=
"organId != null"
>
and ah.organ_id=
$
{organId}
and ah.organ_id=
#
{organId}
</if>
and ifnull(ah.delete_flag,'0') !='1'
) cc
</select>
<select
id=
"findAllMoney"
resultType=
"java.math.BigDecimal"
>
select ifnull(sum(${modeName}),0) as allMoney from jsh_depot_head where type=
'$
{type}
'
and sub_type =
'$
{subType}
'
and organ_id =
$
{supplierId} and oper_time
<
=
'$
{endTime}
'
select ifnull(sum(${modeName}),0) as allMoney from jsh_depot_head where type=
#
{type} and sub_type =
#
{subType}
and organ_id =
#
{supplierId} and oper_time
<
=
#
{endTime}
and ifnull(delete_flag,'0') !='1'
</select>
<select
id=
"findAllOtherMoney"
resultType=
"java.math.BigDecimal"
>
select ifnull(sum(other_money),0) as allOtherMoney from jsh_depot_head where type=
'$
{type}
'
and sub_type =
'$
{subType}
'
and organ_id =
$
{supplierId} and oper_time
<
=
'$
{endTime}
'
select ifnull(sum(other_money),0) as allOtherMoney from jsh_depot_head where type=
#
{type} and sub_type =
#
{subType}
and organ_id =
#
{supplierId} and oper_time
<
=
#
{endTime}
and ifnull(delete_flag,'0') !='1'
</select>
...
...
@@ -335,7 +337,7 @@
left join jsh_account a on dh.account_id=a.id and ifnull(a.delete_Flag,'0') !='1'
where 1=1
<if
test=
"number != null"
>
and dh.number=
'$
{number}
'
and dh.number=
#
{number}
</if>
and ifnull(dh.delete_flag,'0') !='1'
</select>
...
...
@@ -393,10 +395,10 @@
FROM jsh_depot_head
WHERE 1=1
<if
test=
"type != null"
>
and type=
'$
{type}
'
and type=
#
{type}
</if>
<if
test=
"subType != null"
>
and sub_type=
'$
{subType}
'
and sub_type=
#
{subType}
</if>
<if
test=
"hasSupplier == 1"
>
and organ_id is not null
...
...
@@ -405,10 +407,10 @@
and organ_id is null
</if>
<if
test=
"beginTime != null"
>
and oper_time >=
'$
{beginTime}
'
and oper_time >=
#
{beginTime}
</if>
<if
test=
"endTime != null"
>
and oper_time
<
=
'$
{endTime}
'
and oper_time
<
=
#
{endTime}
</if>
and ifnull(delete_flag,'0') !='1'
</select>
...
...
@@ -419,10 +421,10 @@
FROM jsh_depot_head
WHERE 1=1
<if
test=
"type != null"
>
and type=
'$
{type}
'
and type=
#
{type}
</if>
<if
test=
"subType != null"
>
and sub_type=
'$
{subType}
'
and sub_type=
#
{subType}
</if>
<if
test=
"hasSupplier == 1"
>
and organ_id is not null
...
...
@@ -431,10 +433,10 @@
and organ_id is null
</if>
<if
test=
"beginTime != null"
>
and oper_time >=
'$
{beginTime}
'
and oper_time >=
#
{beginTime}
</if>
<if
test=
"endTime != null"
>
and oper_time
<
=
'$
{endTime}
'
and oper_time
<
=
#
{endTime}
</if>
and ifnull(delete_flag,'0') !='1'
</select>
...
...
jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml
View file @
99e7db36
...
...
@@ -76,13 +76,15 @@
FROM jsh_depot_item
where 1=1
<if
test=
"name != null"
>
and name like '%${name}%'
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and name like #{bindName}
</if>
<if
test=
"type != null"
>
and type
=$
{type}
and type
= #
{type}
</if>
<if
test=
"remark != null"
>
and remark like '%${remark}%'
<bind
name=
"bindRemark"
value=
"'%'+remark+'%'"
/>
and remark like #{bindRemark}
</if>
and ifnull(delete_flag,'0') !='1'
<if
test=
"offset != null and rows != null"
>
...
...
@@ -96,13 +98,15 @@
FROM jsh_depot_item
WHERE 1=1
<if
test=
"name != null"
>
and name like '%${name}%'
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and name like #{bindName}
</if>
<if
test=
"type != null"
>
and type
=$
{type}
and type
= #
{type}
</if>
<if
test=
"remark != null"
>
and remark like '%${remark}%'
<bind
name=
"bindRemark"
value=
"'%'+remark+'%'"
/>
and remark like #{bindRemark}
</if>
and ifnull(delete_flag,'0') !='1'
</select>
...
...
@@ -128,7 +132,7 @@
or (dh.type='其它' and dh.sub_type='组装单')
or (dh.type='其它' and dh.sub_type='拆卸单')
or (dh.type='其它' and dh.sub_type='盘点复盘' and dh.Status=1))
and di.material_id =
$
{mId}
and di.material_id =
#
{mId}
and ifnull(dh.delete_flag,'0') !='1'
ORDER BY oTime desc
<if
test=
"offset != null and rows != null"
>
...
...
@@ -144,7 +148,7 @@
or (dh.type='其它' and dh.sub_type='组装单')
or (dh.type='其它' and dh.sub_type='拆卸单')
or (dh.type='其它' and dh.sub_type='盘点复盘' and dh.Status=1))
and di.material_id =
$
{mId}
and di.material_id =
#
{mId}
and ifnull(dh.delete_flag,'0') !='1'
</select>
...
...
@@ -158,7 +162,7 @@
left join jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1'
left join jsh_depot dp1 on di.depot_id=dp1.id and ifnull(dp1.delete_Flag,'0') !='1'
left join jsh_depot dp2 on di.another_depot_id=dp2.id and ifnull(dp2.delete_Flag,'0') !='1'
where di.header_id =
$
{headerId}
where di.header_id =
#
{headerId}
and ifnull(di.delete_flag,'0') !='1'
order by di.id asc
</select>
...
...
@@ -180,7 +184,7 @@
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
</if>
<if
test=
"endTime != null"
>
and dh.oper_time
<
=
'$
{endTime}
'
and dh.oper_time
<
=
#
{endTime}
</if>
and ifnull(m.delete_flag,'0') !='1'
group by m.id,m.name, m.model, m.unit, m.color, u.name
...
...
@@ -201,7 +205,7 @@
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
</if>
<if
test=
"endTime != null"
>
and dh.oper_time
<
=
'$
{endTime}
'
and dh.oper_time
<
=
#
{endTime}
</if>
and ifnull(di.delete_flag,'0') !='1'
group by m.id) cc
...
...
@@ -210,8 +214,8 @@
<select
id=
"buyOrSaleNumber"
resultType=
"java.math.BigDecimal"
>
select ifnull(sum(basic_number),0) as BasicNumber from jsh_depot_item di,jsh_depot_head dh
where di.header_id = dh.id
and dh.type=
'$
{type}
'
and dh.sub_type=
'$
{subType}
'
and di.material_id =
$
{MId}
and dh.type=
#
{type} and dh.sub_type=
#
{subType}
and di.material_id =
#
{MId}
and dh.oper_time
>
= #{beginTime}
and dh.oper_time
<
= #{endTime}
and ifnull(dh.delete_flag,'0') !='1'
...
...
@@ -221,8 +225,8 @@
<select
id=
"buyOrSalePrice"
resultType=
"java.math.BigDecimal"
>
select ifnull(sum(all_price),0) as AllPrice from jsh_depot_item di,jsh_depot_head dh
where di.header_id = dh.id
and dh.type=
'$
{type}
'
and dh.sub_type=
'$
{subType}
'
and di.material_id =
$
{MId}
and dh.type=
#
{type} and dh.sub_type=
#
{subType}
and di.material_id =
#
{MId}
and dh.oper_time
>
= #{beginTime}
and dh.oper_time
<
= #{endTime}
and ifnull(dh.delete_flag,'0') !='1'
...
...
@@ -232,7 +236,7 @@
<select
id=
"inOrOutPrice"
resultType=
"java.math.BigDecimal"
>
select ifnull(sum(discount_last_money),0) as allMoney from jsh_depot_head dh
where 1=1
and dh.type=
'$
{type}
'
and dh.sub_type=
'$
{subType}
'
and dh.type=
#
{type} and dh.sub_type=
#
{subType}
and dh.oper_time
>
= #{beginTime}
and dh.oper_time
<
= #{endTime}
and ifnull(dh.delete_flag,'0') !='1'
...
...
@@ -250,10 +254,10 @@
and di.depot_id=#{depotId}
</if>
<if
test=
"beginTime != null"
>
and dh.oper_time
>
=
'$
{beginTime}
'
and dh.oper_time
>
=
#
{beginTime}
</if>
<if
test=
"endTime != null"
>
and dh.oper_time
<
=
'$
{endTime}
'
and dh.oper_time
<
=
#
{endTime}
</if>
and ifnull(dh.delete_flag,'0') !='1'
and ifnull(di.delete_flag,'0') !='1'
...
...
@@ -277,10 +281,10 @@
and dh.id=di.header_id
and di.material_id=#{mId}
<if
test=
"beginTime != null"
>
and dh.oper_time
>
=
'$
{beginTime}
'
and dh.oper_time
>
=
#
{beginTime}
</if>
<if
test=
"endTime != null"
>
and dh.oper_time
<
=
'$
{endTime}
'
and dh.oper_time
<
=
#
{endTime}
</if>
and dh.tenant_id=#{tenantId}
and di.tenant_id=#{tenantId}
...
...
@@ -386,7 +390,7 @@
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
</if>
<if
test=
"depotId != null"
>
and mcs.depot_id=
$
{depotId}
and mcs.depot_id=
#
{depotId}
</if>
group by m.id,m.name, m.model, m.unit, m.color, u.name
order by linjieNumber desc
...
...
@@ -411,7 +415,7 @@
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
</if>
<if
test=
"depotId != null"
>
and mcs.depot_id=
$
{depotId}
and mcs.depot_id=
#
{depotId}
</if>
group by m.id,m.name, m.model, m.unit, m.color, u.name) tb
</select>
...
...
jshERP-boot/src/main/resources/mapper_xml/DepotMapperEx.xml
View file @
99e7db36
...
...
@@ -11,13 +11,15 @@
left join jsh_user usr on usr.id=dep.principal and ifnull(usr.status,'0') not in('1','2')
where 1=1
<if
test=
"name != null"
>
and dep.name like '%${name}%'
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and dep.name like #{bindName}
</if>
<if
test=
"type != null"
>
and dep.type=
$
{type}
and dep.type=
#
{type}
</if>
<if
test=
"remark != null"
>
and dep.remark like '%${remark}%'
<bind
name=
"bindRemark"
value=
"'%'+remark+'%'"
/>
and dep.remark like #{bindRemark}
</if>
and ifnull(dep.delete_Flag,'0') !='1'
order by dep.sort asc
...
...
@@ -32,13 +34,15 @@
left join jsh_user usr on usr.id=dep.principal and ifnull(usr.status,'0') not in('1','2')
WHERE 1=1
<if
test=
"name != null"
>
and dep.name like '%${name}%'
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and dep.name like #{bindName}
</if>
<if
test=
"type != null"
>
and dep.type=
$
{type}
and dep.type=
#
{type}
</if>
<if
test=
"remark != null"
>
and dep.remark like '%${remark}%'
<bind
name=
"bindRemark"
value=
"'%'+remark+'%'"
/>
and dep.remark like #{bindRemark}
</if>
and ifnull(dep.delete_Flag,'0') !='1'
</select>
...
...
jshERP-boot/src/main/resources/mapper_xml/FunctionMapperEx.xml
View file @
99e7db36
...
...
@@ -6,10 +6,11 @@
FROM jsh_function
where 1=1
<if
test=
"name != null"
>
and name like '%${name}%'
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and name like #{bindName}
</if>
<if
test=
"type != null"
>
and type=
'$
{type}
'
and type=
#
{type}
</if>
and ifnull(delete_flag,'0') !='1'
order by sort asc
...
...
@@ -23,10 +24,11 @@
FROM jsh_function
WHERE 1=1
<if
test=
"name != null"
>
and name like '%${name}%'
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and name like #{bindName}
</if>
<if
test=
"type != null"
>
and type=
'$
{type}
'
and type=
#
{type}
</if>
and ifnull(delete_flag,'0') !='1'
</select>
...
...
jshERP-boot/src/main/resources/mapper_xml/InOutItemMapperEx.xml
View file @
99e7db36
...
...
@@ -6,13 +6,15 @@
FROM jsh_in_out_item
where 1=1
<if
test=
"name != null"
>
and name like '%${name}%'
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and name like #{bindName}
</if>
<if
test=
"type != null"
>
and type=
'$
{type}
'
and type=
#
{type}
</if>
<if
test=
"remark != null"
>
and remark like '%${remark}%'
<bind
name=
"bindRemark"
value=
"'%'+remark+'%'"
/>
and remark like #{bindRemark}
</if>
and ifnull(delete_flag,'0') !='1'
<if
test=
"offset != null and rows != null"
>
...
...
@@ -25,13 +27,15 @@
FROM jsh_in_out_item
WHERE 1=1
<if
test=
"name != null"
>
and name like '%${name}%'
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and name like #{bindName}
</if>
<if
test=
"type != null"
>
and type=
'$
{type}
'
and type=
#
{type}
</if>
<if
test=
"remark != null"
>
and remark like '%${remark}%'
<bind
name=
"bindRemark"
value=
"'%'+remark+'%'"
/>
and remark like #{bindRemark}
</if>
and ifnull(delete_flag,'0') !='1'
</select>
...
...
jshERP-boot/src/main/resources/mapper_xml/LogMapperEx.xml
View file @
99e7db36
...
...
@@ -11,25 +11,28 @@
left join jsh_user u on l.user_id = u.id and ifnull(u.status,'0') not in('1','2')
where 1=1
<if
test=
"operation != null"
>
and l.operation like '%${operation}%'
<bind
name=
"bindOperation"
value=
"'%'+operation+'%'"
/>
and l.operation like #{bindOperation}
</if>
<if
test=
"userId != null"
>
and l.user_id=
$
{userId}
and l.user_id=
#
{userId}
</if>
<if
test=
"clientIp != null"
>
and l.client_ip like '%${clientIp}%'
<bind
name=
"bindClientIp"
value=
"'%'+clientIp+'%'"
/>
and l.client_ip like #{bindClientIp}
</if>
<if
test=
"status != null"
>
and l.status=
$
{status}
and l.status=
#
{status}
</if>
<if
test=
"beginTime != null"
>
and l.create_time
>
=
'$
{beginTime}
'
and l.create_time
>
=
#
{beginTime}
</if>
<if
test=
"endTime != null"
>
and l.create_time
<
=
'$
{endTime}
'
and l.create_time
<
=
#
{endTime}
</if>
<if
test=
"content != null"
>
and l.content like '%${content}%'
<bind
name=
"bindContent"
value=
"'%'+content+'%'"
/>
and l.content like #{bindContent}
</if>
order by l.create_time desc
<if
test=
"offset != null and rows != null"
>
...
...
@@ -43,25 +46,28 @@
left join jsh_user u on l.user_id = u.id and ifnull(u.status,'0') not in('1','2')
WHERE 1=1
<if
test=
"operation != null"
>
and l.operation like '%${operation}%'
<bind
name=
"bindOperation"
value=
"'%'+operation+'%'"
/>
and l.operation like #{bindOperation}
</if>
<if
test=
"userId != null"
>
and l.user_id=
$
{userId}
and l.user_id=
#
{userId}
</if>
<if
test=
"clientIp != null"
>
and l.client_ip like '%${clientIp}%'
<bind
name=
"bindClientIp"
value=
"'%'+clientIp+'%'"
/>
and l.client_ip like #{bindClientIp}
</if>
<if
test=
"status != null"
>
and l.status =
$
{status}
and l.status =
#
{status}
</if>
<if
test=
"beginTime != null"
>
and l.create_time
>
=
'$
{beginTime}
'
and l.create_time
>
=
#
{beginTime}
</if>
<if
test=
"endTime != null"
>
and l.create_time
<
=
'$
{endTime}
'
and l.create_time
<
=
#
{endTime}
</if>
<if
test=
"content != null"
>
and l.content like '%${content}%'
<bind
name=
"bindContent"
value=
"'%'+content+'%'"
/>
and l.content like #{bindContent}
</if>
</select>
</mapper>
\ No newline at end of file
jshERP-boot/src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml
View file @
99e7db36
...
...
@@ -7,10 +7,11 @@
where 1=1
and ifnull(delete_flag,'0') !='1'
<if
test=
"name != null"
>
and name like '%${name}%'
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and name like #{bindName}
</if>
<if
test=
"parentId != null"
>
and parent_id =
$
{parentId}
and parent_id =
#
{parentId}
</if>
and Id !=1
<if
test=
"offset != null and rows != null"
>
...
...
@@ -24,10 +25,11 @@
WHERE 1=1
and ifnull(delete_flag,'0') !='1'
<if
test=
"name != null"
>
and name like '%${name}%'
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and name like #{bindName}
</if>
<if
test=
"parentId != null"
>
and parent_id =
$
{parentId}
and parent_id =
#
{parentId}
</if>
and Id !=1
</select>
...
...
jshERP-boot/src/main/resources/mapper_xml/MaterialExtendMapperEx.xml
View file @
99e7db36
...
...
@@ -8,7 +8,7 @@
<select
id=
"getDetailList"
parameterType=
"com.jsh.erp.datasource.entities.MaterialExtendExample"
resultMap=
"ResultMapList"
>
select DISTINCT d.Id,d.bar_code,d.commodity_unit,d.commodity_decimal,d.purchase_decimal,d.wholesale_decimal,d.low_decimal
from jsh_material_extend d
where d.material_id =
'$
{materialId}
'
where d.material_id =
#
{materialId}
and ifnull(d.delete_Flag,'0') !='1'
order by d.default_flag desc,d.id asc
</select>
...
...
@@ -19,7 +19,7 @@
select update_time from jsh_material_extend
where 1=1
<if
test=
"lastTime != null"
>
and update_time >
$
{lastTime}
and update_time >
#
{lastTime}
</if>
order by update_time asc
<if
test=
"syncNum != null"
>
...
...
Prev
1
2
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