Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-platform-enterprise
Commits
8a79efd2
Commit
8a79efd2
authored
Mar 03, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
平台规则新增接口添加
parent
eae92182
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
871 additions
and
0 deletions
+871
-0
pom.xml
gic-platform-enterprise-api/pom.xml
+6
-0
RuleClassifyDTO.java
...ain/java/com/gic/enterprise/dto/rule/RuleClassifyDTO.java
+73
-0
RuleClassifySceneDTO.java
...ava/com/gic/enterprise/dto/rule/RuleClassifySceneDTO.java
+78
-0
RuleDTO.java
...pi/src/main/java/com/gic/enterprise/dto/rule/RuleDTO.java
+68
-0
ConfigRuleApiService.java
...java/com/gic/enterprise/service/ConfigRuleApiService.java
+43
-0
pom.xml
gic-platform-enterprise-service/pom.xml
+6
-0
TabConfigRuleMapper.java
...va/com/gic/enterprise/dao/mapper/TabConfigRuleMapper.java
+57
-0
TabConfigRule.java
...rc/main/java/com/gic/enterprise/entity/TabConfigRule.java
+89
-0
ConfigRuleService.java
...in/java/com/gic/enterprise/service/ConfigRuleService.java
+57
-0
ConfigRuleServiceImpl.java
...om/gic/enterprise/service/impl/ConfigRuleServiceImpl.java
+61
-0
ConfigRuleApiServiceImpl.java
...terprise/service/outer/impl/ConfigRuleApiServiceImpl.java
+108
-0
dubbo-gic-platform-enterprise-service.xml
.../main/resources/dubbo-gic-platform-enterprise-service.xml
+2
-0
TabConfigRuleMapper.xml
...service/src/main/resources/mapper/TabConfigRuleMapper.xml
+223
-0
No files found.
gic-platform-enterprise-api/pom.xml
View file @
8a79efd2
...
...
@@ -46,6 +46,12 @@
<artifactId>
hibernate-validator
</artifactId>
<version>
6.0.16.Final
</version>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
1.18.0
</version>
<scope>
provided
</scope>
</dependency>
</dependencies>
...
...
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/dto/rule/RuleClassifyDTO.java
0 → 100644
View file @
8a79efd2
package
com
.
gic
.
enterprise
.
dto
.
rule
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 平台规则配置:分类
* @ClassName: RuleClassifyDTO
* @Description:
* @author guojuxing
* @date 2020/3/3 2:45 PM
*/
@Data
public
class
RuleClassifyDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
6258321185779741516L
;
/**
*
*/
private
Integer
ruleId
;
/**
* 规则/分类/场景名称(场景名称是冗余数据)
*/
private
String
name
;
/**
* 分类类型:icon
*/
private
String
classifyIcon
;
/**
* 分类/场景描述
*/
private
String
desc
;
/**
* 分类/场景备注
*/
private
String
remark
;
/**
* 父级id
*/
private
Integer
parentRuleId
;
/**
* 层级:1:规则 2:分类 3:场景
*/
private
Integer
ruleLevel
;
/**
* 规则链id:_2_3_格式数据
*/
private
String
ruleChain
;
/**
* 状态值 1:有效 0:无效
*/
private
Integer
status
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
}
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/dto/rule/RuleClassifySceneDTO.java
0 → 100644
View file @
8a79efd2
package
com
.
gic
.
enterprise
.
dto
.
rule
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 平台规则配置:场景
* @ClassName: RuleClassifySceneDTO
* @Description:
* @author guojuxing
* @date 2020/3/3 2:46 PM
*/
@Data
public
class
RuleClassifySceneDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
2944424324223164756L
;
/**
*
*/
private
Integer
ruleId
;
/**
* 规则/分类/场景名称(场景名称是冗余数据)
*/
private
String
name
;
/**
* 分类/场景描述
*/
private
String
desc
;
/**
* 分类/场景备注
*/
private
String
remark
;
/**
* 营销场景ID/code
*/
private
String
marketScene
;
/**
* 营销对象 1:会员卡域 2:服务号域 3:小程序域
*/
private
Integer
marketObject
;
/**
* 父级id
*/
private
Integer
parentRuleId
;
/**
* 层级:1:规则 2:分类 3:场景
*/
private
Integer
ruleLevel
;
/**
* 规则链id:_2_3_格式数据
*/
private
String
ruleChain
;
/**
* 状态值 1:有效 0:无效
*/
private
Integer
status
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
}
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/dto/rule/RuleDTO.java
0 → 100644
View file @
8a79efd2
package
com
.
gic
.
enterprise
.
dto
.
rule
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 平台规则配置:规则类型
* @ClassName: RuleDTO
* @Description:
* @author guojuxing
* @date 2020/3/3 2:43 PM
*/
@Data
public
class
RuleDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
5568436339396966487L
;
/**
*
*/
private
Integer
ruleId
;
/**
* 规则/分类/场景名称(场景名称是冗余数据)
*/
private
String
name
;
/**
* 规则类型:应用名称
*/
private
String
appName
;
/**
* 规则类型:应用code
*/
private
String
appCode
;
/**
* 父级id
*/
private
Integer
parentRuleId
;
/**
* 层级:1:规则 2:分类 3:场景
*/
private
Integer
ruleLevel
;
/**
* 规则链id:_2_3_格式数据
*/
private
String
ruleChain
;
/**
* 状态值 1:有效 0:无效
*/
private
Integer
status
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
}
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/service/ConfigRuleApiService.java
0 → 100644
View file @
8a79efd2
package
com
.
gic
.
enterprise
.
service
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.enterprise.dto.rule.RuleClassifyDTO
;
import
com.gic.enterprise.dto.rule.RuleClassifySceneDTO
;
import
com.gic.enterprise.dto.rule.RuleDTO
;
/**
* 平台规则配置
* @ClassName: ConfigRuleApiService
* @Description:
* @author guojuxing
* @date 2020/3/3 2:50 PM
*/
public
interface
ConfigRuleApiService
{
/**
* 新增规则
* @Title: saveRule
* @Description:
* @author guojuxing
* @param dto
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
*/
ServiceResponse
<
Integer
>
saveRule
(
RuleDTO
dto
);
/**
* 新增分类
* @Title: saveRuleClassify
* @Description:
* @author guojuxing
* @param dto
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
*/
ServiceResponse
<
Integer
>
saveRuleClassify
(
RuleClassifyDTO
dto
);
/**
* 新增场景
* @Title: saveRuleClassifyScene
* @Description:
* @author guojuxing
* @param dto
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
*/
ServiceResponse
<
Integer
>
saveRuleClassifyScene
(
RuleClassifySceneDTO
dto
);
}
gic-platform-enterprise-service/pom.xml
View file @
8a79efd2
...
...
@@ -170,6 +170,12 @@
<artifactId>
gic-mall-share-api
</artifactId>
<version>
${gic-mall-share-api}
</version>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
1.18.0
</version>
<scope>
provided
</scope>
</dependency>
</dependencies>
<build>
...
...
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/dao/mapper/TabConfigRuleMapper.java
0 → 100644
View file @
8a79efd2
package
com
.
gic
.
enterprise
.
dao
.
mapper
;
import
com.gic.enterprise.entity.TabConfigRule
;
import
org.apache.ibatis.annotations.Param
;
public
interface
TabConfigRuleMapper
{
/**
* 根据主键删除
*
* @param ruleId 主键
* @return 更新条目数
*/
int
deleteByPrimaryKey
(
Integer
ruleId
);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
insert
(
TabConfigRule
record
);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
insertSelective
(
TabConfigRule
record
);
/**
* 根据主键查询
*
* @param ruleId 主键
* @return 实体对象
*/
TabConfigRule
selectByPrimaryKey
(
Integer
ruleId
);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
updateByPrimaryKeySelective
(
TabConfigRule
record
);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
updateByPrimaryKey
(
TabConfigRule
record
);
int
countRepeatName
(
@Param
(
"ruleId"
)
Integer
ruleId
,
@Param
(
"ruleLevel"
)
Integer
ruleLevel
,
@Param
(
"name"
)
String
name
);
}
\ No newline at end of file
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/entity/TabConfigRule.java
0 → 100644
View file @
8a79efd2
package
com
.
gic
.
enterprise
.
entity
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/**
* tab_config_rule
*/
@Accessors
(
chain
=
true
)
@Data
public
class
TabConfigRule
{
/**
*
*/
private
Integer
ruleId
;
/**
* 规则/分类/场景名称(场景名称是冗余数据)
*/
private
String
name
;
/**
* 规则类型:应用名称
*/
private
String
appName
;
/**
* 规则类型:应用code
*/
private
String
appCode
;
/**
* 分类类型:icon
*/
private
String
classifyIcon
;
/**
* 分类/场景描述
*/
private
String
desc
;
/**
* 分类/场景备注
*/
private
String
remark
;
/**
* 营销场景ID/code
*/
private
String
marketScene
;
/**
* 营销对象 1:会员卡域 2:服务号域 3:小程序域
*/
private
Integer
marketObject
;
/**
* 父级id
*/
private
Integer
parentRuleId
;
/**
* 层级:1:规则 2:分类 3:场景
*/
private
Integer
ruleLevel
;
/**
* 规则链id:_2_3_格式数据
*/
private
String
ruleChain
;
/**
* 状态值 1:有效 0:无效
*/
private
Integer
status
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
}
\ No newline at end of file
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/ConfigRuleService.java
0 → 100644
View file @
8a79efd2
package
com
.
gic
.
enterprise
.
service
;
import
com.gic.enterprise.dto.rule.RuleClassifyDTO
;
import
com.gic.enterprise.dto.rule.RuleClassifySceneDTO
;
import
com.gic.enterprise.dto.rule.RuleDTO
;
import
com.gic.enterprise.entity.TabConfigRule
;
/**
* 平台规则配置
* @ClassName: ConfigRuleService
* @Description:
* @author guojuxing
* @date 2020/3/3 2:51 PM
*/
public
interface
ConfigRuleService
{
/**
* 新增规则
* @Title: saveRule
* @Description:
* @author guojuxing
* @param dto
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
*/
Integer
saveRule
(
RuleDTO
dto
);
/**
* 新增分类
* @Title: saveRuleClassify
* @Description:
* @author guojuxing
* @param dto
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
*/
Integer
saveRuleClassify
(
RuleClassifyDTO
dto
);
/**
* 新增场景
* @Title: saveRuleClassifyScene
* @Description:
* @author guojuxing
* @param dto
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
*/
Integer
saveRuleClassifyScene
(
RuleClassifySceneDTO
dto
);
void
update
(
TabConfigRule
record
);
TabConfigRule
getByRuleId
(
Integer
ruleId
);
/**
* 名称唯一性校验
* @param ruleId
* @param ruleLevel
* @param name
* @return
*/
boolean
isRepeatName
(
Integer
ruleId
,
Integer
ruleLevel
,
String
name
);
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/impl/ConfigRuleServiceImpl.java
0 → 100644
View file @
8a79efd2
package
com
.
gic
.
enterprise
.
service
.
impl
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.dao.mapper.TabConfigRuleMapper
;
import
com.gic.enterprise.dto.rule.RuleClassifyDTO
;
import
com.gic.enterprise.dto.rule.RuleClassifySceneDTO
;
import
com.gic.enterprise.dto.rule.RuleDTO
;
import
com.gic.enterprise.entity.TabConfigRule
;
import
com.gic.enterprise.service.ConfigRuleService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
@Service
(
"configRuleService"
)
public
class
ConfigRuleServiceImpl
implements
ConfigRuleService
{
@Autowired
private
TabConfigRuleMapper
tabConfigRuleMapper
;
@Override
public
Integer
saveRule
(
RuleDTO
dto
)
{
return
save
(
EntityUtil
.
changeEntityNew
(
TabConfigRule
.
class
,
dto
));
}
@Override
public
Integer
saveRuleClassify
(
RuleClassifyDTO
dto
)
{
return
save
(
EntityUtil
.
changeEntityNew
(
TabConfigRule
.
class
,
dto
));
}
@Override
public
Integer
saveRuleClassifyScene
(
RuleClassifySceneDTO
dto
)
{
return
save
(
EntityUtil
.
changeEntityNew
(
TabConfigRule
.
class
,
dto
));
}
@Override
public
void
update
(
TabConfigRule
record
)
{
tabConfigRuleMapper
.
updateByPrimaryKeySelective
(
record
);
}
@Override
public
TabConfigRule
getByRuleId
(
Integer
ruleId
)
{
return
tabConfigRuleMapper
.
selectByPrimaryKey
(
ruleId
);
}
@Override
public
boolean
isRepeatName
(
Integer
ruleId
,
Integer
ruleLevel
,
String
name
)
{
int
count
=
tabConfigRuleMapper
.
countRepeatName
(
ruleId
,
ruleLevel
,
name
);
if
(
count
>
0
)
{
return
true
;
}
return
false
;
}
private
Integer
save
(
TabConfigRule
record
)
{
record
.
setStatus
(
1
);
record
.
setCreateTime
(
new
Date
());
record
.
setUpdateTime
(
new
Date
());
tabConfigRuleMapper
.
insertSelective
(
record
);
return
record
.
getRuleId
();
}
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/ConfigRuleApiServiceImpl.java
0 → 100644
View file @
8a79efd2
package
com
.
gic
.
enterprise
.
service
.
outer
.
impl
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.enterprise.dto.rule.RuleClassifyDTO
;
import
com.gic.enterprise.dto.rule.RuleClassifySceneDTO
;
import
com.gic.enterprise.dto.rule.RuleDTO
;
import
com.gic.enterprise.entity.TabConfigRule
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.service.ConfigRuleApiService
;
import
com.gic.enterprise.service.ConfigRuleService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
(
"configRuleApiService"
)
public
class
ConfigRuleApiServiceImpl
implements
ConfigRuleApiService
{
@Autowired
private
ConfigRuleService
configRuleService
;
@Override
public
ServiceResponse
<
Integer
>
saveRule
(
RuleDTO
dto
)
{
if
(
StringUtils
.
isBlank
(
dto
.
getName
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"规则名称不能为空"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getAppName
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"应用名称不能为空"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getAppCode
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"应用code不能为空"
);
}
//名称唯一性校验
if
(
configRuleService
.
isRepeatName
(
null
,
1
,
dto
.
getName
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"规则名称重复"
);
}
//填充
dto
.
setParentRuleId
(
0
);
dto
.
setRuleLevel
(
1
);
Integer
ruleId
=
configRuleService
.
saveRule
(
dto
);
//更新操作ID链数据
configRuleService
.
update
(
new
TabConfigRule
().
setRuleId
(
ruleId
).
setRuleChain
(
"_0_"
+
ruleId
+
"_"
));
return
ServiceResponse
.
success
(
ruleId
);
}
@Override
public
ServiceResponse
<
Integer
>
saveRuleClassify
(
RuleClassifyDTO
dto
)
{
TabConfigRule
record
=
configRuleService
.
getByRuleId
(
dto
.
getParentRuleId
());
if
(
record
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"规则ID错误,规则不存在"
);
}
if
(
record
.
getRuleLevel
()
!=
1
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"规则ID错误,不是规则类型"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getName
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类名称不能为空"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getClassifyIcon
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类icon不能为空"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getDesc
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类描述不能为空"
);
}
dto
.
setRuleLevel
(
2
);
Integer
ruleId
=
configRuleService
.
saveRuleClassify
(
dto
);
//更新操作ID链数据
configRuleService
.
update
(
new
TabConfigRule
().
setRuleId
(
ruleId
).
setRuleChain
(
"_0_"
+
dto
.
getParentRuleId
()
+
"_"
+
ruleId
+
"_"
));
return
ServiceResponse
.
success
(
ruleId
);
}
@Override
public
ServiceResponse
<
Integer
>
saveRuleClassifyScene
(
RuleClassifySceneDTO
dto
)
{
TabConfigRule
record
=
configRuleService
.
getByRuleId
(
dto
.
getParentRuleId
());
if
(
record
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类ID错误,规则不存在"
);
}
if
(
record
.
getRuleLevel
()
!=
2
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类ID错误,不是分类类型"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getMarketScene
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"场景code不能为空"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getName
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"场景名称不能为空"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getDesc
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"场景描述不能为空"
);
}
Integer
marketObject
=
dto
.
getMarketObject
();
boolean
isNotRightMarketObject
=
marketObject
==
null
||
(
marketObject
!=
1
&&
marketObject
!=
2
&&
marketObject
!=
3
);
if
(
isNotRightMarketObject
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"营销对象值非法"
);
}
dto
.
setRuleLevel
(
3
);
Integer
firstRuleId
=
record
.
getParentRuleId
();
Integer
ruleId
=
configRuleService
.
saveRuleClassifyScene
(
dto
);
//更新操作ID链数据
configRuleService
.
update
(
new
TabConfigRule
().
setRuleId
(
ruleId
)
.
setRuleChain
(
"_0_"
+
firstRuleId
+
"_"
+
dto
.
getParentRuleId
()
+
"_"
+
ruleId
+
"_"
));
return
ServiceResponse
.
success
(
ruleId
);
}
}
gic-platform-enterprise-service/src/main/resources/dubbo-gic-platform-enterprise-service.xml
View file @
8a79efd2
...
...
@@ -120,6 +120,8 @@
<dubbo:service
interface=
"com.gic.enterprise.service.AccountStandardApiService"
ref=
"accountStandardApiService"
timeout=
"6000"
/>
<dubbo:service
interface=
"com.gic.enterprise.service.CustomUdeskFieldApiService"
ref=
"customUdeskFieldApiService"
timeout=
"6000"
/>
<dubbo:service
interface=
"com.gic.enterprise.service.AppletDecorationConfigApiService"
ref=
"appletDecorationConfigApiService"
timeout=
"6000"
/>
<!--平台规则配置-->
<dubbo:service
interface=
"com.gic.enterprise.service.ConfigRuleApiService"
ref=
"configRuleApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.mall.share.api.service.ShopApiService"
id=
"shopApiService"
timeout=
"6000"
/>
...
...
gic-platform-enterprise-service/src/main/resources/mapper/TabConfigRuleMapper.xml
0 → 100644
View file @
8a79efd2
<?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.gic.enterprise.dao.mapper.TabConfigRuleMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.enterprise.entity.TabConfigRule"
>
<id
column=
"rule_id"
jdbcType=
"INTEGER"
property=
"ruleId"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"app_name"
jdbcType=
"VARCHAR"
property=
"appName"
/>
<result
column=
"app_code"
jdbcType=
"VARCHAR"
property=
"appCode"
/>
<result
column=
"classify_icon"
jdbcType=
"VARCHAR"
property=
"classifyIcon"
/>
<result
column=
"desc"
jdbcType=
"VARCHAR"
property=
"desc"
/>
<result
column=
"remark"
jdbcType=
"VARCHAR"
property=
"remark"
/>
<result
column=
"market_scene"
jdbcType=
"VARCHAR"
property=
"marketScene"
/>
<result
column=
"market_object"
jdbcType=
"INTEGER"
property=
"marketObject"
/>
<result
column=
"parent_rule_id"
jdbcType=
"INTEGER"
property=
"parentRuleId"
/>
<result
column=
"rule_level"
jdbcType=
"INTEGER"
property=
"ruleLevel"
/>
<result
column=
"rule_chain"
jdbcType=
"VARCHAR"
property=
"ruleChain"
/>
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
rule_id, name, app_name, app_code, classify_icon, desc, remark, market_scene, market_object,
parent_rule_id, rule_level, rule_chain, status, create_time, update_time
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_config_rule
where rule_id = #{ruleId,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from tab_config_rule
where rule_id = #{ruleId,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.enterprise.entity.TabConfigRule"
>
insert into tab_config_rule (rule_id, name, app_name,
app_code, classify_icon, desc,
remark, market_scene, market_object,
parent_rule_id, rule_level, rule_chain,
status, create_time, update_time
)
values (#{ruleId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{appName,jdbcType=VARCHAR},
#{appCode,jdbcType=VARCHAR}, #{classifyIcon,jdbcType=VARCHAR}, #{desc,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{marketScene,jdbcType=VARCHAR}, #{marketObject,jdbcType=INTEGER},
#{parentRuleId,jdbcType=INTEGER}, #{ruleLevel,jdbcType=INTEGER}, #{ruleChain,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.enterprise.entity.TabConfigRule"
useGeneratedKeys=
"true"
keyProperty=
"ruleId"
>
insert into tab_config_rule
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"ruleId != null"
>
rule_id,
</if>
<if
test=
"name != null"
>
name,
</if>
<if
test=
"appName != null"
>
app_name,
</if>
<if
test=
"appCode != null"
>
app_code,
</if>
<if
test=
"classifyIcon != null"
>
classify_icon,
</if>
<if
test=
"desc != null"
>
desc,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"marketScene != null"
>
market_scene,
</if>
<if
test=
"marketObject != null"
>
market_object,
</if>
<if
test=
"parentRuleId != null"
>
parent_rule_id,
</if>
<if
test=
"ruleLevel != null"
>
rule_level,
</if>
<if
test=
"ruleChain != null"
>
rule_chain,
</if>
<if
test=
"status != null"
>
status,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"ruleId != null"
>
#{ruleId,jdbcType=INTEGER},
</if>
<if
test=
"name != null"
>
#{name,jdbcType=VARCHAR},
</if>
<if
test=
"appName != null"
>
#{appName,jdbcType=VARCHAR},
</if>
<if
test=
"appCode != null"
>
#{appCode,jdbcType=VARCHAR},
</if>
<if
test=
"classifyIcon != null"
>
#{classifyIcon,jdbcType=VARCHAR},
</if>
<if
test=
"desc != null"
>
#{desc,jdbcType=VARCHAR},
</if>
<if
test=
"remark != null"
>
#{remark,jdbcType=VARCHAR},
</if>
<if
test=
"marketScene != null"
>
#{marketScene,jdbcType=VARCHAR},
</if>
<if
test=
"marketObject != null"
>
#{marketObject,jdbcType=INTEGER},
</if>
<if
test=
"parentRuleId != null"
>
#{parentRuleId,jdbcType=INTEGER},
</if>
<if
test=
"ruleLevel != null"
>
#{ruleLevel,jdbcType=INTEGER},
</if>
<if
test=
"ruleChain != null"
>
#{ruleChain,jdbcType=VARCHAR},
</if>
<if
test=
"status != null"
>
#{status,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.enterprise.entity.TabConfigRule"
>
update tab_config_rule
<set>
<if
test=
"name != null"
>
name = #{name,jdbcType=VARCHAR},
</if>
<if
test=
"appName != null"
>
app_name = #{appName,jdbcType=VARCHAR},
</if>
<if
test=
"appCode != null"
>
app_code = #{appCode,jdbcType=VARCHAR},
</if>
<if
test=
"classifyIcon != null"
>
classify_icon = #{classifyIcon,jdbcType=VARCHAR},
</if>
<if
test=
"desc != null"
>
desc = #{desc,jdbcType=VARCHAR},
</if>
<if
test=
"remark != null"
>
remark = #{remark,jdbcType=VARCHAR},
</if>
<if
test=
"marketScene != null"
>
market_scene = #{marketScene,jdbcType=VARCHAR},
</if>
<if
test=
"marketObject != null"
>
market_object = #{marketObject,jdbcType=INTEGER},
</if>
<if
test=
"parentRuleId != null"
>
parent_rule_id = #{parentRuleId,jdbcType=INTEGER},
</if>
<if
test=
"ruleLevel != null"
>
rule_level = #{ruleLevel,jdbcType=INTEGER},
</if>
<if
test=
"ruleChain != null"
>
rule_chain = #{ruleChain,jdbcType=VARCHAR},
</if>
<if
test=
"status != null"
>
status = #{status,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where rule_id = #{ruleId,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.enterprise.entity.TabConfigRule"
>
update tab_config_rule
set name = #{name,jdbcType=VARCHAR},
app_name = #{appName,jdbcType=VARCHAR},
app_code = #{appCode,jdbcType=VARCHAR},
classify_icon = #{classifyIcon,jdbcType=VARCHAR},
desc = #{desc,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
market_scene = #{marketScene,jdbcType=VARCHAR},
market_object = #{marketObject,jdbcType=INTEGER},
parent_rule_id = #{parentRuleId,jdbcType=INTEGER},
rule_level = #{ruleLevel,jdbcType=INTEGER},
rule_chain = #{ruleChain,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where rule_id = #{ruleId,jdbcType=INTEGER}
</update>
<select
id=
"countRepeatName"
resultType=
"int"
>
select count(1) from tab_config_rule
where status = 1
and rule_level = #{ruleLevel}
and name = #{name}
<if
test=
"ruleId != null"
>
and rule_id
<>
#{ruleId}
</if>
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment