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
1db9b945
Commit
1db9b945
authored
Jul 06, 2021
by
季圣华
Browse files
给租户增加启用禁用功能
parent
a176f417
Changes
12
Show whitespace changes
Inline
Side-by-side
jshERP-boot/docs/jsh_erp.sql
View file @
1db9b945
...
@@ -823,6 +823,7 @@ CREATE TABLE `jsh_tenant` (
...
@@ -823,6 +823,7 @@ CREATE TABLE `jsh_tenant` (
`login_name`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'登录名'
,
`login_name`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'登录名'
,
`user_num_limit`
int
(
11
)
DEFAULT
NULL
COMMENT
'用户数量限制'
,
`user_num_limit`
int
(
11
)
DEFAULT
NULL
COMMENT
'用户数量限制'
,
`bills_num_limit`
int
(
11
)
DEFAULT
NULL
COMMENT
'单据数量限制'
,
`bills_num_limit`
int
(
11
)
DEFAULT
NULL
COMMENT
'单据数量限制'
,
`enabled`
bit
(
1
)
DEFAULT
1
COMMENT
'启用 0-禁用 1-启用'
,
`create_time`
datetime
DEFAULT
NULL
COMMENT
'创建时间'
,
`create_time`
datetime
DEFAULT
NULL
COMMENT
'创建时间'
,
PRIMARY
KEY
(
`id`
)
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
21
DEFAULT
CHARSET
=
utf8
COMMENT
=
'租户'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
21
DEFAULT
CHARSET
=
utf8
COMMENT
=
'租户'
;
...
@@ -830,7 +831,7 @@ CREATE TABLE `jsh_tenant` (
...
@@ -830,7 +831,7 @@ CREATE TABLE `jsh_tenant` (
-- ----------------------------
-- ----------------------------
-- Records of jsh_tenant
-- Records of jsh_tenant
-- ----------------------------
-- ----------------------------
INSERT
INTO
`jsh_tenant`
VALUES
(
'13'
,
'63'
,
'jsh'
,
'20'
,
'2000'
,
'2021-02-17 23:19:17'
);
INSERT
INTO
`jsh_tenant`
VALUES
(
'13'
,
'63'
,
'jsh'
,
'20'
,
'2000'
,
1
,
'2021-02-17 23:19:17'
);
-- ----------------------------
-- ----------------------------
-- Table structure for jsh_unit
-- Table structure for jsh_unit
...
...
jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt
View file @
1db9b945
...
@@ -1119,3 +1119,10 @@ alter table jsh_account_head add discount_money decimal(24,6) DEFAULT NULL COMME
...
@@ -1119,3 +1119,10 @@ alter table jsh_account_head add discount_money decimal(24,6) DEFAULT NULL COMME
-- 给商品表增加附件名称字段
-- 给商品表增加附件名称字段
-- --------------------------------------------------------
-- --------------------------------------------------------
alter table jsh_material add img_name varchar(500) DEFAULT NULL COMMENT '图片名称' after remark;
alter table jsh_material add img_name varchar(500) DEFAULT NULL COMMENT '图片名称' after remark;
-- --------------------------------------------------------
-- 时间 2021年7月6日
-- by jishenghua
-- 给租户表增加字段enabled
-- --------------------------------------------------------
alter table jsh_tenant add enabled bit(1) DEFAULT 1 COMMENT '启用 0-禁用 1-启用' after bills_num_limit;
\ No newline at end of file
jshERP-boot/src/main/java/com/jsh/erp/controller/TenantController.java
0 → 100644
View file @
1db9b945
package
com.jsh.erp.controller
;
import
com.alibaba.fastjson.JSON
;
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.Tenant
;
import
com.jsh.erp.datasource.entities.User
;
import
com.jsh.erp.datasource.entities.UserEx
;
import
com.jsh.erp.datasource.vo.TreeNodeEx
;
import
com.jsh.erp.exception.BusinessParamCheckingException
;
import
com.jsh.erp.service.log.LogService
;
import
com.jsh.erp.service.redis.RedisService
;
import
com.jsh.erp.service.tenant.TenantService
;
import
com.jsh.erp.service.user.UserService
;
import
com.jsh.erp.utils.*
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
static
com
.
jsh
.
erp
.
utils
.
ResponseJsonUtil
.
returnJson
;
/**
* @author ji_sheng_hua 华夏erp
*/
@RestController
@RequestMapping
(
value
=
"/tenant"
)
public
class
TenantController
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
TenantController
.
class
);
@Resource
private
TenantService
tenantService
;
/**
* 批量设置状态-启用或者禁用
* @param jsonObject
* @param request
* @return
*/
@PostMapping
(
value
=
"/batchSetStatus"
)
public
String
batchSetStatus
(
@RequestBody
JSONObject
jsonObject
,
HttpServletRequest
request
)
throws
Exception
{
Boolean
status
=
jsonObject
.
getBoolean
(
"status"
);
String
ids
=
jsonObject
.
getString
(
"ids"
);
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<>();
int
res
=
tenantService
.
batchSetStatus
(
status
,
ids
);
if
(
res
>
0
)
{
return
returnJson
(
objectMap
,
ErpInfo
.
OK
.
name
,
ErpInfo
.
OK
.
code
);
}
else
{
return
returnJson
(
objectMap
,
ErpInfo
.
ERROR
.
name
,
ErpInfo
.
ERROR
.
code
);
}
}
}
jshERP-boot/src/main/java/com/jsh/erp/controller/UserController.java
View file @
1db9b945
...
@@ -107,6 +107,9 @@ public class UserController {
...
@@ -107,6 +107,9 @@ public class UserController {
case
ExceptionCodeConstants
.
UserExceptionCode
.
USER_ACCESS_EXCEPTION
:
case
ExceptionCodeConstants
.
UserExceptionCode
.
USER_ACCESS_EXCEPTION
:
msgTip
=
"access service error"
;
msgTip
=
"access service error"
;
break
;
break
;
case
ExceptionCodeConstants
.
UserExceptionCode
.
BLACK_TENANT
:
msgTip
=
"tenant is black"
;
break
;
case
ExceptionCodeConstants
.
UserExceptionCode
.
USER_CONDITION_FIT
:
case
ExceptionCodeConstants
.
UserExceptionCode
.
USER_CONDITION_FIT
:
msgTip
=
"user can login"
;
msgTip
=
"user can login"
;
//验证通过 ,可以登录,放入session,记录登录日志
//验证通过 ,可以登录,放入session,记录登录日志
...
...
jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/Tenant.java
View file @
1db9b945
...
@@ -3,194 +3,72 @@ package com.jsh.erp.datasource.entities;
...
@@ -3,194 +3,72 @@ package com.jsh.erp.datasource.entities;
import
java.util.Date
;
import
java.util.Date
;
public
class
Tenant
{
public
class
Tenant
{
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_tenant.id
*
* @mbggenerated
*/
private
Long
id
;
private
Long
id
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_tenant.tenant_id
*
* @mbggenerated
*/
private
Long
tenantId
;
private
Long
tenantId
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_tenant.login_name
*
* @mbggenerated
*/
private
String
loginName
;
private
String
loginName
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_tenant.user_num_limit
*
* @mbggenerated
*/
private
Integer
userNumLimit
;
private
Integer
userNumLimit
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_tenant.bills_num_limit
*
* @mbggenerated
*/
private
Integer
billsNumLimit
;
private
Integer
billsNumLimit
;
/**
private
Boolean
enabled
;
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_tenant.create_time
*
* @mbggenerated
*/
private
Date
createTime
;
private
Date
createTime
;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_tenant.id
*
* @return the value of jsh_tenant.id
*
* @mbggenerated
*/
public
Long
getId
()
{
public
Long
getId
()
{
return
id
;
return
id
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_tenant.id
*
* @param id the value for jsh_tenant.id
*
* @mbggenerated
*/
public
void
setId
(
Long
id
)
{
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_tenant.tenant_id
*
* @return the value of jsh_tenant.tenant_id
*
* @mbggenerated
*/
public
Long
getTenantId
()
{
public
Long
getTenantId
()
{
return
tenantId
;
return
tenantId
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_tenant.tenant_id
*
* @param tenantId the value for jsh_tenant.tenant_id
*
* @mbggenerated
*/
public
void
setTenantId
(
Long
tenantId
)
{
public
void
setTenantId
(
Long
tenantId
)
{
this
.
tenantId
=
tenantId
;
this
.
tenantId
=
tenantId
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_tenant.login_name
*
* @return the value of jsh_tenant.login_name
*
* @mbggenerated
*/
public
String
getLoginName
()
{
public
String
getLoginName
()
{
return
loginName
;
return
loginName
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_tenant.login_name
*
* @param loginName the value for jsh_tenant.login_name
*
* @mbggenerated
*/
public
void
setLoginName
(
String
loginName
)
{
public
void
setLoginName
(
String
loginName
)
{
this
.
loginName
=
loginName
==
null
?
null
:
loginName
.
trim
();
this
.
loginName
=
loginName
==
null
?
null
:
loginName
.
trim
();
}
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_tenant.user_num_limit
*
* @return the value of jsh_tenant.user_num_limit
*
* @mbggenerated
*/
public
Integer
getUserNumLimit
()
{
public
Integer
getUserNumLimit
()
{
return
userNumLimit
;
return
userNumLimit
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_tenant.user_num_limit
*
* @param userNumLimit the value for jsh_tenant.user_num_limit
*
* @mbggenerated
*/
public
void
setUserNumLimit
(
Integer
userNumLimit
)
{
public
void
setUserNumLimit
(
Integer
userNumLimit
)
{
this
.
userNumLimit
=
userNumLimit
;
this
.
userNumLimit
=
userNumLimit
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_tenant.bills_num_limit
*
* @return the value of jsh_tenant.bills_num_limit
*
* @mbggenerated
*/
public
Integer
getBillsNumLimit
()
{
public
Integer
getBillsNumLimit
()
{
return
billsNumLimit
;
return
billsNumLimit
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_tenant.bills_num_limit
*
* @param billsNumLimit the value for jsh_tenant.bills_num_limit
*
* @mbggenerated
*/
public
void
setBillsNumLimit
(
Integer
billsNumLimit
)
{
public
void
setBillsNumLimit
(
Integer
billsNumLimit
)
{
this
.
billsNumLimit
=
billsNumLimit
;
this
.
billsNumLimit
=
billsNumLimit
;
}
}
/**
public
Boolean
getEnabled
()
{
* This method was generated by MyBatis Generator.
return
enabled
;
* This method returns the value of the database column jsh_tenant.create_time
}
*
* @return the value of jsh_tenant.create_time
public
void
setEnabled
(
Boolean
enabled
)
{
*
this
.
enabled
=
enabled
;
* @mbggenerated
}
*/
public
Date
getCreateTime
()
{
public
Date
getCreateTime
()
{
return
createTime
;
return
createTime
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_tenant.create_time
*
* @param createTime the value for jsh_tenant.create_time
*
* @mbggenerated
*/
public
void
setCreateTime
(
Date
createTime
)
{
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
this
.
createTime
=
createTime
;
}
}
...
...
jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/TenantExample.java
View file @
1db9b945
...
@@ -5,118 +5,46 @@ import java.util.Date;
...
@@ -5,118 +5,46 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
public
class
TenantExample
{
public
class
TenantExample
{
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
protected
String
orderByClause
;
protected
String
orderByClause
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
protected
boolean
distinct
;
protected
boolean
distinct
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
protected
List
<
Criteria
>
oredCriteria
;
protected
List
<
Criteria
>
oredCriteria
;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
public
TenantExample
()
{
public
TenantExample
()
{
oredCriteria
=
new
ArrayList
<
Criteria
>();
oredCriteria
=
new
ArrayList
<>();
}
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
public
void
setOrderByClause
(
String
orderByClause
)
{
public
void
setOrderByClause
(
String
orderByClause
)
{
this
.
orderByClause
=
orderByClause
;
this
.
orderByClause
=
orderByClause
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
public
String
getOrderByClause
()
{
public
String
getOrderByClause
()
{
return
orderByClause
;
return
orderByClause
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
public
void
setDistinct
(
boolean
distinct
)
{
public
void
setDistinct
(
boolean
distinct
)
{
this
.
distinct
=
distinct
;
this
.
distinct
=
distinct
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
public
boolean
isDistinct
()
{
public
boolean
isDistinct
()
{
return
distinct
;
return
distinct
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
public
List
<
Criteria
>
getOredCriteria
()
{
public
List
<
Criteria
>
getOredCriteria
()
{
return
oredCriteria
;
return
oredCriteria
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
public
void
or
(
Criteria
criteria
)
{
public
void
or
(
Criteria
criteria
)
{
oredCriteria
.
add
(
criteria
);
oredCriteria
.
add
(
criteria
);
}
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
public
Criteria
or
()
{
public
Criteria
or
()
{
Criteria
criteria
=
createCriteriaInternal
();
Criteria
criteria
=
createCriteriaInternal
();
oredCriteria
.
add
(
criteria
);
oredCriteria
.
add
(
criteria
);
return
criteria
;
return
criteria
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
public
Criteria
createCriteria
()
{
public
Criteria
createCriteria
()
{
Criteria
criteria
=
createCriteriaInternal
();
Criteria
criteria
=
createCriteriaInternal
();
if
(
oredCriteria
.
size
()
==
0
)
{
if
(
oredCriteria
.
size
()
==
0
)
{
...
@@ -125,41 +53,23 @@ public class TenantExample {
...
@@ -125,41 +53,23 @@ public class TenantExample {
return
criteria
;
return
criteria
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
protected
Criteria
createCriteriaInternal
()
{
protected
Criteria
createCriteriaInternal
()
{
Criteria
criteria
=
new
Criteria
();
Criteria
criteria
=
new
Criteria
();
return
criteria
;
return
criteria
;
}
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
public
void
clear
()
{
public
void
clear
()
{
oredCriteria
.
clear
();
oredCriteria
.
clear
();
orderByClause
=
null
;
orderByClause
=
null
;
distinct
=
false
;
distinct
=
false
;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
protected
abstract
static
class
GeneratedCriteria
{
protected
abstract
static
class
GeneratedCriteria
{
protected
List
<
Criterion
>
criteria
;
protected
List
<
Criterion
>
criteria
;
protected
GeneratedCriteria
()
{
protected
GeneratedCriteria
()
{
super
();
super
();
criteria
=
new
ArrayList
<
Criterion
>();
criteria
=
new
ArrayList
<>();
}
}
public
boolean
isValid
()
{
public
boolean
isValid
()
{
...
@@ -505,6 +415,66 @@ public class TenantExample {
...
@@ -505,6 +415,66 @@ public class TenantExample {
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andEnabledIsNull
()
{
addCriterion
(
"enabled is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEnabledIsNotNull
()
{
addCriterion
(
"enabled is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEnabledEqualTo
(
Boolean
value
)
{
addCriterion
(
"enabled ="
,
value
,
"enabled"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEnabledNotEqualTo
(
Boolean
value
)
{
addCriterion
(
"enabled <>"
,
value
,
"enabled"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEnabledGreaterThan
(
Boolean
value
)
{
addCriterion
(
"enabled >"
,
value
,
"enabled"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEnabledGreaterThanOrEqualTo
(
Boolean
value
)
{
addCriterion
(
"enabled >="
,
value
,
"enabled"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEnabledLessThan
(
Boolean
value
)
{
addCriterion
(
"enabled <"
,
value
,
"enabled"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEnabledLessThanOrEqualTo
(
Boolean
value
)
{
addCriterion
(
"enabled <="
,
value
,
"enabled"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEnabledIn
(
List
<
Boolean
>
values
)
{
addCriterion
(
"enabled in"
,
values
,
"enabled"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEnabledNotIn
(
List
<
Boolean
>
values
)
{
addCriterion
(
"enabled not in"
,
values
,
"enabled"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEnabledBetween
(
Boolean
value1
,
Boolean
value2
)
{
addCriterion
(
"enabled between"
,
value1
,
value2
,
"enabled"
);
return
(
Criteria
)
this
;
}
public
Criteria
andEnabledNotBetween
(
Boolean
value1
,
Boolean
value2
)
{
addCriterion
(
"enabled not between"
,
value1
,
value2
,
"enabled"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNull
()
{
public
Criteria
andCreateTimeIsNull
()
{
addCriterion
(
"create_time is null"
);
addCriterion
(
"create_time is null"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
...
@@ -566,25 +536,12 @@ public class TenantExample {
...
@@ -566,25 +536,12 @@ public class TenantExample {
}
}
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table jsh_tenant
*
* @mbggenerated do_not_delete_during_merge
*/
public
static
class
Criteria
extends
GeneratedCriteria
{
public
static
class
Criteria
extends
GeneratedCriteria
{
protected
Criteria
()
{
protected
Criteria
()
{
super
();
super
();
}
}
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
public
static
class
Criterion
{
public
static
class
Criterion
{
private
String
condition
;
private
String
condition
;
...
...
jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/TenantMapper.java
View file @
1db9b945
...
@@ -6,91 +6,25 @@ import java.util.List;
...
@@ -6,91 +6,25 @@ import java.util.List;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
public
interface
TenantMapper
{
public
interface
TenantMapper
{
/**
long
countByExample
(
TenantExample
example
);
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
int
countByExample
(
TenantExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
int
deleteByExample
(
TenantExample
example
);
int
deleteByExample
(
TenantExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
int
deleteByPrimaryKey
(
Long
id
);
int
deleteByPrimaryKey
(
Long
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
int
insert
(
Tenant
record
);
int
insert
(
Tenant
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
int
insertSelective
(
Tenant
record
);
int
insertSelective
(
Tenant
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
List
<
Tenant
>
selectByExample
(
TenantExample
example
);
List
<
Tenant
>
selectByExample
(
TenantExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
Tenant
selectByPrimaryKey
(
Long
id
);
Tenant
selectByPrimaryKey
(
Long
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
int
updateByExampleSelective
(
@Param
(
"record"
)
Tenant
record
,
@Param
(
"example"
)
TenantExample
example
);
int
updateByExampleSelective
(
@Param
(
"record"
)
Tenant
record
,
@Param
(
"example"
)
TenantExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
int
updateByExample
(
@Param
(
"record"
)
Tenant
record
,
@Param
(
"example"
)
TenantExample
example
);
int
updateByExample
(
@Param
(
"record"
)
Tenant
record
,
@Param
(
"example"
)
TenantExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
int
updateByPrimaryKeySelective
(
Tenant
record
);
int
updateByPrimaryKeySelective
(
Tenant
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_tenant
*
* @mbggenerated
*/
int
updateByPrimaryKey
(
Tenant
record
);
int
updateByPrimaryKey
(
Tenant
record
);
}
}
\ No newline at end of file
jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
View file @
1db9b945
...
@@ -264,8 +264,16 @@ public class DepotHeadService {
...
@@ -264,8 +264,16 @@ public class DepotHeadService {
}
}
}
}
}
}
//对于零售出库单据,更新会员的预收款信息
if
(
BusinessConstants
.
DEPOTHEAD_TYPE_OUT
.
equals
(
depotHead
.
getType
())
&&
BusinessConstants
.
SUB_TYPE_TRANSFER
.
equals
(
depotHead
.
getSubType
())){
if
(
BusinessConstants
.
PAY_TYPE_PREPAID
.
equals
(
depotHead
.
getPayType
()))
{
if
(
depotHead
.
getOrganId
()
!=
null
)
{
supplierService
.
updateAdvanceIn
(
depotHead
.
getOrganId
(),
depotHead
.
getTotalPrice
().
abs
());
}
}
}
/**删除单据子表数据*/
/**删除单据子表数据*/
try
{
depotItemMapperEx
.
batchDeleteDepotItemByDepotHeadIds
(
new
Long
[]{
id
});
depotItemMapperEx
.
batchDeleteDepotItemByDepotHeadIds
(
new
Long
[]{
id
});
//更新当前库存
//更新当前库存
List
<
DepotItem
>
list
=
depotItemService
.
getListByHeaderId
(
id
);
List
<
DepotItem
>
list
=
depotItemService
.
getListByHeaderId
(
id
);
...
@@ -273,9 +281,6 @@ public class DepotHeadService {
...
@@ -273,9 +281,6 @@ public class DepotHeadService {
Long
tenantId
=
redisService
.
getTenantId
(
request
);
Long
tenantId
=
redisService
.
getTenantId
(
request
);
depotItemService
.
updateCurrentStock
(
depotItem
,
tenantId
);
depotItemService
.
updateCurrentStock
(
depotItem
,
tenantId
);
}
}
}
catch
(
Exception
e
)
{
JshException
.
writeFail
(
logger
,
e
);
}
/**删除单据主表信息*/
/**删除单据主表信息*/
batchDeleteDepotHeadByIds
(
id
.
toString
());
batchDeleteDepotHeadByIds
(
id
.
toString
());
logService
.
insertLog
(
"单据"
,
logService
.
insertLog
(
"单据"
,
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/tenant/TenantService.java
View file @
1db9b945
...
@@ -8,6 +8,7 @@ import com.jsh.erp.datasource.mappers.TenantMapper;
...
@@ -8,6 +8,7 @@ import com.jsh.erp.datasource.mappers.TenantMapper;
import
com.jsh.erp.datasource.mappers.TenantMapperEx
;
import
com.jsh.erp.datasource.mappers.TenantMapperEx
;
import
com.jsh.erp.exception.BusinessRunTimeException
;
import
com.jsh.erp.exception.BusinessRunTimeException
;
import
com.jsh.erp.exception.JshException
;
import
com.jsh.erp.exception.JshException
;
import
com.jsh.erp.service.log.LogService
;
import
com.jsh.erp.utils.StringUtil
;
import
com.jsh.erp.utils.StringUtil
;
import
com.jsh.erp.utils.Tools
;
import
com.jsh.erp.utils.Tools
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -15,6 +16,8 @@ import org.slf4j.LoggerFactory;
...
@@ -15,6 +16,8 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
@@ -30,6 +33,9 @@ public class TenantService {
...
@@ -30,6 +33,9 @@ public class TenantService {
@Resource
@Resource
private
TenantMapperEx
tenantMapperEx
;
private
TenantMapperEx
tenantMapperEx
;
@Resource
private
LogService
logService
;
@Value
(
"${tenant.userNumLimit}"
)
@Value
(
"${tenant.userNumLimit}"
)
private
Integer
userNumLimit
;
private
Integer
userNumLimit
;
...
@@ -161,4 +167,28 @@ public class TenantService {
...
@@ -161,4 +167,28 @@ public class TenantService {
}
}
return
tenant
;
return
tenant
;
}
}
public
int
batchSetStatus
(
Boolean
status
,
String
ids
)
throws
Exception
{
int
result
=
0
;
try
{
String
statusStr
=
""
;
if
(
status
)
{
statusStr
=
"批量启用"
;
}
else
{
statusStr
=
"批量禁用"
;
}
logService
.
insertLog
(
"用户"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
ids
).
append
(
"-"
).
append
(
statusStr
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
List
<
Long
>
idList
=
StringUtil
.
strToLongList
(
ids
);
Tenant
tenant
=
new
Tenant
();
tenant
.
setEnabled
(
status
);
TenantExample
example
=
new
TenantExample
();
example
.
createCriteria
().
andIdIn
(
idList
);
result
=
tenantMapper
.
updateByExampleSelective
(
tenant
,
example
);
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
}
return
result
;
}
}
}
jshERP-boot/src/main/java/com/jsh/erp/service/user/UserService.java
View file @
1db9b945
...
@@ -295,6 +295,11 @@ public class UserService {
...
@@ -295,6 +295,11 @@ public class UserService {
if
(
list
.
get
(
0
).
getStatus
()!=
0
)
{
if
(
list
.
get
(
0
).
getStatus
()!=
0
)
{
return
ExceptionCodeConstants
.
UserExceptionCode
.
BLACK_USER
;
return
ExceptionCodeConstants
.
UserExceptionCode
.
BLACK_USER
;
}
}
Long
tenantId
=
list
.
get
(
0
).
getTenantId
();
Tenant
tenant
=
tenantService
.
getTenantByTenantId
(
tenantId
);
if
(
tenant
!=
null
&&
tenant
.
getEnabled
()!=
null
&&
!
tenant
.
getEnabled
())
{
return
ExceptionCodeConstants
.
UserExceptionCode
.
BLACK_TENANT
;
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
">>>>>>>>访问验证用户姓名是否存在后台信息异常"
,
e
);
logger
.
error
(
">>>>>>>>访问验证用户姓名是否存在后台信息异常"
,
e
);
...
...
jshERP-boot/src/main/java/com/jsh/erp/utils/ExceptionCodeConstants.java
View file @
1db9b945
...
@@ -16,7 +16,7 @@ public interface ExceptionCodeConstants {
...
@@ -16,7 +16,7 @@ public interface ExceptionCodeConstants {
public
static
final
int
USER_PASSWORD_ERROR
=
2
;
public
static
final
int
USER_PASSWORD_ERROR
=
2
;
/**
/**
* 被加入黑名单
*
用户
被加入黑名单
*/
*/
public
static
final
int
BLACK_USER
=
3
;
public
static
final
int
BLACK_USER
=
3
;
...
@@ -29,5 +29,10 @@ public interface ExceptionCodeConstants {
...
@@ -29,5 +29,10 @@ public interface ExceptionCodeConstants {
* 访问数据库异常
* 访问数据库异常
*/
*/
public
static
final
int
USER_ACCESS_EXCEPTION
=
5
;
public
static
final
int
USER_ACCESS_EXCEPTION
=
5
;
/**
* 租户被加入黑名单
*/
public
static
final
int
BLACK_TENANT
=
6
;
}
}
}
}
jshERP-boot/src/main/resources/mapper_xml/TenantMapper.xml
View file @
1db9b945
<?xml version="1.0" encoding="UTF-8" ?>
<?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" >
<!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.TenantMapper"
>
<mapper
namespace=
"com.jsh.erp.datasource.mappers.TenantMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.jsh.erp.datasource.entities.Tenant"
>
<resultMap
id=
"BaseResultMap"
type=
"com.jsh.erp.datasource.entities.Tenant"
>
<!--
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
WARNING - @mbggenerated
<result
column=
"tenant_id"
jdbcType=
"BIGINT"
property=
"tenantId"
/>
This element is automatically generated by MyBatis Generator, do not modify.
<result
column=
"login_name"
jdbcType=
"VARCHAR"
property=
"loginName"
/>
-->
<result
column=
"user_num_limit"
jdbcType=
"INTEGER"
property=
"userNumLimit"
/>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"bills_num_limit"
jdbcType=
"INTEGER"
property=
"billsNumLimit"
/>
<result
column=
"tenant_id"
property=
"tenantId"
jdbcType=
"BIGINT"
/>
<result
column=
"enabled"
jdbcType=
"BIT"
property=
"enabled"
/>
<result
column=
"login_name"
property=
"loginName"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"user_num_limit"
property=
"userNumLimit"
jdbcType=
"INTEGER"
/>
<result
column=
"bills_num_limit"
property=
"billsNumLimit"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<sql
id=
"Example_Where_Clause"
>
<!--
<where>
WARNING - @mbggenerated
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
This element is automatically generated by MyBatis Generator, do not modify.
<if
test=
"criteria.valid"
>
-->
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<where
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
<choose>
<if
test=
"criteria.valid"
>
<when
test=
"criterion.noValue"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"and"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose
>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
and ${criterion.condition}
</when>
</when>
<when
test=
"criterion.singleValue"
>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
and ${criterion.condition} #{criterion.value}
</when>
</when>
<when
test=
"criterion.betweenValue"
>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
</when>
<when
test=
"criterion.listValue"
>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
and ${criterion.condition}
<foreach
collection=
"criterion.value"
item=
"listItem"
open=
"("
close=
")"
separator=
","
>
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
#{listItem}
</foreach>
</foreach>
</when>
</when>
...
@@ -46,29 +39,25 @@
...
@@ -46,29 +39,25 @@
</foreach>
</foreach>
</where>
</where>
</sql>
</sql>
<sql
id=
"Update_By_Example_Where_Clause"
>
<sql
id=
"Update_By_Example_Where_Clause"
>
<!--
<where>
WARNING - @mbggenerated
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
This element is automatically generated by MyBatis Generator, do not modify.
<if
test=
"criteria.valid"
>
-->
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<where
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<choose>
<if
test=
"criteria.valid"
>
<when
test=
"criterion.noValue"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"and"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose
>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
and ${criterion.condition}
</when>
</when>
<when
test=
"criterion.singleValue"
>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
and ${criterion.condition} #{criterion.value}
</when>
</when>
<when
test=
"criterion.betweenValue"
>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
</when>
<when
test=
"criterion.listValue"
>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
and ${criterion.condition}
<foreach
collection=
"criterion.value"
item=
"listItem"
open=
"("
close=
")"
separator=
","
>
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
#{listItem}
</foreach>
</foreach>
</when>
</when>
...
@@ -79,209 +68,175 @@
...
@@ -79,209 +68,175 @@
</foreach>
</foreach>
</where>
</where>
</sql>
</sql>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
<!--
id, tenant_id, login_name, user_num_limit, bills_num_limit, enabled, create_time
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, tenant_id, login_name, user_num_limit, bills_num_limit, create_time
</sql>
</sql>
<select
id=
"selectByExample"
resultMap=
"BaseResultMap"
parameterType=
"com.jsh.erp.datasource.entities.TenantExample"
>
<select
id=
"selectByExample"
parameterType=
"com.jsh.erp.datasource.entities.TenantExample"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
select
<if
test=
"distinct"
>
<if
test=
"distinct"
>
distinct
distinct
</if>
</if>
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from jsh_tenant
from jsh_tenant
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
<include
refid=
"Example_Where_Clause"
/>
</if>
</if>
<if
test=
"orderByClause != null"
>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
order by ${orderByClause}
</if>
</if>
</select>
</select>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from jsh_tenant
from jsh_tenant
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</select>
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_tenant
delete from jsh_tenant
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</delete>
</delete>
<delete
id=
"deleteByExample"
parameterType=
"com.jsh.erp.datasource.entities.TenantExample"
>
<delete
id=
"deleteByExample"
parameterType=
"com.jsh.erp.datasource.entities.TenantExample"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_tenant
delete from jsh_tenant
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
<include
refid=
"Example_Where_Clause"
/>
</if>
</if>
</delete>
</delete>
<insert
id=
"insert"
parameterType=
"com.jsh.erp.datasource.entities.Tenant"
>
<insert
id=
"insert"
parameterType=
"com.jsh.erp.datasource.entities.Tenant"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_tenant (id, tenant_id, login_name,
insert into jsh_tenant (id, tenant_id, login_name,
user_num_limit, bills_num_limit,
create_time
user_num_limit, bills_num_limit,
enabled,
)
create_time)
values (#{id,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT}, #{loginName,jdbcType=VARCHAR},
values (#{id,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT}, #{loginName,jdbcType=VARCHAR},
#{userNumLimit,jdbcType=INTEGER}, #{billsNumLimit,jdbcType=INTEGER}, #{
createTime,jdbcType=TIMESTAMP}
#{userNumLimit,jdbcType=INTEGER}, #{billsNumLimit,jdbcType=INTEGER}, #{
enabled,jdbcType=BIT},
)
#{createTime,jdbcType=TIMESTAMP})
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.jsh.erp.datasource.entities.Tenant"
>
<insert
id=
"insertSelective"
parameterType=
"com.jsh.erp.datasource.entities.Tenant"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_tenant
insert into jsh_tenant
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
<if
test=
"id != null"
>
id,
id,
</if>
</if>
<if
test=
"tenantId != null"
>
<if
test=
"tenantId != null"
>
tenant_id,
tenant_id,
</if>
</if>
<if
test=
"loginName != null"
>
<if
test=
"loginName != null"
>
login_name,
login_name,
</if>
</if>
<if
test=
"userNumLimit != null"
>
<if
test=
"userNumLimit != null"
>
user_num_limit,
user_num_limit,
</if>
</if>
<if
test=
"billsNumLimit != null"
>
<if
test=
"billsNumLimit != null"
>
bills_num_limit,
bills_num_limit,
</if>
</if>
<if
test=
"createTime != null"
>
<if
test=
"enabled != null"
>
enabled,
</if>
<if
test=
"createTime != null"
>
create_time,
create_time,
</if>
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
<if
test=
"id != null"
>
#{id,jdbcType=BIGINT},
#{id,jdbcType=BIGINT},
</if>
</if>
<if
test=
"tenantId != null"
>
<if
test=
"tenantId != null"
>
#{tenantId,jdbcType=BIGINT},
#{tenantId,jdbcType=BIGINT},
</if>
</if>
<if
test=
"loginName != null"
>
<if
test=
"loginName != null"
>
#{loginName,jdbcType=VARCHAR},
#{loginName,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"userNumLimit != null"
>
<if
test=
"userNumLimit != null"
>
#{userNumLimit,jdbcType=INTEGER},
#{userNumLimit,jdbcType=INTEGER},
</if>
</if>
<if
test=
"billsNumLimit != null"
>
<if
test=
"billsNumLimit != null"
>
#{billsNumLimit,jdbcType=INTEGER},
#{billsNumLimit,jdbcType=INTEGER},
</if>
</if>
<if
test=
"createTime != null"
>
<if
test=
"enabled != null"
>
#{enabled,jdbcType=BIT},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
#{createTime,jdbcType=TIMESTAMP},
</if>
</if>
</trim>
</trim>
</insert>
</insert>
<select
id=
"countByExample"
parameterType=
"com.jsh.erp.datasource.entities.TenantExample"
resultType=
"java.lang.Integer"
>
<select
id=
"countByExample"
parameterType=
"com.jsh.erp.datasource.entities.TenantExample"
resultType=
"java.lang.Long"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from jsh_tenant
select count(*) from jsh_tenant
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
<include
refid=
"Example_Where_Clause"
/>
</if>
</if>
</select>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_tenant
update jsh_tenant
<set
>
<set>
<if
test=
"record.id != null"
>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=BIGINT},
id = #{record.id,jdbcType=BIGINT},
</if>
</if>
<if
test=
"record.tenantId != null"
>
<if
test=
"record.tenantId != null"
>
tenant_id = #{record.tenantId,jdbcType=BIGINT},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
</if>
<if
test=
"record.loginName != null"
>
<if
test=
"record.loginName != null"
>
login_name = #{record.loginName,jdbcType=VARCHAR},
login_name = #{record.loginName,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"record.userNumLimit != null"
>
<if
test=
"record.userNumLimit != null"
>
user_num_limit = #{record.userNumLimit,jdbcType=INTEGER},
user_num_limit = #{record.userNumLimit,jdbcType=INTEGER},
</if>
</if>
<if
test=
"record.billsNumLimit != null"
>
<if
test=
"record.billsNumLimit != null"
>
bills_num_limit = #{record.billsNumLimit,jdbcType=INTEGER},
bills_num_limit = #{record.billsNumLimit,jdbcType=INTEGER},
</if>
</if>
<if
test=
"record.createTime != null"
>
<if
test=
"record.enabled != null"
>
enabled = #{record.enabled,jdbcType=BIT},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
</if>
</set>
</set>
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</if>
</update>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
<update
id=
"updateByExample"
parameterType=
"map"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_tenant
update jsh_tenant
set id = #{record.id,jdbcType=BIGINT},
set id = #{record.id,jdbcType=BIGINT},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
login_name = #{record.loginName,jdbcType=VARCHAR},
login_name = #{record.loginName,jdbcType=VARCHAR},
user_num_limit = #{record.userNumLimit,jdbcType=INTEGER},
user_num_limit = #{record.userNumLimit,jdbcType=INTEGER},
bills_num_limit = #{record.billsNumLimit,jdbcType=INTEGER},
bills_num_limit = #{record.billsNumLimit,jdbcType=INTEGER},
enabled = #{record.enabled,jdbcType=BIT},
create_time = #{record.createTime,jdbcType=TIMESTAMP}
create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</if>
</update>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.jsh.erp.datasource.entities.Tenant"
>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.jsh.erp.datasource.entities.Tenant"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_tenant
update jsh_tenant
<set
>
<set>
<if
test=
"tenantId != null"
>
<if
test=
"tenantId != null"
>
tenant_id = #{tenantId,jdbcType=BIGINT},
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
</if>
<if
test=
"loginName != null"
>
<if
test=
"loginName != null"
>
login_name = #{loginName,jdbcType=VARCHAR},
login_name = #{loginName,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"userNumLimit != null"
>
<if
test=
"userNumLimit != null"
>
user_num_limit = #{userNumLimit,jdbcType=INTEGER},
user_num_limit = #{userNumLimit,jdbcType=INTEGER},
</if>
</if>
<if
test=
"billsNumLimit != null"
>
<if
test=
"billsNumLimit != null"
>
bills_num_limit = #{billsNumLimit,jdbcType=INTEGER},
bills_num_limit = #{billsNumLimit,jdbcType=INTEGER},
</if>
</if>
<if
test=
"createTime != null"
>
<if
test=
"enabled != null"
>
enabled = #{enabled,jdbcType=BIT},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</if>
</set>
</set>
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.jsh.erp.datasource.entities.Tenant"
>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.jsh.erp.datasource.entities.Tenant"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_tenant
update jsh_tenant
set tenant_id = #{tenantId,jdbcType=BIGINT},
set tenant_id = #{tenantId,jdbcType=BIGINT},
login_name = #{loginName,jdbcType=VARCHAR},
login_name = #{loginName,jdbcType=VARCHAR},
user_num_limit = #{userNumLimit,jdbcType=INTEGER},
user_num_limit = #{userNumLimit,jdbcType=INTEGER},
bills_num_limit = #{billsNumLimit,jdbcType=INTEGER},
bills_num_limit = #{billsNumLimit,jdbcType=INTEGER},
enabled = #{enabled,jdbcType=BIT},
create_time = #{createTime,jdbcType=TIMESTAMP}
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</update>
...
...
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