Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-module-system
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-module-system
Commits
431ef34a
提交
431ef34a
authored
10月 29, 2024
作者:
000516
提交者:
Coding
10月 29, 2024
浏览文件
操作
浏览文件
下载
差异文件
考勤规则 - 增改查
考勤规则 - 增改查
上级
392886fa
0d4eb407
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
793 行增加
和
0 行删除
+793
-0
MybatisPlusConfig.java
src/main/java/com/sfa/system/config/MybatisPlusConfig.java
+23
-0
MybatisPlusConfig.java
...n/java/com/sfa/system/config/mysql/MybatisPlusConfig.java
+23
-0
KqRuleCoreController.java
.../com/sfa/system/controller/core/KqRuleCoreController.java
+98
-0
MdmKqRuleDao.java
src/main/java/com/sfa/system/domain/dao/MdmKqRuleDao.java
+62
-0
IMdmKqRuleDao.java
...in/java/com/sfa/system/domain/dao/impl/IMdmKqRuleDao.java
+146
-0
MdmKqRule.java
src/main/java/com/sfa/system/domain/entity/MdmKqRule.java
+56
-0
MdmKqRuleMapper.java
...in/java/com/sfa/system/domain/mapper/MdmKqRuleMapper.java
+67
-0
MdmKqRuleVo.java
src/main/java/com/sfa/system/pojo/request/MdmKqRuleVo.java
+71
-0
MdmKqRuleDto.java
src/main/java/com/sfa/system/pojo/response/MdmKqRuleDto.java
+61
-0
MdmKqRuleService.java
...in/java/com/sfa/system/service/core/MdmKqRuleService.java
+22
-0
IMdmKqRuleService.java
...a/com/sfa/system/service/core/impl/IMdmKqRuleService.java
+43
-0
MdmKqRuleMapper.xml
src/main/resources/mapper/system/MdmKqRuleMapper.xml
+121
-0
没有找到文件。
src/main/java/com/sfa/system/config/MybatisPlusConfig.java
0 → 100644
浏览文件 @
431ef34a
//package com.sfa.system.config;
//
//import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
//import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @author : liqiulin
// * @date : 2024-04-25 13
// * @describe :
// */
//@Configuration
//public class MybatisPlusConfig {
// @Bean
// public MybatisPlusInterceptor mybatisPlusInterceptor(){
// MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
// return interceptor;
// }
//
//}
\ No newline at end of file
src/main/java/com/sfa/system/config/mysql/MybatisPlusConfig.java
0 → 100644
浏览文件 @
431ef34a
package
com
.
sfa
.
system
.
config
.
mysql
;
import
com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
/**
* @author : liqiulin
* @date : 2024-04-25 13
* @describe :
*/
@Configuration
public
class
MybatisPlusConfig
{
@Bean
public
MybatisPlusInterceptor
mybatisPlusInterceptor
(){
MybatisPlusInterceptor
interceptor
=
new
MybatisPlusInterceptor
();
interceptor
.
addInnerInterceptor
(
new
PaginationInnerInterceptor
());
return
interceptor
;
}
}
\ No newline at end of file
src/main/java/com/sfa/system/controller/core/KqRuleCoreController.java
0 → 100644
浏览文件 @
431ef34a
package
com
.
sfa
.
system
.
controller
.
core
;
import
java.util.List
;
import
com.sfa.system.pojo.request.MdmKqRuleVo
;
import
com.sfa.system.pojo.response.MdmKqRuleDto
;
import
com.sfa.system.service.core.MdmKqRuleService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.sfa.common.log.annotation.Log
;
import
com.sfa.common.log.enums.BusinessType
;
import
com.sfa.common.security.annotation.RequiresPermissions
;
import
com.sfa.common.core.web.controller.BaseController
;
/**
* 考勤规则Controller
*
* @author : liqiulin
* @date : 2024-10-29 14
* @describe :
*/
@RestController
@RequestMapping
(
"/kq_rule"
)
public
class
KqRuleCoreController
extends
BaseController
{
@Autowired
private
MdmKqRuleService
mdmKqRuleService
;
/**
* 查询考勤规则列表
*/
@RequiresPermissions
(
"gen:rule:list"
)
@GetMapping
(
"/list"
)
public
List
<
MdmKqRuleDto
>
list
(
MdmKqRuleVo
mdmKqRuleVo
)
{
return
mdmKqRuleService
.
selectMdmKqRuleList
(
mdmKqRuleVo
);
}
// /**
// * 导出考勤规则列表
// */
// @RequiresPermissions("gen:rule:export")
// @Log(title = "考勤规则", businessType = BusinessType.EXPORT)
// @PostMapping("/export")
// public void export(HttpServletResponse response, MdmKqRuleVo mdmKqRuleVo)
// {
// List<MdmKqRuleVo> list = mdmKqRuleService.selectMdmKqRuleList(mdmKqRule);
// ExcelUtil<MdmKqRule> util = new ExcelUtil<MdmKqRule>(MdmKqRule.class);
// util.exportExcel(response, list, "考勤规则数据");
// }
/**
* 获取考勤规则详细信息
*/
@RequiresPermissions
(
"gen:rule:query"
)
@GetMapping
(
value
=
"/{ruleId}"
)
public
MdmKqRuleDto
getInfo
(
@PathVariable
(
"ruleId"
)
Long
ruleId
)
{
return
mdmKqRuleService
.
selectMdmKqRuleByRuleId
(
ruleId
);
}
/**
* 新增考勤规则
*/
@RequiresPermissions
(
"gen:rule:add"
)
@Log
(
title
=
"考勤规则"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
(
"/add"
)
public
void
add
(
@RequestBody
@Validated
MdmKqRuleVo
mdmKqRuleVo
)
{
mdmKqRuleService
.
insertMdmKqRule
(
mdmKqRuleVo
);
}
/**
* 修改考勤规则
*/
@RequiresPermissions
(
"gen:rule:edit"
)
@Log
(
title
=
"考勤规则"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
(
"/put"
)
public
void
edit
(
@RequestBody
@Validated
MdmKqRuleVo
mdmKqRuleVo
)
{
mdmKqRuleService
.
updateMdmKqRule
(
mdmKqRuleVo
);
}
// /**
// * 删除考勤规则
// */
// @RequiresPermissions("gen:rule:remove")
// @Log(title = "考勤规则", businessType = BusinessType.DELETE)
// @DeleteMapping("/{ruleIds}")
// public AjaxResult remove(@PathVariable Long[] ruleIds)
// {
// return toAjax(mdmKqRuleService.deleteMdmKqRuleByRuleIds(ruleIds));
// }
}
\ No newline at end of file
src/main/java/com/sfa/system/domain/dao/MdmKqRuleDao.java
0 → 100644
浏览文件 @
431ef34a
package
com
.
sfa
.
system
.
domain
.
dao
;
import
com.sfa.system.pojo.request.MdmKqRuleVo
;
import
com.sfa.system.pojo.response.MdmKqRuleDto
;
import
java.util.List
;
/**
* @author : liqiulin
* @date : 2024-10-29 14
* @describe :
*/
public
interface
MdmKqRuleDao
{
/**
* 查询考勤规则
*
* @param ruleId 考勤规则主键
* @return 考勤规则
*/
public
MdmKqRuleDto
selectMdmKqRuleByRuleId
(
Long
ruleId
);
/**
* 查询考勤规则列表
*
* @param mdmKqRuleVo 考勤规则
* @return 考勤规则集合
*/
public
List
<
MdmKqRuleDto
>
selectMdmKqRuleList
(
MdmKqRuleVo
mdmKqRuleVo
);
/**
* 新增考勤规则
*
* @param mdmKqRuleVo 考勤规则
* @return 结果
*/
public
int
insertMdmKqRule
(
MdmKqRuleVo
mdmKqRuleVo
);
/**
* 修改考勤规则
*
* @param mdmKqRuleVo 考勤规则
* @return 结果
*/
public
int
updateMdmKqRule
(
MdmKqRuleVo
mdmKqRuleVo
);
/**
* 批量删除考勤规则
*
* @param ruleIds 需要删除的考勤规则主键集合
* @return 结果
*/
public
int
deleteMdmKqRuleByRuleIds
(
Long
[]
ruleIds
);
/**
* 删除考勤规则信息
*
* @param ruleId 考勤规则主键
* @return 结果
*/
public
int
deleteMdmKqRuleByRuleId
(
Long
ruleId
);
}
src/main/java/com/sfa/system/domain/dao/impl/IMdmKqRuleDao.java
0 → 100644
浏览文件 @
431ef34a
package
com
.
sfa
.
system
.
domain
.
dao
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.sfa.common.core.enums.ECode
;
import
com.sfa.common.core.exception.WXLSQLException
;
import
com.sfa.system.domain.dao.MdmKqRuleDao
;
import
com.sfa.system.domain.entity.MdmKqRule
;
import
com.sfa.system.domain.mapper.MdmKqRuleMapper
;
import
com.sfa.system.pojo.request.MdmKqRuleVo
;
import
com.sfa.system.pojo.response.MdmKqRuleDto
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
/**
* @author : liqiulin
* @date : 2024-10-29 14
* @describe :
*/
@Service
public
class
IMdmKqRuleDao
implements
MdmKqRuleDao
{
@Autowired
private
MdmKqRuleMapper
mdmKqRuleMapper
;
/**
* 查询考勤规则
*
* @param ruleId 考勤规则主键
* @return 考勤规则
*/
@Override
public
MdmKqRuleDto
selectMdmKqRuleByRuleId
(
Long
ruleId
)
{
MdmKqRule
mdmKqRule
=
mdmKqRuleMapper
.
selectById
(
ruleId
);
return
transitionDto
(
mdmKqRule
);
}
/**
* 查询考勤规则列表
*
* @param mdmKqRuleVo 考勤规则
* @return 考勤规则
*/
@Override
public
List
<
MdmKqRuleDto
>
selectMdmKqRuleList
(
MdmKqRuleVo
mdmKqRuleVo
)
{
List
<
MdmKqRule
>
mdmKqRules
=
mdmKqRuleMapper
.
selectList
(
new
QueryWrapper
<>());
return
transitionDtos
(
mdmKqRules
);
}
/**
* 新增考勤规则
*
* @param mdmKqRuleVo 考勤规则
* @return 结果
*/
@Override
public
int
insertMdmKqRule
(
MdmKqRuleVo
mdmKqRuleVo
)
{
try
{
MdmKqRule
mdo
=
new
MdmKqRule
();
BeanUtils
.
copyProperties
(
mdmKqRuleVo
,
mdo
);
return
mdmKqRuleMapper
.
insert
(
mdo
);
}
catch
(
Exception
e
)
{
String
eMsg
=
e
.
getCause
().
getMessage
();
if
(
eMsg
.
contains
(
"for key 'mdm_kq_rule_unique'"
))
{
throw
new
WXLSQLException
(
ECode
.
API_ERROR
,
"考勤编码"
);
}
return
-
1
;
}
}
/**
* 修改考勤规则
*
* @param mdmKqRuleVo 考勤规则
* @return 结果
*/
@Override
public
int
updateMdmKqRule
(
MdmKqRuleVo
mdmKqRuleVo
)
{
try
{
MdmKqRule
mdo
=
new
MdmKqRule
();
BeanUtils
.
copyProperties
(
mdmKqRuleVo
,
mdo
);
return
mdmKqRuleMapper
.
updateById
(
mdo
);
}
catch
(
Exception
e
)
{
String
eMsg
=
e
.
getCause
().
getMessage
();
if
(
eMsg
.
contains
(
"for key 'mdm_kq_rule_unique'"
))
{
throw
new
WXLSQLException
(
ECode
.
API_ERROR
,
"考勤编码"
);
}
return
-
1
;
}
}
/**
* 批量删除考勤规则
*
* @param ruleIds 需要删除的考勤规则主键
* @return 结果
*/
@Override
public
int
deleteMdmKqRuleByRuleIds
(
Long
[]
ruleIds
)
{
return
mdmKqRuleMapper
.
deleteMdmKqRuleByRuleIds
(
ruleIds
);
}
/**
* 删除考勤规则信息
*
* @param ruleId 考勤规则主键
* @return 结果
*/
@Override
public
int
deleteMdmKqRuleByRuleId
(
Long
ruleId
)
{
return
mdmKqRuleMapper
.
deleteMdmKqRuleByRuleId
(
ruleId
);
}
/**
* DO to DTO (单个对象)
*
* @param mdos DO对象List
* @return DTO对象
*/
private
List
<
MdmKqRuleDto
>
transitionDtos
(
List
<
MdmKqRule
>
mdos
)
{
if
(
CollectionUtils
.
isEmpty
(
mdos
))
{
return
new
ArrayList
<>();
}
List
<
MdmKqRuleDto
>
dtos
=
new
ArrayList
<>(
mdos
.
size
()
*
2
);
for
(
MdmKqRule
mdo
:
mdos
)
{
dtos
.
add
(
transitionDto
(
mdo
));
}
return
dtos
;
}
private
MdmKqRuleDto
transitionDto
(
MdmKqRule
mdo
)
{
MdmKqRuleDto
dto
=
null
;
if
(
Objects
.
isNull
(
mdo
))
{
return
dto
;
}
dto
=
new
MdmKqRuleDto
();
BeanUtils
.
copyProperties
(
mdo
,
dto
);
return
dto
;
}
}
src/main/java/com/sfa/system/domain/entity/MdmKqRule.java
0 → 100644
浏览文件 @
431ef34a
package
com
.
sfa
.
system
.
domain
.
entity
;
import
com.baomidou.mybatisplus.annotation.*
;
import
com.sfa.common.core.web.domain.BaseDo
;
import
lombok.Data
;
import
java.time.LocalTime
;
/**
* 考勤规则对象 mdm_kq_rule
*
* @author admin
* @date 2024-10-29
*/
@TableName
(
value
=
"mdm_kq_rule"
)
@Data
public
class
MdmKqRule
extends
BaseDo
{
private
static
final
long
serialVersionUID
=
1L
;
/** 规则ID */
@TableId
(
type
=
IdType
.
AUTO
)
private
Long
ruleId
;
/** 规则编号 */
private
String
ruleNum
;
/** 规则名称 */
private
String
ruleName
;
/** 上班打卡允许开始时间 */
private
LocalTime
firBegintime
;
/** 上班打卡允许结束时间 */
private
LocalTime
firEndtime
;
/** 午班打卡允许开始时间 */
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
LocalTime
secBegintime
;
/** 午班打卡允许结束时间 */
private
LocalTime
secEndtime
;
/** 下班打卡允许开始时间 */
private
LocalTime
thiBegintime
;
/** 下班打卡允许结束时间 */
private
LocalTime
thiEndtime
;
/** 记录版本 */
private
Long
flag
;
/** 删除标识 */
private
String
delFlag
;
}
src/main/java/com/sfa/system/domain/mapper/MdmKqRuleMapper.java
0 → 100644
浏览文件 @
431ef34a
package
com
.
sfa
.
system
.
domain
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.sfa.system.domain.entity.MdmKqRule
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* @author : liqiulin
* @date : 2024-10-29 14
* @describe :
*/
@Repository
@Mapper
public
interface
MdmKqRuleMapper
extends
BaseMapper
<
MdmKqRule
>
{
/**
* 查询考勤规则
*
* @param ruleId 考勤规则主键
* @return 考勤规则
*/
public
MdmKqRule
selectMdmKqRuleByRuleId
(
Long
ruleId
);
/**
* 查询考勤规则列表
*
* @param mdmKqRule 考勤规则
* @return 考勤规则集合
*/
public
List
<
MdmKqRule
>
selectMdmKqRuleList
(
MdmKqRule
mdmKqRule
);
/**
* 新增考勤规则
*
* @param mdmKqRule 考勤规则
* @return 结果
*/
public
int
insertMdmKqRule
(
MdmKqRule
mdmKqRule
);
/**
* 修改考勤规则
*
* @param mdmKqRule 考勤规则
* @return 结果
*/
public
int
updateMdmKqRule
(
MdmKqRule
mdmKqRule
);
/**
* 删除考勤规则
*
* @param ruleId 考勤规则主键
* @return 结果
*/
public
int
deleteMdmKqRuleByRuleId
(
Long
ruleId
);
/**
* 批量删除考勤规则
*
* @param ruleIds 需要删除的数据主键集合
* @return 结果
*/
public
int
deleteMdmKqRuleByRuleIds
(
Long
[]
ruleIds
);
}
src/main/java/com/sfa/system/pojo/request/MdmKqRuleVo.java
0 → 100644
浏览文件 @
431ef34a
package
com
.
sfa
.
system
.
pojo
.
request
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.sfa.common.core.annotation.Excel
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
java.time.LocalTime
;
/**
* @author : liqiulin
* @date : 2024-10-29 14
* @describe :
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
MdmKqRuleVo
{
/** 规则ID */
private
Long
ruleId
;
/** 规则编号 */
@Excel
(
name
=
"规则编号"
)
@Size
(
min
=
6
,
max
=
6
,
message
=
"规则编号为6位字符"
)
private
String
ruleNum
;
/** 规则名称 */
@Excel
(
name
=
"规则名称"
)
@NotNull
(
message
=
"规则名称不可为空"
)
private
String
ruleName
;
/** 上班打卡允许开始时间 */
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"HH:mm:ss"
)
@NotNull
(
message
=
"上班时间范围不可为空"
)
private
LocalTime
firBegintime
;
/** 上班打卡允许结束时间 */
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"HH:mm:ss"
)
@NotNull
(
message
=
"上班时间范围不可为空"
)
private
LocalTime
firEndtime
;
/** 午班打卡允许开始时间 */
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"HH:mm:ss"
)
private
LocalTime
secBegintime
;
/** 午班打卡允许结束时间 */
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"HH:mm:ss"
)
private
LocalTime
secEndtime
;
/** 下班打卡允许开始时间 */
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"HH:mm:ss"
)
@NotNull
(
message
=
"下班时间范围不可为空"
)
private
LocalTime
thiBegintime
;
/** 下班打卡允许结束时间 */
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"HH:mm:ss"
)
@NotNull
(
message
=
"下班时间范围不可为空"
)
private
LocalTime
thiEndtime
;
/** 创建人 */
private
String
createBy
;
private
String
updateBy
;
/** 备注 */
private
String
remark
;
}
src/main/java/com/sfa/system/pojo/response/MdmKqRuleDto.java
0 → 100644
浏览文件 @
431ef34a
package
com
.
sfa
.
system
.
pojo
.
response
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.time.LocalTime
;
import
java.util.Date
;
/**
* @author : liqiulin
* @date : 2024-10-29 14
* @describe :
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
MdmKqRuleDto
{
/** 规则ID */
private
Long
ruleId
;
/** 规则编号 */
private
String
ruleNum
;
/** 规则名称 */
private
String
ruleName
;
/** 上班打卡允许开始时间 */
private
LocalTime
firBegintime
;
/** 上班打卡允许结束时间 */
private
LocalTime
firEndtime
;
/** 午班打卡允许开始时间 */
private
LocalTime
secBegintime
;
/** 午班打卡允许结束时间 */
private
LocalTime
secEndtime
;
/** 下班打卡允许开始时间 */
private
LocalTime
thiBegintime
;
/** 下班打卡允许结束时间 */
private
LocalTime
thiEndtime
;
/** 创建者 */
private
String
createBy
;
/** 创建时间 */
private
Date
createTime
;
/** 更新者 */
private
String
updateBy
;
/** 更新时间 */
private
Date
updateTime
;
/** 备注 */
private
String
remark
;
}
src/main/java/com/sfa/system/service/core/MdmKqRuleService.java
0 → 100644
浏览文件 @
431ef34a
package
com
.
sfa
.
system
.
service
.
core
;
import
com.sfa.system.pojo.request.MdmKqRuleVo
;
import
com.sfa.system.pojo.response.MdmKqRuleDto
;
import
java.util.List
;
/**
* @author : liqiulin
* @date : 2024-10-29 14
* @describe :
*/
public
interface
MdmKqRuleService
{
List
<
MdmKqRuleDto
>
selectMdmKqRuleList
(
MdmKqRuleVo
mdmKqRuleVo
);
MdmKqRuleDto
selectMdmKqRuleByRuleId
(
Long
ruleId
);
void
insertMdmKqRule
(
MdmKqRuleVo
mdmKqRuleVo
);
void
updateMdmKqRule
(
MdmKqRuleVo
mdmKqRuleVo
);
}
src/main/java/com/sfa/system/service/core/impl/IMdmKqRuleService.java
0 → 100644
浏览文件 @
431ef34a
package
com
.
sfa
.
system
.
service
.
core
.
impl
;
import
com.sfa.system.domain.dao.MdmKqRuleDao
;
import
com.sfa.system.domain.entity.MdmKqRule
;
import
com.sfa.system.pojo.request.MdmKqRuleVo
;
import
com.sfa.system.pojo.response.MdmKqRuleDto
;
import
com.sfa.system.service.core.MdmKqRuleService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @author : liqiulin
* @date : 2024-10-29 14
* @describe :
*/
@Service
public
class
IMdmKqRuleService
implements
MdmKqRuleService
{
@Autowired
MdmKqRuleDao
mdmKqRuleDao
;
@Override
public
List
<
MdmKqRuleDto
>
selectMdmKqRuleList
(
MdmKqRuleVo
mdmKqRuleVo
)
{
return
mdmKqRuleDao
.
selectMdmKqRuleList
(
mdmKqRuleVo
);
}
@Override
public
MdmKqRuleDto
selectMdmKqRuleByRuleId
(
Long
ruleId
)
{
return
mdmKqRuleDao
.
selectMdmKqRuleByRuleId
(
ruleId
);
}
@Override
public
void
insertMdmKqRule
(
MdmKqRuleVo
mdmKqRuleVo
)
{
mdmKqRuleDao
.
insertMdmKqRule
(
mdmKqRuleVo
);
}
@Override
public
void
updateMdmKqRule
(
MdmKqRuleVo
mdmKqRuleVo
)
{
mdmKqRuleDao
.
updateMdmKqRule
(
mdmKqRuleVo
);
}
}
src/main/resources/mapper/system/MdmKqRuleMapper.xml
0 → 100644
浏览文件 @
431ef34a
<?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.sfa.system.domain.mapper.MdmKqRuleMapper"
>
<resultMap
type=
"com.sfa.system.domain.entity.MdmKqRule"
id=
"MdmKqRuleResult"
>
<result
property=
"ruleId"
column=
"rule_id"
/>
<result
property=
"ruleNum"
column=
"rule_num"
/>
<result
property=
"ruleName"
column=
"rule_name"
/>
<result
property=
"firBegintime"
column=
"fir_begintime"
/>
<result
property=
"firEndtime"
column=
"fir_endtime"
/>
<result
property=
"secBegintime"
column=
"sec_begintime"
/>
<result
property=
"secEndtime"
column=
"sec_endtime"
/>
<result
property=
"thiBegintime"
column=
"thi_begintime"
/>
<result
property=
"thiEndtime"
column=
"thi_endtime"
/>
<result
property=
"flag"
column=
"flag"
/>
<result
property=
"delFlag"
column=
"del_flag"
/>
<result
property=
"createBy"
column=
"create_by"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateBy"
column=
"update_by"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"remark"
column=
"remark"
/>
</resultMap>
<sql
id=
"selectMdmKqRuleVo"
>
select rule_id, rule_num, rule_name, fir_begintime, fir_endtime, sec_begintime, sec_endtime, thi_begintime, thi_endtime, flag, del_flag, create_by, create_time, update_by, update_time, remark from mdm_kq_rule
</sql>
<select
id=
"selectMdmKqRuleList"
parameterType=
"com.sfa.system.domain.entity.MdmKqRule"
resultMap=
"MdmKqRuleResult"
>
<include
refid=
"selectMdmKqRuleVo"
/>
<where>
<if
test=
"ruleNum != null and ruleNum != ''"
>
and rule_num = #{ruleNum}
</if>
<if
test=
"ruleName != null and ruleName != ''"
>
and rule_name like concat('%', #{ruleName}, '%')
</if>
<if
test=
"firBegintime != null "
>
and fir_begintime = #{firBegintime}
</if>
<if
test=
"firEndtime != null "
>
and fir_endtime = #{firEndtime}
</if>
<if
test=
"secBegintime != null "
>
and sec_begintime = #{secBegintime}
</if>
<if
test=
"secEndtime != null "
>
and sec_endtime = #{secEndtime}
</if>
<if
test=
"thiBegintime != null "
>
and thi_begintime = #{thiBegintime}
</if>
<if
test=
"thiEndtime != null "
>
and thi_endtime = #{thiEndtime}
</if>
<if
test=
"flag != null "
>
and flag = #{flag}
</if>
</where>
</select>
<select
id=
"selectMdmKqRuleByRuleId"
parameterType=
"Long"
resultMap=
"MdmKqRuleResult"
>
<include
refid=
"selectMdmKqRuleVo"
/>
where rule_id = #{ruleId}
</select>
<insert
id=
"insertMdmKqRule"
parameterType=
"com.sfa.system.domain.entity.MdmKqRule"
useGeneratedKeys=
"true"
keyProperty=
"ruleId"
>
insert into mdm_kq_rule
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"ruleNum != null"
>
rule_num,
</if>
<if
test=
"ruleName != null"
>
rule_name,
</if>
<if
test=
"firBegintime != null"
>
fir_begintime,
</if>
<if
test=
"firEndtime != null"
>
fir_endtime,
</if>
<if
test=
"secBegintime != null"
>
sec_begintime,
</if>
<if
test=
"secEndtime != null"
>
sec_endtime,
</if>
<if
test=
"thiBegintime != null"
>
thi_begintime,
</if>
<if
test=
"thiEndtime != null"
>
thi_endtime,
</if>
<if
test=
"flag != null"
>
flag,
</if>
<if
test=
"delFlag != null"
>
del_flag,
</if>
<if
test=
"createBy != null"
>
create_by,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateBy != null"
>
update_by,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"remark != null"
>
remark,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"ruleNum != null"
>
#{ruleNum},
</if>
<if
test=
"ruleName != null"
>
#{ruleName},
</if>
<if
test=
"firBegintime != null"
>
#{firBegintime},
</if>
<if
test=
"firEndtime != null"
>
#{firEndtime},
</if>
<if
test=
"secBegintime != null"
>
#{secBegintime},
</if>
<if
test=
"secEndtime != null"
>
#{secEndtime},
</if>
<if
test=
"thiBegintime != null"
>
#{thiBegintime},
</if>
<if
test=
"thiEndtime != null"
>
#{thiEndtime},
</if>
<if
test=
"flag != null"
>
#{flag},
</if>
<if
test=
"delFlag != null"
>
#{delFlag},
</if>
<if
test=
"createBy != null"
>
#{createBy},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"updateBy != null"
>
#{updateBy},
</if>
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
<if
test=
"remark != null"
>
#{remark},
</if>
</trim>
</insert>
<update
id=
"updateMdmKqRule"
parameterType=
"com.sfa.system.domain.entity.MdmKqRule"
>
update mdm_kq_rule
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"ruleNum != null"
>
rule_num = #{ruleNum},
</if>
<if
test=
"ruleName != null"
>
rule_name = #{ruleName},
</if>
<if
test=
"firBegintime != null"
>
fir_begintime = #{firBegintime},
</if>
<if
test=
"firEndtime != null"
>
fir_endtime = #{firEndtime},
</if>
<if
test=
"secBegintime != null"
>
sec_begintime = #{secBegintime},
</if>
<if
test=
"secEndtime != null"
>
sec_endtime = #{secEndtime},
</if>
<if
test=
"thiBegintime != null"
>
thi_begintime = #{thiBegintime},
</if>
<if
test=
"thiEndtime != null"
>
thi_endtime = #{thiEndtime},
</if>
<if
test=
"flag != null"
>
flag = #{flag},
</if>
<if
test=
"delFlag != null"
>
del_flag = #{delFlag},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
</trim>
where rule_id = #{ruleId}
</update>
<delete
id=
"deleteMdmKqRuleByRuleId"
parameterType=
"Long"
>
delete from mdm_kq_rule where rule_id = #{ruleId}
</delete>
<delete
id=
"deleteMdmKqRuleByRuleIds"
parameterType=
"String"
>
delete from mdm_kq_rule where rule_id in
<foreach
item=
"ruleId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{ruleId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论