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
70f0dae4
Commit
70f0dae4
authored
Jul 21, 2020
by
季圣华
Browse files
优化表结构
parent
13932441
Changes
104
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/jsh/erp/datasource/mappers/SerialNumberMapper.java
View file @
70f0dae4
...
...
@@ -6,91 +6,25 @@ import java.util.List;
import
org.apache.ibatis.annotations.Param
;
public
interface
SerialNumberMapper
{
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int
countByExample
(
SerialNumberExample
example
);
long
countByExample
(
SerialNumberExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int
deleteByExample
(
SerialNumberExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int
deleteByPrimaryKey
(
Long
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int
insert
(
SerialNumber
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int
insertSelective
(
SerialNumber
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
List
<
SerialNumber
>
selectByExample
(
SerialNumberExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
SerialNumber
selectByPrimaryKey
(
Long
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int
updateByExampleSelective
(
@Param
(
"record"
)
SerialNumber
record
,
@Param
(
"example"
)
SerialNumberExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int
updateByExample
(
@Param
(
"record"
)
SerialNumber
record
,
@Param
(
"example"
)
SerialNumberExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int
updateByPrimaryKeySelective
(
SerialNumber
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int
updateByPrimaryKey
(
SerialNumber
record
);
}
\ No newline at end of file
src/main/java/com/jsh/erp/datasource/mappers/UserBusinessMapper.java
View file @
70f0dae4
...
...
@@ -6,91 +6,25 @@ import java.util.List;
import
org.apache.ibatis.annotations.Param
;
public
interface
UserBusinessMapper
{
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int
countByExample
(
UserBusinessExample
example
);
long
countByExample
(
UserBusinessExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int
deleteByExample
(
UserBusinessExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int
deleteByPrimaryKey
(
Long
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int
insert
(
UserBusiness
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int
insertSelective
(
UserBusiness
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
List
<
UserBusiness
>
selectByExample
(
UserBusinessExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
UserBusiness
selectByPrimaryKey
(
Long
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int
updateByExampleSelective
(
@Param
(
"record"
)
UserBusiness
record
,
@Param
(
"example"
)
UserBusinessExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int
updateByExample
(
@Param
(
"record"
)
UserBusiness
record
,
@Param
(
"example"
)
UserBusinessExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int
updateByPrimaryKeySelective
(
UserBusiness
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int
updateByPrimaryKey
(
UserBusiness
record
);
}
\ No newline at end of file
src/main/java/com/jsh/erp/datasource/mappers/UserBusinessMapperEx.java
View file @
70f0dae4
...
...
@@ -9,5 +9,7 @@ import java.util.Date; /**
* @Date: 2019/3/29 15:09
*/
public
interface
UserBusinessMapperEx
{
int
batchDeleteUserBusinessByIds
(
@Param
(
"updateTime"
)
Date
updateTime
,
@Param
(
"updater"
)
Long
updater
,
@Param
(
"ids"
)
String
ids
[]);
}
src/main/java/com/jsh/erp/datasource/vo/AccountVo4List.java
View file @
70f0dae4
...
...
@@ -4,13 +4,13 @@ import com.jsh.erp.datasource.entities.Account;
public
class
AccountVo4List
extends
Account
{
private
String
this
m
onth
a
mount
;
private
String
this
M
onth
A
mount
;
public
String
getThis
m
onth
a
mount
()
{
return
this
m
onth
a
mount
;
public
String
getThis
M
onth
A
mount
()
{
return
this
M
onth
A
mount
;
}
public
void
setThis
m
onth
a
mount
(
String
this
m
onth
a
mount
)
{
this
.
this
m
onth
a
mount
=
this
m
onth
a
mount
;
public
void
setThis
M
onth
A
mount
(
String
this
M
onth
A
mount
)
{
this
.
this
M
onth
A
mount
=
this
M
onth
A
mount
;
}
}
\ No newline at end of file
src/main/java/com/jsh/erp/datasource/vo/LogVo4List.java
View file @
70f0dae4
...
...
@@ -4,16 +4,16 @@ import com.jsh.erp.datasource.entities.Log;
public
class
LogVo4List
extends
Log
{
private
String
user
n
ame
;
private
String
user
N
ame
;
private
String
createTimeStr
;
public
String
getUser
n
ame
()
{
return
user
n
ame
;
public
String
getUser
N
ame
()
{
return
user
N
ame
;
}
public
void
setUser
n
ame
(
String
user
n
ame
)
{
this
.
user
n
ame
=
user
n
ame
;
public
void
setUser
N
ame
(
String
user
N
ame
)
{
this
.
user
N
ame
=
user
N
ame
;
}
public
String
getCreateTimeStr
()
{
...
...
src/main/java/com/jsh/erp/service/account/AccountService.java
View file @
70f0dae4
...
...
@@ -104,9 +104,9 @@ public class AccountService {
if
((
thisMonthAmount
.
compareTo
(
BigDecimal
.
ZERO
))!=
0
)
{
thisMonthAmountFmt
=
df
.
format
(
thisMonthAmount
);
}
al
.
setThis
m
onth
a
mount
(
thisMonthAmountFmt
);
//本月发生额
BigDecimal
currentAmount
=
getAccountSum
(
al
.
getId
(),
""
,
"month"
).
add
(
getAccountSumByHead
(
al
.
getId
(),
""
,
"month"
)).
add
(
getAccountSumByDetail
(
al
.
getId
(),
""
,
"month"
)).
add
(
getManyAccountSum
(
al
.
getId
(),
""
,
"month"
))
.
add
(
al
.
getInitial
a
mount
())
;
al
.
setCurrent
a
mount
(
currentAmount
);
al
.
setThis
M
onth
A
mount
(
thisMonthAmountFmt
);
//本月发生额
BigDecimal
currentAmount
=
getAccountSum
(
al
.
getId
(),
""
,
"month"
).
add
(
getAccountSumByHead
(
al
.
getId
(),
""
,
"month"
)).
add
(
getAccountSumByDetail
(
al
.
getId
(),
""
,
"month"
)).
add
(
getManyAccountSum
(
al
.
getId
(),
""
,
"month"
))
.
add
(
al
.
getInitial
A
mount
())
;
al
.
setCurrent
A
mount
(
currentAmount
);
resList
.
add
(
al
);
}
}
...
...
@@ -126,10 +126,10 @@ public class AccountService {
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
insertAccount
(
String
beanJson
,
HttpServletRequest
request
)
throws
Exception
{
Account
account
=
JSONObject
.
parseObject
(
beanJson
,
Account
.
class
);
if
(
account
.
getInitial
a
mount
()
==
null
)
{
account
.
setInitial
a
mount
(
BigDecimal
.
ZERO
);
if
(
account
.
getInitial
A
mount
()
==
null
)
{
account
.
setInitial
A
mount
(
BigDecimal
.
ZERO
);
}
account
.
setIs
d
efault
(
false
);
account
.
setIs
D
efault
(
false
);
int
result
=
0
;
try
{
result
=
accountMapper
.
insertSelective
(
account
);
...
...
@@ -442,7 +442,7 @@ public class AccountService {
logService
.
insertLog
(
"账户"
,
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
+
accountId
,
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
Account
account
=
new
Account
();
account
.
setIs
d
efault
(
isDefault
);
account
.
setIs
D
efault
(
isDefault
);
AccountExample
example
=
new
AccountExample
();
example
.
createCriteria
().
andIdEqualTo
(
accountId
);
int
result
=
0
;
...
...
@@ -561,7 +561,7 @@ public class AccountService {
BigDecimal
monthAmount
=
getAccountSum
(
a
.
getId
(),
timeStr
,
"month"
).
add
(
getAccountSumByHead
(
a
.
getId
(),
timeStr
,
"month"
))
.
add
(
getAccountSumByDetail
(
a
.
getId
(),
timeStr
,
"month"
)).
add
(
getManyAccountSum
(
a
.
getId
(),
timeStr
,
"month"
));
BigDecimal
currentAmount
=
getAccountSum
(
a
.
getId
(),
""
,
"month"
).
add
(
getAccountSumByHead
(
a
.
getId
(),
""
,
"month"
))
.
add
(
getAccountSumByDetail
(
a
.
getId
(),
""
,
"month"
)).
add
(
getManyAccountSum
(
a
.
getId
(),
""
,
"month"
)).
add
(
a
.
getInitial
a
mount
());
.
add
(
getAccountSumByDetail
(
a
.
getId
(),
""
,
"month"
)).
add
(
getManyAccountSum
(
a
.
getId
(),
""
,
"month"
)).
add
(
a
.
getInitial
A
mount
());
allMonthAmount
=
allMonthAmount
.
add
(
monthAmount
);
allCurrentAmount
=
allCurrentAmount
.
add
(
currentAmount
);
}
...
...
src/main/java/com/jsh/erp/service/functions/Function
s
Component.java
→
src/main/java/com/jsh/erp/service/functions/FunctionComponent.java
View file @
70f0dae4
package
com.jsh.erp.service.functions
;
import
com.jsh.erp.service.ICommonQuery
;
import
com.jsh.erp.service.functions.FunctionsService
;
import
com.jsh.erp.utils.Constants
;
import
com.jsh.erp.utils.QueryUtils
;
import
com.jsh.erp.utils.StringUtil
;
...
...
@@ -12,16 +11,16 @@ import javax.servlet.http.HttpServletRequest;
import
java.util.List
;
import
java.util.Map
;
@Service
(
value
=
"function
s
_component"
)
@Function
s
Resource
public
class
Function
s
Component
implements
ICommonQuery
{
@Service
(
value
=
"function_component"
)
@FunctionResource
public
class
FunctionComponent
implements
ICommonQuery
{
@Resource
private
Function
s
Service
function
s
Service
;
private
FunctionService
functionService
;
@Override
public
Object
selectOne
(
Long
id
)
throws
Exception
{
return
function
s
Service
.
getFunction
s
(
id
);
return
functionService
.
getFunction
(
id
);
}
@Override
...
...
@@ -34,7 +33,7 @@ public class FunctionsComponent implements ICommonQuery {
String
name
=
StringUtil
.
getInfo
(
search
,
"name"
);
String
type
=
StringUtil
.
getInfo
(
search
,
"type"
);
String
order
=
QueryUtils
.
order
(
map
);
return
function
s
Service
.
select
(
name
,
type
,
QueryUtils
.
offset
(
map
),
QueryUtils
.
rows
(
map
));
return
functionService
.
select
(
name
,
type
,
QueryUtils
.
offset
(
map
),
QueryUtils
.
rows
(
map
));
}
@Override
...
...
@@ -42,32 +41,32 @@ public class FunctionsComponent implements ICommonQuery {
String
search
=
map
.
get
(
Constants
.
SEARCH
);
String
name
=
StringUtil
.
getInfo
(
search
,
"name"
);
String
type
=
StringUtil
.
getInfo
(
search
,
"type"
);
return
function
s
Service
.
countFunction
s
(
name
,
type
);
return
functionService
.
countFunction
(
name
,
type
);
}
@Override
public
int
insert
(
String
beanJson
,
HttpServletRequest
request
)
throws
Exception
{
return
function
s
Service
.
insertFunction
s
(
beanJson
,
request
);
return
functionService
.
insertFunction
(
beanJson
,
request
);
}
@Override
public
int
update
(
String
beanJson
,
Long
id
,
HttpServletRequest
request
)
throws
Exception
{
return
function
s
Service
.
updateFunction
s
(
beanJson
,
id
,
request
);
return
functionService
.
updateFunction
(
beanJson
,
id
,
request
);
}
@Override
public
int
delete
(
Long
id
,
HttpServletRequest
request
)
throws
Exception
{
return
function
s
Service
.
deleteFunction
s
(
id
,
request
);
return
functionService
.
deleteFunction
(
id
,
request
);
}
@Override
public
int
batchDelete
(
String
ids
,
HttpServletRequest
request
)
throws
Exception
{
return
function
s
Service
.
batchDeleteFunction
s
(
ids
,
request
);
return
functionService
.
batchDeleteFunction
(
ids
,
request
);
}
@Override
public
int
checkIsNameExist
(
Long
id
,
String
name
)
throws
Exception
{
return
function
s
Service
.
checkIsNameExist
(
id
,
name
);
return
functionService
.
checkIsNameExist
(
id
,
name
);
}
}
src/main/java/com/jsh/erp/service/functions/Function
s
Resource.java
→
src/main/java/com/jsh/erp/service/functions/FunctionResource.java
View file @
70f0dae4
...
...
@@ -7,9 +7,9 @@ import java.lang.annotation.*;
/**
* @author jishenghua qq752718920 2018-10-7 15:26:27
*/
@ResourceInfo
(
value
=
"function
s
"
)
@ResourceInfo
(
value
=
"function"
)
@Inherited
@Target
(
ElementType
.
TYPE
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
Function
s
Resource
{
public
@interface
FunctionResource
{
}
src/main/java/com/jsh/erp/service/functions/Function
s
Service.java
→
src/main/java/com/jsh/erp/service/functions/FunctionService.java
View file @
70f0dae4
...
...
@@ -2,14 +2,11 @@ package com.jsh.erp.service.functions;
import
com.alibaba.fastjson.JSONObject
;
import
com.jsh.erp.constants.BusinessConstants
;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.datasource.entities.DepotItem
;
import
com.jsh.erp.datasource.entities.Functions
;
import
com.jsh.erp.datasource.entities.FunctionsExample
;
import
com.jsh.erp.datasource.entities.Function
;
import
com.jsh.erp.datasource.entities.FunctionExample
;
import
com.jsh.erp.datasource.entities.User
;
import
com.jsh.erp.datasource.mappers.FunctionsMapper
;
import
com.jsh.erp.datasource.mappers.FunctionsMapperEx
;
import
com.jsh.erp.exception.BusinessRunTimeException
;
import
com.jsh.erp.datasource.mappers.FunctionMapper
;
import
com.jsh.erp.datasource.mappers.FunctionMapperEx
;
import
com.jsh.erp.exception.JshException
;
import
com.jsh.erp.service.log.LogService
;
import
com.jsh.erp.service.user.UserService
;
...
...
@@ -28,21 +25,21 @@ import java.util.Date;
import
java.util.List
;
@Service
public
class
Function
s
Service
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
Function
s
Service
.
class
);
public
class
FunctionService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
FunctionService
.
class
);
@Resource
private
Function
s
Mapper
functionsMapper
;
private
FunctionMapper
functionsMapper
;
@Resource
private
Function
s
MapperEx
function
s
MapperEx
;
private
FunctionMapperEx
functionMapperEx
;
@Resource
private
UserService
userService
;
@Resource
private
LogService
logService
;
public
Function
s
getFunction
s
(
long
id
)
throws
Exception
{
Function
s
result
=
null
;
public
Function
getFunction
(
long
id
)
throws
Exception
{
Function
result
=
null
;
try
{
result
=
functionsMapper
.
selectByPrimaryKey
(
id
);
}
catch
(
Exception
e
){
...
...
@@ -51,11 +48,11 @@ public class FunctionsService {
return
result
;
}
public
List
<
Function
s
>
getFunction
s
ListByIds
(
String
ids
)
throws
Exception
{
public
List
<
Function
>
getFunctionListByIds
(
String
ids
)
throws
Exception
{
List
<
Long
>
idList
=
StringUtil
.
strToLongList
(
ids
);
List
<
Function
s
>
list
=
new
ArrayList
<>();
List
<
Function
>
list
=
new
ArrayList
<>();
try
{
Function
s
Example
example
=
new
Function
s
Example
();
FunctionExample
example
=
new
FunctionExample
();
example
.
createCriteria
().
andIdIn
(
idList
);
list
=
functionsMapper
.
selectByExample
(
example
);
}
catch
(
Exception
e
){
...
...
@@ -64,10 +61,10 @@ public class FunctionsService {
return
list
;
}
public
List
<
Function
s
>
getFunction
s
()
throws
Exception
{
Function
s
Example
example
=
new
Function
s
Example
();
public
List
<
Function
>
getFunction
()
throws
Exception
{
FunctionExample
example
=
new
FunctionExample
();
example
.
createCriteria
().
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
List
<
Function
s
>
list
=
null
;
List
<
Function
>
list
=
null
;
try
{
list
=
functionsMapper
.
selectByExample
(
example
);
}
catch
(
Exception
e
){
...
...
@@ -76,20 +73,20 @@ public class FunctionsService {
return
list
;
}
public
List
<
Function
s
>
select
(
String
name
,
String
type
,
int
offset
,
int
rows
)
throws
Exception
{
List
<
Function
s
>
list
=
null
;
public
List
<
Function
>
select
(
String
name
,
String
type
,
int
offset
,
int
rows
)
throws
Exception
{
List
<
Function
>
list
=
null
;
try
{
list
=
function
s
MapperEx
.
selectByConditionFunction
s
(
name
,
type
,
offset
,
rows
);
list
=
functionMapperEx
.
selectByConditionFunction
(
name
,
type
,
offset
,
rows
);
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
}
return
list
;
}
public
Long
countFunction
s
(
String
name
,
String
type
)
throws
Exception
{
public
Long
countFunction
(
String
name
,
String
type
)
throws
Exception
{
Long
result
=
null
;
try
{
result
=
function
s
MapperEx
.
countsByFunction
s
(
name
,
type
);
result
=
functionMapperEx
.
countsByFunction
(
name
,
type
);
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
}
...
...
@@ -97,8 +94,8 @@ public class FunctionsService {
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
insertFunction
s
(
String
beanJson
,
HttpServletRequest
request
)
throws
Exception
{
Function
s
functions
=
JSONObject
.
parseObject
(
beanJson
,
Function
s
.
class
);
public
int
insertFunction
(
String
beanJson
,
HttpServletRequest
request
)
throws
Exception
{
Function
functions
=
JSONObject
.
parseObject
(
beanJson
,
Function
.
class
);
int
result
=
0
;
try
{
result
=
functionsMapper
.
insertSelective
(
functions
);
...
...
@@ -111,8 +108,8 @@ public class FunctionsService {
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
updateFunction
s
(
String
beanJson
,
Long
id
,
HttpServletRequest
request
)
throws
Exception
{
Function
s
functions
=
JSONObject
.
parseObject
(
beanJson
,
Function
s
.
class
);
public
int
updateFunction
(
String
beanJson
,
Long
id
,
HttpServletRequest
request
)
throws
Exception
{
Function
functions
=
JSONObject
.
parseObject
(
beanJson
,
Function
.
class
);
functions
.
setId
(
id
);
int
result
=
0
;
try
{
...
...
@@ -126,7 +123,7 @@ public class FunctionsService {
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
deleteFunction
s
(
Long
id
,
HttpServletRequest
request
)
throws
Exception
{
public
int
deleteFunction
(
Long
id
,
HttpServletRequest
request
)
throws
Exception
{
int
result
=
0
;
try
{
result
=
functionsMapper
.
deleteByPrimaryKey
(
id
);
...
...
@@ -139,9 +136,9 @@ public class FunctionsService {
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
batchDeleteFunction
s
(
String
ids
,
HttpServletRequest
request
)
throws
Exception
{
public
int
batchDeleteFunction
(
String
ids
,
HttpServletRequest
request
)
throws
Exception
{
List
<
Long
>
idList
=
StringUtil
.
strToLongList
(
ids
);
Function
s
Example
example
=
new
Function
s
Example
();
FunctionExample
example
=
new
FunctionExample
();
example
.
createCriteria
().
andIdIn
(
idList
);
int
result
=
0
;
try
{
...
...
@@ -154,9 +151,9 @@ public class FunctionsService {
}
public
int
checkIsNameExist
(
Long
id
,
String
name
)
throws
Exception
{
Function
s
Example
example
=
new
Function
s
Example
();
FunctionExample
example
=
new
FunctionExample
();
example
.
createCriteria
().
andIdNotEqualTo
(
id
).
andNameEqualTo
(
name
).
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
List
<
Function
s
>
list
=
null
;
List
<
Function
>
list
=
null
;
try
{
list
=
functionsMapper
.
selectByExample
(
example
);
}
catch
(
Exception
e
){
...
...
@@ -165,12 +162,12 @@ public class FunctionsService {
return
list
==
null
?
0
:
list
.
size
();
}
public
List
<
Function
s
>
getRoleFunction
s
(
String
pNumber
)
throws
Exception
{
Function
s
Example
example
=
new
Function
s
Example
();
example
.
createCriteria
().
andEnabledEqualTo
(
true
).
andP
n
umberEqualTo
(
pNumber
)
public
List
<
Function
>
getRoleFunction
(
String
pNumber
)
throws
Exception
{
FunctionExample
example
=
new
FunctionExample
();
example
.
createCriteria
().
andEnabledEqualTo
(
true
).
andP
arentN
umberEqualTo
(
pNumber
)
.
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
example
.
setOrderByClause
(
"Sort"
);
List
<
Function
s
>
list
=
null
;
List
<
Function
>
list
=
null
;
try
{
list
=
functionsMapper
.
selectByExample
(
example
);
}
catch
(
Exception
e
){
...
...
@@ -179,12 +176,12 @@ public class FunctionsService {
return
list
;
}
public
List
<
Function
s
>
findRoleFunction
s
(
String
pnumber
)
throws
Exception
{
Function
s
Example
example
=
new
Function
s
Example
();
example
.
createCriteria
().
andEnabledEqualTo
(
true
).
andP
n
umberEqualTo
(
pnumber
)
public
List
<
Function
>
findRoleFunction
(
String
pnumber
)
throws
Exception
{
FunctionExample
example
=
new
FunctionExample
();
example
.
createCriteria
().
andEnabledEqualTo
(
true
).
andP
arentN
umberEqualTo
(
pnumber
)
.
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
example
.
setOrderByClause
(
"Sort"
);
List
<
Function
s
>
list
=
null
;
List
<
Function
>
list
=
null
;
try
{
list
=
functionsMapper
.
selectByExample
(
example
);
}
catch
(
Exception
e
){
...
...
@@ -193,13 +190,13 @@ public class FunctionsService {
return
list
;
}
public
List
<
Function
s
>
findByIds
(
String
functionsIds
)
throws
Exception
{
public
List
<
Function
>
findByIds
(
String
functionsIds
)
throws
Exception
{
List
<
Long
>
idList
=
StringUtil
.
strToLongList
(
functionsIds
);
Function
s
Example
example
=
new
Function
s
Example
();
FunctionExample
example
=
new
FunctionExample
();
example
.
createCriteria
().
andEnabledEqualTo
(
true
).
andIdIn
(
idList
)
.
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
example
.
setOrderByClause
(
"Sort asc"
);
List
<
Function
s
>
list
=
null
;
List
<
Function
>
list
=
null
;
try
{
list
=
functionsMapper
.
selectByExample
(
example
);
}
catch
(
Exception
e
){
...
...
@@ -209,11 +206,11 @@ public class FunctionsService {
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
batchDeleteFunction
s
ByIds
(
String
ids
)
throws
Exception
{
public
int
batchDeleteFunctionByIds
(
String
ids
)
throws
Exception
{
StringBuffer
sb
=
new
StringBuffer
();
sb
.
append
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
);
List
<
Function
s
>
list
=
getFunction
s
ListByIds
(
ids
);
for
(
Function
s
functions:
list
){
List
<
Function
>
list
=
getFunctionListByIds
(
ids
);
for
(
Function
functions:
list
){
sb
.
append
(
"["
).
append
(
functions
.
getName
()).
append
(
"]"
);
}
logService
.
insertLog
(
"功能"
,
sb
.
toString
(),
...
...
@@ -222,7 +219,7 @@ public class FunctionsService {
String
[]
idArray
=
ids
.
split
(
","
);
int
result
=
0
;
try
{
result
=
function
s
MapperEx
.
batchDeleteFunction
s
ByIds
(
new
Date
(),
userInfo
==
null
?
null
:
userInfo
.
getId
(),
idArray
);
result
=
functionMapperEx
.
batchDeleteFunctionByIds
(
new
Date
(),
userInfo
==
null
?
null
:
userInfo
.
getId
(),
idArray
);
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
}
...
...
src/main/java/com/jsh/erp/service/log/LogComponent.java
View file @
70f0dae4
...
...
@@ -25,20 +25,19 @@ public class LogComponent implements ICommonQuery {
@Override
public
List
<?>
select
(
Map
<
String
,
String
>
map
)
throws
Exception
{
return
get
User
List
(
map
);
return
get
Log
List
(
map
);
}
private
List
<?>
get
User
List
(
Map
<
String
,
String
>
map
)
throws
Exception
{
private
List
<?>
get
Log
List
(
Map
<
String
,
String
>
map
)
throws
Exception
{
String
search
=
map
.
get
(
Constants
.
SEARCH
);
String
operation
=
StringUtil
.
getInfo
(
search
,
"operation"
);
Integer
user
nameID
=
StringUtil
.
parseInteger
(
StringUtil
.
getInfo
(
search
,
"user
nameID
"
));
Integer
user
Id
=
StringUtil
.
parseInteger
(
StringUtil
.
getInfo
(
search
,
"user
Id
"
));
String
clientIp
=
StringUtil
.
getInfo
(
search
,
"clientIp"
);
Integer
status
=
StringUtil
.
parseInteger
(
StringUtil
.
getInfo
(
search
,
"status"
));
String
beginTime
=
StringUtil
.
getInfo
(
search
,
"beginTime"
);
String
endTime
=
StringUtil
.
getInfo
(
search
,
"endTime"
);
String
contentdetails
=
StringUtil
.
getInfo
(
search
,
"contentdetails"
);
String
order
=
QueryUtils
.
order
(
map
);
return
logService
.
select
(
operation
,
usernameID
,
clientIp
,
status
,
beginTime
,
endTime
,
contentdetails
,
String
content
=
StringUtil
.
getInfo
(
search
,
"content"
);
return
logService
.
select
(
operation
,
userId
,
clientIp
,
status
,
beginTime
,
endTime
,
content
,
QueryUtils
.
offset
(
map
),
QueryUtils
.
rows
(
map
));
}
...
...
@@ -46,13 +45,13 @@ public class LogComponent implements ICommonQuery {
public
Long
counts
(
Map
<
String
,
String
>
map
)
throws
Exception
{
String
search
=
map
.
get
(
Constants
.
SEARCH
);
String
operation
=
StringUtil
.
getInfo
(
search
,
"operation"
);
Integer
user
nameID
=
StringUtil
.
parseInteger
(
StringUtil
.
getInfo
(
search
,
"user
nameID
"
));
Integer
user
Id
=
StringUtil
.
parseInteger
(
StringUtil
.
getInfo
(
search
,
"user
Id
"
));
String
clientIp
=
StringUtil
.
getInfo
(
search
,
"clientIp"
);
Integer
status
=
StringUtil
.
parseInteger
(
StringUtil
.
getInfo
(
search
,
"status"
));
String
beginTime
=
StringUtil
.
getInfo
(
search
,
"beginTime"
);
String
endTime
=
StringUtil
.
getInfo
(
search
,
"endTime"
);
String
content
details
=
StringUtil
.
getInfo
(
search
,
"content
details
"
);
return
logService
.
countLog
(
operation
,
user
nameID
,
clientIp
,
status
,
beginTime
,
endTime
,
content
details
);
String
content
=
StringUtil
.
getInfo
(
search
,
"content"
);
return
logService
.
countLog
(
operation
,
user
Id
,
clientIp
,
status
,
beginTime
,
endTime
,
content
);
}
@Override
...
...
src/main/java/com/jsh/erp/service/log/LogService.java
View file @
70f0dae4
...
...
@@ -55,15 +55,15 @@ public class LogService {
return
list
;
}
public
List
<
LogVo4List
>
select
(
String
operation
,
Integer
user
nameID
,
String
clientIp
,
Integer
status
,
String
beginTime
,
String
endTime
,
String
content
details
,
int
offset
,
int
rows
)
throws
Exception
{
public
List
<
LogVo4List
>
select
(
String
operation
,
Integer
user
Id
,
String
clientIp
,
Integer
status
,
String
beginTime
,
String
endTime
,
String
content
,
int
offset
,
int
rows
)
throws
Exception
{
List
<
LogVo4List
>
list
=
null
;
try
{
list
=
logMapperEx
.
selectByConditionLog
(
operation
,
user
nameID
,
clientIp
,
status
,
beginTime
,
endTime
,
content
details
,
offset
,
rows
);
list
=
logMapperEx
.
selectByConditionLog
(
operation
,
user
Id
,
clientIp
,
status
,
beginTime
,
endTime
,
content
,
offset
,
rows
);
if
(
null
!=
list
)
{
for
(
LogVo4List
log
:
list
)
{
log
.
setCreateTimeStr
(
Tools
.
getCenternTime
(
log
.
getCreate
t
ime
()));
log
.
setCreateTimeStr
(
Tools
.
getCenternTime
(
log
.
getCreate
T
ime
()));
}
}
}
catch
(
Exception
e
){
...
...
@@ -72,11 +72,11 @@ public class LogService {
return
list
;
}
public
Long
countLog
(
String
operation
,
Integer
user
nameID
,
String
clientIp
,
Integer
status
,
String
beginTime
,
String
endTime
,
String
content
details
)
throws
Exception
{
public
Long
countLog
(
String
operation
,
Integer
user
Id
,
String
clientIp
,
Integer
status
,
String
beginTime
,
String
endTime
,
String
content
)
throws
Exception
{
Long
result
=
null
;
try
{
result
=
logMapperEx
.
countsByLog
(
operation
,
user
nameID
,
clientIp
,
status
,
beginTime
,
endTime
,
content
details
);
result
=
logMapperEx
.
countsByLog
(
operation
,
user
Id
,
clientIp
,
status
,
beginTime
,
endTime
,
content
);
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
}
...
...
@@ -153,13 +153,13 @@ public class LogService {
Long
userId
=
getUserId
(
request
);
if
(
userId
!=
null
)
{
Log
log
=
new
Log
();
log
.
setUser
i
d
(
userId
);
log
.
setUser
I
d
(
userId
);
log
.
setOperation
(
moduleName
);
log
.
setClient
i
p
(
getLocalIp
(
request
));
log
.
setCreate
t
ime
(
new
Date
());
log
.
setClient
I
p
(
getLocalIp
(
request
));
log
.
setCreate
T
ime
(
new
Date
());
Byte
status
=
0
;
log
.
setStatus
(
status
);
log
.
setContent
details
(
content
);
log
.
setContent
(
content
);
logMapper
.
insertSelective
(
log
);
}
}
catch
(
Exception
e
){
...
...
src/main/java/com/jsh/erp/service/materialCategory/MaterialCategoryService.java
View file @
70f0dae4
...
...
@@ -90,7 +90,7 @@ public class MaterialCategoryService {
List
<
MaterialCategory
>
res
=
new
ArrayList
<
MaterialCategory
>();
List
<
MaterialCategory
>
list
=
null
;
MaterialCategoryExample
example
=
new
MaterialCategoryExample
();
example
.
createCriteria
().
andParent
i
dEqualTo
(
parentId
).
andIdNotEqualTo
(
1
l
);
example
.
createCriteria
().
andParent
I
dEqualTo
(
parentId
).
andIdNotEqualTo
(
1
L
);
example
.
setOrderByClause
(
"id"
);
list
=
materialCategoryMapper
.
selectByExample
(
example
);
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
...
...
@@ -230,9 +230,9 @@ public class MaterialCategoryService {
if
(
mc
==
null
){
return
0
;
}
if
(
mc
.
getParent
i
d
()==
null
){
if
(
mc
.
getParent
I
d
()==
null
){
//没有给定父级目录的id,默认设置父级目录为根目录的父目录
mc
.
setParent
i
d
(
BusinessConstants
.
MATERIAL_CATEGORY_ROOT_PARENT_ID
);
mc
.
setParent
I
d
(
BusinessConstants
.
MATERIAL_CATEGORY_ROOT_PARENT_ID
);
}
//检查商品类型编号是否已存在
checkMaterialCategorySerialNo
(
mc
);
...
...
@@ -288,9 +288,9 @@ public class MaterialCategoryService {
logService
.
insertLog
(
"商品类型"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
mc
.
getName
()).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
if
(
mc
.
getParent
i
d
()==
null
){
if
(
mc
.
getParent
I
d
()==
null
){
//没有给定父级目录的id,默认设置父级目录为根目录的父目录
mc
.
setParent
i
d
(
BusinessConstants
.
MATERIAL_CATEGORY_ROOT_PARENT_ID
);
mc
.
setParent
I
d
(
BusinessConstants
.
MATERIAL_CATEGORY_ROOT_PARENT_ID
);
}
//检查商品类型编号是否已存在
checkMaterialCategorySerialNo
(
mc
);
...
...
@@ -362,7 +362,7 @@ public class MaterialCategoryService {
/**
* 校验
* 1、产品表 jsh_material
* 2、产品类型表 jsh_materialcategory
* 2、产品类型表 jsh_material
_
category
* 是否有相关数据
* */
int
deleteTotal
=
0
;
...
...
@@ -386,7 +386,7 @@ public class MaterialCategoryService {
ExceptionConstants
.
DELETE_FORCE_CONFIRM_MSG
);
}
/**
* 校验产品类型表 jsh_materialcategory
* 校验产品类型表 jsh_material
_
category
* */
List
<
MaterialCategory
>
materialCategoryList
=
null
;
try
{
...
...
@@ -412,7 +412,7 @@ public class MaterialCategoryService {
* @param name
*/
public
Long
getCategoryIdByName
(
String
name
){
Long
categoryId
=
0
l
;
Long
categoryId
=
0
L
;
MaterialCategoryExample
example
=
new
MaterialCategoryExample
();
example
.
createCriteria
().
andNameEqualTo
(
name
).
andStatusNotEqualTo
(
BusinessConstants
.
DELETE_TYPE_FORCE
);
List
<
MaterialCategory
>
list
=
materialCategoryMapper
.
selectByExample
(
example
);
...
...
src/main/java/com/jsh/erp/service/materialProperty/MaterialPropertyService.java
View file @
70f0dae4
...
...
@@ -88,7 +88,7 @@ public class MaterialPropertyService {
try
{
result
=
materialPropertyMapper
.
insertSelective
(
materialProperty
);
logService
.
insertLog
(
"商品属性"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
materialProperty
.
getNative
n
ame
()).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
materialProperty
.
getNative
N
ame
()).
toString
(),
request
);
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
}
...
...
@@ -103,7 +103,7 @@ public class MaterialPropertyService {
try
{
result
=
materialPropertyMapper
.
updateByPrimaryKeySelective
(
materialProperty
);
logService
.
insertLog
(
"商品属性"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
materialProperty
.
getNative
n
ame
()).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
materialProperty
.
getNative
N
ame
()).
toString
(),
request
);
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
}
...
...
src/main/java/com/jsh/erp/service/person/PersonService.java
View file @
70f0dae4
...
...
@@ -173,7 +173,7 @@ public class PersonService {
List
<
Long
>
ids
=
StringUtil
.
strToLongList
(
personIDs
);
PersonExample
example
=
new
PersonExample
();
example
.
createCriteria
().
andIdIn
(
ids
).
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
example
.
setOrderByClause
(
"
I
d asc"
);
example
.
setOrderByClause
(
"
i
d asc"
);
List
<
Person
>
list
=
null
;
try
{
list
=
personMapper
.
selectByExample
(
example
);
...
...
@@ -192,7 +192,7 @@ public class PersonService {
public
List
<
Person
>
getPersonByType
(
String
type
)
throws
Exception
{
PersonExample
example
=
new
PersonExample
();
example
.
createCriteria
().
andTypeEqualTo
(
type
).
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
example
.
setOrderByClause
(
"
I
d asc"
);
example
.
setOrderByClause
(
"
i
d asc"
);
List
<
Person
>
list
=
null
;
try
{
list
=
personMapper
.
selectByExample
(
example
);
...
...
src/main/java/com/jsh/erp/service/unit/UnitService.java
View file @
70f0dae4
...
...
@@ -104,7 +104,7 @@ public class UnitService {
try
{
result
=
unitMapper
.
insertSelective
(
unit
);
logService
.
insertLog
(
"计量单位"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
unit
.
get
Un
ame
()).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
unit
.
get
N
ame
()).
toString
(),
request
);
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
}
...
...
@@ -119,7 +119,7 @@ public class UnitService {
try
{
result
=
unitMapper
.
updateByPrimaryKeySelective
(
unit
);
logService
.
insertLog
(
"计量单位"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
unit
.
get
Un
ame
()).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
unit
.
get
N
ame
()).
toString
(),
request
);
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
}
...
...
@@ -156,7 +156,7 @@ public class UnitService {
public
int
checkIsNameExist
(
Long
id
,
String
name
)
throws
Exception
{
UnitExample
example
=
new
UnitExample
();
example
.
createCriteria
().
andIdNotEqualTo
(
id
).
and
Un
ameEqualTo
(
name
).
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
example
.
createCriteria
().
andIdNotEqualTo
(
id
).
and
N
ameEqualTo
(
name
).
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
List
<
Unit
>
list
=
null
;
try
{
list
=
unitMapper
.
selectByExample
(
example
);
...
...
@@ -171,7 +171,7 @@ public class UnitService {
sb
.
append
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
);
List
<
Unit
>
list
=
getUnitListByIds
(
ids
);
for
(
Unit
unit:
list
){
sb
.
append
(
"["
).
append
(
unit
.
get
Un
ame
()).
append
(
"]"
);
sb
.
append
(
"["
).
append
(
unit
.
get
N
ame
()).
append
(
"]"
);
}
logService
.
insertLog
(
"计量单位"
,
sb
.
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
@@ -234,9 +234,9 @@ public class UnitService {
* @param name
*/
public
Long
getUnitIdByName
(
String
name
){
Long
unitId
=
0
l
;
Long
unitId
=
0
L
;
UnitExample
example
=
new
UnitExample
();
example
.
createCriteria
().
and
Un
ameEqualTo
(
name
).
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
example
.
createCriteria
().
and
N
ameEqualTo
(
name
).
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
List
<
Unit
>
list
=
unitMapper
.
selectByExample
(
example
);
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
unitId
=
list
.
get
(
0
).
getId
();
...
...
src/main/java/com/jsh/erp/service/userBusiness/UserBusinessService.java
View file @
70f0dae4
...
...
@@ -2,14 +2,12 @@ package com.jsh.erp.service.userBusiness;
import
com.alibaba.fastjson.JSONObject
;
import
com.jsh.erp.constants.BusinessConstants
;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.datasource.entities.*
;
import
com.jsh.erp.datasource.mappers.UserBusinessMapper
;
import
com.jsh.erp.datasource.mappers.UserBusinessMapperEx
;
import
com.jsh.erp.exception.BusinessRunTimeException
;
import
com.jsh.erp.exception.JshException
;
import
com.jsh.erp.service.CommonQueryManager
;
import
com.jsh.erp.service.functions.Function
s
Service
;
import
com.jsh.erp.service.functions.FunctionService
;
import
com.jsh.erp.service.log.LogService
;
import
com.jsh.erp.service.user.UserService
;
import
com.jsh.erp.utils.StringUtil
;
...
...
@@ -17,7 +15,6 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
...
...
@@ -39,7 +36,7 @@ public class UserBusinessService {
private
UserService
userService
;
@Resource
private
Function
s
Service
function
s
Service
;
private
FunctionService
functionService
;
@Resource
private
CommonQueryManager
configResourceManager
;
...
...
@@ -127,7 +124,7 @@ public class UserBusinessService {
public
List
<
UserBusiness
>
getBasicData
(
String
keyId
,
String
type
)
throws
Exception
{
UserBusinessExample
example
=
new
UserBusinessExample
();
example
.
createCriteria
().
andKey
i
dEqualTo
(
keyId
).
andTypeEqualTo
(
type
)
example
.
createCriteria
().
andKey
I
dEqualTo
(
keyId
).
andTypeEqualTo
(
type
)
.
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
List
<
UserBusiness
>
list
=
null
;
try
{
...
...
@@ -140,7 +137,7 @@ public class UserBusinessService {
public
Long
checkIsValueExist
(
String
type
,
String
keyId
)
throws
Exception
{
UserBusinessExample
example
=
new
UserBusinessExample
();
example
.
createCriteria
().
andTypeEqualTo
(
type
).
andKey
i
dEqualTo
(
keyId
)
example
.
createCriteria
().
andTypeEqualTo
(
type
).
andKey
I
dEqualTo
(
keyId
)
.
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
List
<
UserBusiness
>
list
=
null
;
try
{
...
...
@@ -159,7 +156,7 @@ public class UserBusinessService {
UserBusinessExample
example
=
new
UserBusinessExample
();
String
newVaule
=
"%"
+
UBValue
+
"%"
;
if
(
TypeVale
!=
null
&&
KeyIdValue
!=
null
)
{
example
.
createCriteria
().
andTypeEqualTo
(
TypeVale
).
andKey
i
dEqualTo
(
KeyIdValue
).
andValueLike
(
newVaule
)
example
.
createCriteria
().
andTypeEqualTo
(
TypeVale
).
andKey
I
dEqualTo
(
KeyIdValue
).
andValueLike
(
newVaule
)
.
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
}
else
{
example
.
createCriteria
().
andValueLike
(
newVaule
)
...
...
@@ -184,7 +181,7 @@ public class UserBusinessService {
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
userBusinessId
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
UserBusiness
userBusiness
=
new
UserBusiness
();
userBusiness
.
setBtn
s
tr
(
btnStr
);
userBusiness
.
setBtn
S
tr
(
btnStr
);
UserBusinessExample
example
=
new
UserBusinessExample
();
example
.
createCriteria
().
andIdEqualTo
(
userBusinessId
);
int
result
=
0
;
...
...
@@ -198,7 +195,7 @@ public class UserBusinessService {
public
List
<
UserBusiness
>
findRoleByUserId
(
String
userId
)
throws
Exception
{
UserBusinessExample
example
=
new
UserBusinessExample
();
example
.
createCriteria
().
andKey
i
dEqualTo
(
userId
).
andTypeEqualTo
(
"UserRole"
)
example
.
createCriteria
().
andKey
I
dEqualTo
(
userId
).
andTypeEqualTo
(
"UserRole"
)
.
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
List
<
UserBusiness
>
list
=
null
;
try
{
...
...
@@ -212,7 +209,7 @@ public class UserBusinessService {
public
List
<
UserBusiness
>
findAppByRoles
(
String
roles
)
throws
Exception
{
List
<
String
>
rolesList
=
StringUtil
.
strToStringList
(
roles
);
UserBusinessExample
example
=
new
UserBusinessExample
();
example
.
createCriteria
().
andKey
i
dIn
(
rolesList
).
andTypeEqualTo
(
"RoleAPP"
)
example
.
createCriteria
().
andKey
I
dIn
(
rolesList
).
andTypeEqualTo
(
"RoleAPP"
)
.
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
List
<
UserBusiness
>
list
=
null
;
try
{
...
...
src/main/resources/mapper_xml/AccountMapper.xml
View file @
70f0dae4
<?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.jsh.erp.datasource.mappers.AccountMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.jsh.erp.datasource.entities.Account"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id
column=
"Id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"Name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"SerialNo"
jdbcType=
"VARCHAR"
property=
"serialno"
/>
<result
column=
"InitialAmount"
jdbcType=
"DECIMAL"
property=
"initialamount"
/>
<result
column=
"CurrentAmount"
jdbcType=
"DECIMAL"
property=
"currentamount"
/>
<result
column=
"Remark"
jdbcType=
"VARCHAR"
property=
"remark"
/>
<result
column=
"IsDefault"
jdbcType=
"BIT"
property=
"isdefault"
/>
<result
column=
"tenant_id"
jdbcType=
"BIGINT"
property=
"tenantId"
/>
<result
column=
"delete_Flag"
jdbcType=
"VARCHAR"
property=
"deleteFlag"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Update_By_Example_Where_Clause"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
Id, Name, SerialNo, InitialAmount, CurrentAmount, Remark, IsDefault, tenant_id, delete_Flag
</sql>
<select
id=
"selectByExample"
parameterType=
"com.jsh.erp.datasource.entities.AccountExample"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if
test=
"distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from jsh_account
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
</select>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include
refid=
"Base_Column_List"
/>
from jsh_account
where Id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_account
where Id = #{id,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"com.jsh.erp.datasource.entities.AccountExample"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_account
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"com.jsh.erp.datasource.entities.Account"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_account (Id, Name, SerialNo,
InitialAmount, CurrentAmount, Remark,
IsDefault, tenant_id, delete_Flag
)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{serialno,jdbcType=VARCHAR},
#{initialamount,jdbcType=DECIMAL}, #{currentamount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR},
#{isdefault,jdbcType=BIT}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.jsh.erp.datasource.entities.Account"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_account
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
Id,
</if>
<if
test=
"name != null"
>
Name,
</if>
<if
test=
"serialno != null"
>
SerialNo,
</if>
<if
test=
"initialamount != null"
>
InitialAmount,
</if>
<if
test=
"currentamount != null"
>
CurrentAmount,
</if>
<if
test=
"remark != null"
>
Remark,
</if>
<if
test=
"isdefault != null"
>
IsDefault,
</if>
<if
test=
"tenantId != null"
>
tenant_id,
</if>
<if
test=
"deleteFlag != null"
>
delete_Flag,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=BIGINT},
</if>
<if
test=
"name != null"
>
#{name,jdbcType=VARCHAR},
</if>
<if
test=
"serialno != null"
>
#{serialno,jdbcType=VARCHAR},
</if>
<if
test=
"initialamount != null"
>
#{initialamount,jdbcType=DECIMAL},
</if>
<if
test=
"currentamount != null"
>
#{currentamount,jdbcType=DECIMAL},
</if>
<if
test=
"remark != null"
>
#{remark,jdbcType=VARCHAR},
</if>
<if
test=
"isdefault != null"
>
#{isdefault,jdbcType=BIT},
</if>
<if
test=
"tenantId != null"
>
#{tenantId,jdbcType=BIGINT},
</if>
<if
test=
"deleteFlag != null"
>
#{deleteFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.jsh.erp.datasource.entities.AccountExample"
resultType=
"java.lang.Integer"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from jsh_account
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_account
<set>
<if
test=
"record.id != null"
>
Id = #{record.id,jdbcType=BIGINT},
</if>
<if
test=
"record.name != null"
>
Name = #{record.name,jdbcType=VARCHAR},
</if>
<if
test=
"record.serialno != null"
>
SerialNo = #{record.serialno,jdbcType=VARCHAR},
</if>
<if
test=
"record.initialamount != null"
>
InitialAmount = #{record.initialamount,jdbcType=DECIMAL},
</if>
<if
test=
"record.currentamount != null"
>
CurrentAmount = #{record.currentamount,jdbcType=DECIMAL},
</if>
<if
test=
"record.remark != null"
>
Remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if
test=
"record.isdefault != null"
>
IsDefault = #{record.isdefault,jdbcType=BIT},
</if>
<if
test=
"record.tenantId != null"
>
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
<if
test=
"record.deleteFlag != null"
>
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_account
set Id = #{record.id,jdbcType=BIGINT},
Name = #{record.name,jdbcType=VARCHAR},
SerialNo = #{record.serialno,jdbcType=VARCHAR},
InitialAmount = #{record.initialamount,jdbcType=DECIMAL},
CurrentAmount = #{record.currentamount,jdbcType=DECIMAL},
Remark = #{record.remark,jdbcType=VARCHAR},
IsDefault = #{record.isdefault,jdbcType=BIT},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.jsh.erp.datasource.entities.Account"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_account
<set>
<if
test=
"name != null"
>
Name = #{name,jdbcType=VARCHAR},
</if>
<if
test=
"serialno != null"
>
SerialNo = #{serialno,jdbcType=VARCHAR},
</if>
<if
test=
"initialamount != null"
>
InitialAmount = #{initialamount,jdbcType=DECIMAL},
</if>
<if
test=
"currentamount != null"
>
CurrentAmount = #{currentamount,jdbcType=DECIMAL},
</if>
<if
test=
"remark != null"
>
Remark = #{remark,jdbcType=VARCHAR},
</if>
<if
test=
"isdefault != null"
>
IsDefault = #{isdefault,jdbcType=BIT},
</if>
<if
test=
"tenantId != null"
>
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if
test=
"deleteFlag != null"
>
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
</set>
where Id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.jsh.erp.datasource.entities.Account"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_account
set Name = #{name,jdbcType=VARCHAR},
SerialNo = #{serialno,jdbcType=VARCHAR},
InitialAmount = #{initialamount,jdbcType=DECIMAL},
CurrentAmount = #{currentamount,jdbcType=DECIMAL},
Remark = #{remark,jdbcType=VARCHAR},
IsDefault = #{isdefault,jdbcType=BIT},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
where Id = #{id,jdbcType=BIGINT}
</update>
<mapper
namespace=
"com.jsh.erp.datasource.mappers.AccountMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.jsh.erp.datasource.entities.Account"
>
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"serial_no"
jdbcType=
"VARCHAR"
property=
"serialNo"
/>
<result
column=
"initial_amount"
jdbcType=
"DECIMAL"
property=
"initialAmount"
/>
<result
column=
"current_amount"
jdbcType=
"DECIMAL"
property=
"currentAmount"
/>
<result
column=
"remark"
jdbcType=
"VARCHAR"
property=
"remark"
/>
<result
column=
"is_default"
jdbcType=
"BIT"
property=
"isDefault"
/>
<result
column=
"tenant_id"
jdbcType=
"BIGINT"
property=
"tenantId"
/>
<result
column=
"delete_flag"
jdbcType=
"VARCHAR"
property=
"deleteFlag"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Update_By_Example_Where_Clause"
>
<where>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, name, serial_no, initial_amount, current_amount, remark, is_default, tenant_id,
delete_flag
</sql>
<select
id=
"selectByExample"
parameterType=
"com.jsh.erp.datasource.entities.AccountExample"
resultMap=
"BaseResultMap"
>
select
<if
test=
"distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from jsh_account
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
</select>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from jsh_account
where id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from jsh_account
where id = #{id,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"com.jsh.erp.datasource.entities.AccountExample"
>
delete from jsh_account
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"com.jsh.erp.datasource.entities.Account"
>
insert into jsh_account (id, name, serial_no,
initial_amount, current_amount, remark,
is_default, tenant_id, delete_flag
)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{serialNo,jdbcType=VARCHAR},
#{initialAmount,jdbcType=DECIMAL}, #{currentAmount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR},
#{isDefault,jdbcType=BIT}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.jsh.erp.datasource.entities.Account"
>
insert into jsh_account
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"name != null"
>
name,
</if>
<if
test=
"serialNo != null"
>
serial_no,
</if>
<if
test=
"initialAmount != null"
>
initial_amount,
</if>
<if
test=
"currentAmount != null"
>
current_amount,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"isDefault != null"
>
is_default,
</if>
<if
test=
"tenantId != null"
>
tenant_id,
</if>
<if
test=
"deleteFlag != null"
>
delete_flag,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=BIGINT},
</if>
<if
test=
"name != null"
>
#{name,jdbcType=VARCHAR},
</if>
<if
test=
"serialNo != null"
>
#{serialNo,jdbcType=VARCHAR},
</if>
<if
test=
"initialAmount != null"
>
#{initialAmount,jdbcType=DECIMAL},
</if>
<if
test=
"currentAmount != null"
>
#{currentAmount,jdbcType=DECIMAL},
</if>
<if
test=
"remark != null"
>
#{remark,jdbcType=VARCHAR},
</if>
<if
test=
"isDefault != null"
>
#{isDefault,jdbcType=BIT},
</if>
<if
test=
"tenantId != null"
>
#{tenantId,jdbcType=BIGINT},
</if>
<if
test=
"deleteFlag != null"
>
#{deleteFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.jsh.erp.datasource.entities.AccountExample"
resultType=
"java.lang.Long"
>
select count(*) from jsh_account
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
update jsh_account
<set>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=BIGINT},
</if>
<if
test=
"record.name != null"
>
name = #{record.name,jdbcType=VARCHAR},
</if>
<if
test=
"record.serialNo != null"
>
serial_no = #{record.serialNo,jdbcType=VARCHAR},
</if>
<if
test=
"record.initialAmount != null"
>
initial_amount = #{record.initialAmount,jdbcType=DECIMAL},
</if>
<if
test=
"record.currentAmount != null"
>
current_amount = #{record.currentAmount,jdbcType=DECIMAL},
</if>
<if
test=
"record.remark != null"
>
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if
test=
"record.isDefault != null"
>
is_default = #{record.isDefault,jdbcType=BIT},
</if>
<if
test=
"record.tenantId != null"
>
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
<if
test=
"record.deleteFlag != null"
>
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
update jsh_account
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
serial_no = #{record.serialNo,jdbcType=VARCHAR},
initial_amount = #{record.initialAmount,jdbcType=DECIMAL},
current_amount = #{record.currentAmount,jdbcType=DECIMAL},
remark = #{record.remark,jdbcType=VARCHAR},
is_default = #{record.isDefault,jdbcType=BIT},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.jsh.erp.datasource.entities.Account"
>
update jsh_account
<set>
<if
test=
"name != null"
>
name = #{name,jdbcType=VARCHAR},
</if>
<if
test=
"serialNo != null"
>
serial_no = #{serialNo,jdbcType=VARCHAR},
</if>
<if
test=
"initialAmount != null"
>
initial_amount = #{initialAmount,jdbcType=DECIMAL},
</if>
<if
test=
"currentAmount != null"
>
current_amount = #{currentAmount,jdbcType=DECIMAL},
</if>
<if
test=
"remark != null"
>
remark = #{remark,jdbcType=VARCHAR},
</if>
<if
test=
"isDefault != null"
>
is_default = #{isDefault,jdbcType=BIT},
</if>
<if
test=
"tenantId != null"
>
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.jsh.erp.datasource.entities.Account"
>
update jsh_account
set name = #{name,jdbcType=VARCHAR},
serial_no = #{serialNo,jdbcType=VARCHAR},
initial_amount = #{initialAmount,jdbcType=DECIMAL},
current_amount = #{currentAmount,jdbcType=DECIMAL},
remark = #{remark,jdbcType=VARCHAR},
is_default = #{isDefault,jdbcType=BIT},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
src/main/resources/mapper_xml/AccountMapperEx.xml
View file @
70f0dae4
...
...
@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jsh.erp.datasource.mappers.AccountMapperEx"
>
<resultMap
extends=
"com.jsh.erp.datasource.mappers.AccountMapper.BaseResultMap"
id=
"ResultListMap"
type=
"com.jsh.erp.datasource.vo.AccountVo4List"
>
<result
column=
"this
m
onth
a
mount"
jdbcType=
"VARCHAR"
property=
"this
m
onth
a
mount"
/>
<result
column=
"this
M
onth
A
mount"
jdbcType=
"VARCHAR"
property=
"this
M
onth
A
mount"
/>
</resultMap>
<resultMap
id=
"ResultInOutList"
type=
"com.jsh.erp.datasource.vo.AccountVo4InOutList"
>
...
...
@@ -23,12 +23,12 @@
and name like '%${name}%'
</if>
<if
test=
"serialNo != null"
>
and
S
erial
N
o like '%${serialNo}%'
and
s
erial
_n
o like '%${serialNo}%'
</if>
<if
test=
"remark != null"
>
and remark like '%${remark}%'
</if>
and ifnull(delete_
F
lag,'0') !='1'
and ifnull(delete_
f
lag,'0') !='1'
<if
test=
"offset != null and rows != null"
>
limit #{offset},#{rows}
</if>
...
...
@@ -43,12 +43,12 @@
and name like '%${name}%'
</if>
<if
test=
"serialNo != null"
>
and
S
erial
N
o like '%${serialNo}%'
and
s
erial
_n
o like '%${serialNo}%'
</if>
<if
test=
"remark != null"
>
and remark like '%${remark}%'
</if>
and ifnull(delete_
F
lag,'0') !='1'
and ifnull(delete_
f
lag,'0') !='1'
</select>
<select
id=
"findAccountInOutList"
parameterType=
"com.jsh.erp.datasource.entities.AccountExample"
resultMap=
"ResultInOutList"
>
...
...
@@ -175,7 +175,7 @@
</select>
<update
id=
"batchDeleteAccountByIds"
>
update jsh_account
set delete_
F
lag='1'
set delete_
f
lag='1'
where 1=1
and id in (
<foreach
collection=
"ids"
item=
"id"
separator=
","
>
...
...
src/main/resources/mapper_xml/DepotHeadMapperEx.xml
View file @
70f0dae4
...
...
@@ -207,9 +207,9 @@
) priceSum
from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_materialcategory.`Name` categoryName
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_material
_
category.`Name` categoryName
from jsh_material
LEFT JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2'
LEFT JOIN jsh_material
_
category on jsh_material.CategoryId=jsh_material
_
category.Id and ifnull(jsh_material
_
category.status,'0') !='2'
where ifnull(jsh_material.delete_Flag,'0') !='1'
) m
on m.Id=di.MaterialId where dh.type='${type}' and dh.OperTime >='${beginTime}' and dh.OperTime
<
='${endTime}'
...
...
@@ -233,9 +233,9 @@
select count(1) from
(select di.MaterialId, m.mName,m.Model,m.categoryName from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_materialcategory.`Name` categoryName
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_material
_
category.`Name` categoryName
from jsh_material
LEFT JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2'
LEFT JOIN jsh_material
_
category on jsh_material.CategoryId=jsh_material
_
category.Id and ifnull(jsh_material
_
category.status,'0') !='2'
where ifnull(jsh_material.delete_Flag,'0') !='1'
) m on m.Id=di.MaterialId where dh.type='${type}' and dh.OperTime >='${beginTime}' and dh.OperTime
<
='${endTime}'
<if
test=
"oId != null"
>
...
...
src/main/resources/mapper_xml/DepotItemMapperEx.xml
View file @
70f0dae4
...
...
@@ -28,16 +28,17 @@
<result
column=
"DepotName"
jdbcType=
"VARCHAR"
property=
"DepotName"
/>
<result
column=
"AnotherDepotName"
jdbcType=
"VARCHAR"
property=
"AnotherDepotName"
/>
<result
column=
"UnitId"
jdbcType=
"BIGINT"
property=
"UnitId"
/>
<result
column=
"
UN
ame"
jdbcType=
"VARCHAR"
property=
"
U
Name"
/>
<result
column=
"
unit_n
ame"
jdbcType=
"VARCHAR"
property=
"
unit
Name"
/>
<result
column=
"barCode"
jdbcType=
"VARCHAR"
property=
"barCode"
/>
</resultMap>
<resultMap
extends=
"com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap"
id=
"ResultByMaterial"
type=
"com.jsh.erp.datasource.entities.DepotItemVo4WithInfoEx"
>
<result
column=
"MId"
jdbcType=
"VARCHAR"
property=
"MId"
/>
<result
column=
"MName"
jdbcType=
"VARCHAR"
property=
"MName"
/>
<result
column=
"MMfrs"
jdbcType=
"VARCHAR"
property=
"MMfrs"
/>
<result
column=
"MModel"
jdbcType=
"VARCHAR"
property=
"MModel"
/>
<result
column=
"MaterialUnit"
jdbcType=
"VARCHAR"
property=
"MaterialUnit"
/>
<result
column=
"
UN
ame"
jdbcType=
"VARCHAR"
property=
"
U
Name"
/>
<result
column=
"
unit_n
ame"
jdbcType=
"VARCHAR"
property=
"
unit
Name"
/>
<result
column=
"MColor"
jdbcType=
"VARCHAR"
property=
"MColor"
/>
<result
column=
"purchase_decimal"
jdbcType=
"DECIMAL"
property=
"purchaseDecimal"
/>
</resultMap>
...
...
@@ -139,7 +140,7 @@
<select
id=
"getDetailList"
parameterType=
"com.jsh.erp.datasource.entities.DepotItemExample"
resultMap=
"ResultWithInfoExMap"
>
select di.*,m.Name MName,m.Model MModel,m.Unit MaterialUnit,m.Color MColor,m.Standard MStandard,m.Mfrs MMfrs,
m.OtherField1 MOtherField1,m.OtherField2 MOtherField2,m.OtherField3 MOtherField3,
dp1.name DepotName,dp2.name AnotherDepotName, u.id UnitId, u.
UN
ame, me.bar_code barCode
dp1.name DepotName,dp2.name AnotherDepotName, u.id UnitId, u.
name unit_n
ame, me.bar_code barCode
from jsh_depotitem di
left join jsh_material m on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1'
...
...
@@ -152,8 +153,8 @@
</select>
<select
id=
"findByAll"
parameterType=
"com.jsh.erp.datasource.entities.DepotItemExample"
resultMap=
"ResultByMaterial"
>
select m.id MId, m.Name MName, m.Model MModel, m.Unit MaterialUnit, m.Color MColor,
me.purchase_decimal, u.
UN
ame
UN
ame
select m.id MId, m.Name MName,
m.Mfrs MMfrs,
m.Model MModel, m.Unit MaterialUnit, m.Color MColor,
me.purchase_decimal, u.
n
ame
unit_n
ame
from jsh_material m
left join jsh_depotitem di on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_depothead dh on di.HeaderId=dh.id and ifnull(dh.delete_Flag,'0') !='1'
...
...
@@ -171,7 +172,7 @@
and dh.OperTime
<
= '${endTime}'
</if>
and ifnull(di.delete_Flag,'0') !='1'
group by m.id,m.Name, m.Model, m.Unit, m.Color, me.purchase_decimal, u.
UN
ame
group by m.id,m.Name, m.Model, m.Unit, m.Color, me.purchase_decimal, u.
n
ame
order by m.Name, m.Model asc
<if
test=
"offset != null and rows != null"
>
limit #{offset},#{rows}
...
...
@@ -381,7 +382,7 @@
(IFNULL(intype.BasicInNumber ,0) - IFNULL(outtype.BasicOutNumber ,0) - ifnull(m.safetystock,0)) BasicLinjieNumber
FROM
jsh_material m
LEFT JOIN jsh_materialcategory mc ON mc.Id = m.CategoryId
LEFT JOIN jsh_material
_
category mc ON mc.Id = m.CategoryId
LEFT JOIN (
SELECT
di.MaterialId,
...
...
Prev
1
2
3
4
5
6
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