Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
qianhe-ydsj
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangyun
qianhe-ydsj
Commits
d2030fee
Commit
d2030fee
authored
Mar 20, 2026
by
MMF
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MMF 2026-03-20 最强操作新增人员信息管理
parent
02a6856d
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
726 additions
and
2 deletions
+726
-2
qianhe-common/src/main/java/com/qianhe/common/constant/MtConstant.java
+42
-2
qianhe-ydsj/src/main/java/com/qianhe/zqcz/ryxx/controller/ZqczRyxxController.java
+116
-0
qianhe-ydsj/src/main/java/com/qianhe/zqcz/ryxx/domain/ZqczRyxx.java
+83
-0
qianhe-ydsj/src/main/java/com/qianhe/zqcz/ryxx/domain/ZqczRyxxQuery.java
+41
-0
qianhe-ydsj/src/main/java/com/qianhe/zqcz/ryxx/domain/ZqczRyxxVo.java
+46
-0
qianhe-ydsj/src/main/java/com/qianhe/zqcz/ryxx/mapper/ZqczRyxxMapper.java
+47
-0
qianhe-ydsj/src/main/java/com/qianhe/zqcz/ryxx/service/ZqczRyxxService.java
+45
-0
qianhe-ydsj/src/main/java/com/qianhe/zqcz/ryxx/service/impl/ZqczRyxxServiceImpl.java
+158
-0
qianhe-ydsj/src/main/resources/mapper/zqcz/ryxx/ZqczRyxxMapper.xml
+148
-0
No files found.
qianhe-common/src/main/java/com/qianhe/common/constant/MtConstant.java
View file @
d2030fee
...
...
@@ -28,8 +28,8 @@ public class MtConstant {
* 基层单位类型字典
*/
public
static
final
Map
<
String
,
String
>
ZQCZ_JCDWLX_MAP
=
new
HashMap
<
String
,
String
>()
{{
put
(
ZQCZ_JCDWLX_CY
,
"1"
);
put
(
ZQCZ_JCDWLX_JS
,
"2"
);
put
(
ZQCZ_JCDWLX_CY
,
ZQCZ_JCDWLX_CY_CODE
);
put
(
ZQCZ_JCDWLX_JS
,
ZQCZ_JCDWLX_JS_CODE
);
}};
/**
...
...
@@ -77,4 +77,44 @@ public class MtConstant {
* 基层抽检状态:9 - 抽检完成
*/
public
static
final
String
ZQCZ_JCCJZT_CJWC
=
"9"
;
/**
* 最强操作-人员分类 1 - 领导班子
*/
public
static
final
String
ZQCZ_RYLX_LDBZ_CODE
=
"1"
;
/**
* 最强操作-人员分类 2 - 三室一中心
*/
public
static
final
String
ZQCZ_RYLX_SSYZX_CODE
=
"2"
;
/**
* 最强操作-人员分类 3 - 班站
*/
public
static
final
String
ZQCZ_RYLX_BZ_CODE
=
"3"
;
/**
* 最强操作-人员分类 1 - 领导班子
*/
public
static
final
String
ZQCZ_RYLX_LDBZ
=
"领导班子"
;
/**
* 最强操作-人员分类 2 - 三室一中心
*/
public
static
final
String
ZQCZ_RYLX_SSYZX
=
"三室一中心"
;
/**
* 最强操作-人员分类 3 - 班站
*/
public
static
final
String
ZQCZ_RYLX_BZ
=
"班站"
;
/**
* 最强操作-人员分类 1 - 领导班子 2 - 三室一中心 3 - 班站
*/
public
static
final
Map
<
String
,
String
>
ZQCZ_RYLX_MAP
=
new
HashMap
<
String
,
String
>()
{{
put
(
ZQCZ_RYLX_LDBZ
,
ZQCZ_RYLX_LDBZ_CODE
);
put
(
ZQCZ_RYLX_SSYZX
,
ZQCZ_RYLX_SSYZX_CODE
);
put
(
ZQCZ_RYLX_BZ
,
ZQCZ_RYLX_BZ_CODE
);
}};
}
qianhe-ydsj/src/main/java/com/qianhe/zqcz/ryxx/controller/ZqczRyxxController.java
0 → 100644
View file @
d2030fee
package
com
.
qianhe
.
zqcz
.
ryxx
.
controller
;
import
com.qianhe.common.core.controller.BaseController
;
import
com.qianhe.common.core.domain.AjaxResult
;
import
com.qianhe.common.core.page.TableDataInfo
;
import
com.qianhe.common.exception.BusinessException
;
import
com.qianhe.common.utils.poi.ExcelUtil
;
import
com.qianhe.zqcz.ryxx.domain.ZqczRyxx
;
import
com.qianhe.zqcz.ryxx.domain.ZqczRyxxQuery
;
import
com.qianhe.zqcz.ryxx.domain.ZqczRyxxVo
;
import
com.qianhe.zqcz.ryxx.service.ZqczRyxxService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
@Slf4j
@RestController
@RequestMapping
(
"/zqcz/ryxx"
)
public
class
ZqczRyxxController
extends
BaseController
{
@Autowired
private
ZqczRyxxService
zqczRyxxService
;
/**
* 分页查询
*/
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
ZqczRyxxQuery
zqczRyxxQuery
)
{
startPage
();
return
getDataTable
(
zqczRyxxService
.
list
(
zqczRyxxQuery
));
}
/**
* 查询详情
*/
@GetMapping
(
"/{id}"
)
public
AjaxResult
info
(
@PathVariable
Long
id
)
{
try
{
return
success
(
zqczRyxxService
.
info
(
id
));
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
return
error
(
e
.
getMessage
());
}
}
/**
* 新增
*/
@PostMapping
public
AjaxResult
add
(
@RequestBody
ZqczRyxx
zqczRyxx
)
{
try
{
return
toAjax
(
zqczRyxxService
.
add
(
zqczRyxx
,
getUsername
()));
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
return
error
(
e
.
getMessage
());
}
}
/**
* 修改
*/
@PutMapping
public
AjaxResult
edit
(
@RequestBody
ZqczRyxx
zqczRyxx
)
{
try
{
return
toAjax
(
zqczRyxxService
.
edit
(
zqczRyxx
,
getUsername
()));
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
return
error
(
e
.
getMessage
());
}
}
/**
* 删除
*/
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
delete
(
@PathVariable
Long
[]
ids
)
{
try
{
return
toAjax
(
zqczRyxxService
.
delete
(
ids
));
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
return
error
(
e
.
getMessage
());
}
}
/**
* 导出
*/
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
@RequestBody
ZqczRyxxQuery
zqczRyxxQuery
)
{
List
<
ZqczRyxxVo
>
dataList
=
zqczRyxxService
.
list
(
zqczRyxxQuery
);
ExcelUtil
<
ZqczRyxxVo
>
util
=
new
ExcelUtil
<>(
ZqczRyxxVo
.
class
);
util
.
exportExcel
(
response
,
dataList
,
"sheetName"
);
}
/**
* 导入
*/
@PostMapping
(
"/import"
)
public
AjaxResult
importExcel
(
@RequestParam
(
"jcrwid"
)
Long
jcrwid
,
@RequestParam
(
"file"
)
MultipartFile
file
)
{
try
{
if
(
jcrwid
==
null
)
return
warn
(
"基层任务ID不能为空"
);
if
(
file
.
isEmpty
())
return
warn
(
"文件不能为空"
);
int
count
=
zqczRyxxService
.
importExcel
(
jcrwid
,
file
);
return
success
(
"导入成功,共导入 "
+
count
+
" 条数据"
);
}
catch
(
BusinessException
e
)
{
log
.
warn
(
"最强操作-导入人员失败:"
+
e
.
getMessage
());
return
warn
(
e
.
getMessage
());
}
catch
(
Exception
e
)
{
log
.
error
(
"最强操作-导入人员失败:"
+
e
.
getMessage
());
return
error
(
e
.
getMessage
());
}
}
}
qianhe-ydsj/src/main/java/com/qianhe/zqcz/ryxx/domain/ZqczRyxx.java
0 → 100644
View file @
d2030fee
package
com
.
qianhe
.
zqcz
.
ryxx
.
domain
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.qianhe.common.core.domain.BaseEntity
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
* 最强操作 人员信息 zqcz_ryxx
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
ZqczRyxx
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 人员ID
*/
private
Long
ryid
;
/**
* 基层任务ID:zqcz_jcrw.jcrwid
*/
private
Long
jcrwid
;
/**
* 人员名称
*/
private
String
rymc
;
/**
* 单位名称(存储上传的单位名称,领导班子、三室一中心、班站)
*/
private
String
dwmc
;
/**
* 人员分类:1 - 领导班子,2 - 三室一中心,3 - 班站
*/
private
String
ryfl
;
/**
* 创建者
*/
private
String
create_by
;
/**
* 创建时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
create_time
;
/**
* 修改人
*/
private
String
update_by
;
/**
* 修改时间(更新时自动刷新)
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
update_time
;
/**
* 备注
*/
private
String
remark
;
/**
* 预留1
*/
private
String
yl1
;
/**
* 预留2
*/
private
String
yl2
;
/**
* 预留3
*/
private
String
yl3
;
/**
* 预留4
*/
private
String
yl4
;
/**
* 预留5
*/
private
String
yl5
;
}
qianhe-ydsj/src/main/java/com/qianhe/zqcz/ryxx/domain/ZqczRyxxQuery.java
0 → 100644
View file @
d2030fee
package
com
.
qianhe
.
zqcz
.
ryxx
.
domain
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.qianhe.common.core.domain.BaseEntity
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
* 最强操作 人员信息 zqcz_ryxx
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
ZqczRyxxQuery
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 人员ID
*/
private
Long
ryid
;
/**
* 基层任务ID:zqcz_jcrw.jcrwid
*/
private
Long
jcrwid
;
/**
* 人员名称
*/
private
String
rymc
;
/**
* 单位名称(存储上传的单位名称,领导班子、三室一中心、班站)
*/
private
String
dwmc
;
/**
* 人员分类:1 - 领导班子,2 - 三室一中心,3 - 班站
*/
private
String
ryfl
;
}
qianhe-ydsj/src/main/java/com/qianhe/zqcz/ryxx/domain/ZqczRyxxVo.java
0 → 100644
View file @
d2030fee
package
com
.
qianhe
.
zqcz
.
ryxx
.
domain
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.qianhe.common.annotation.Excel
;
import
com.qianhe.common.core.domain.BaseEntity
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 最强操作 人员信息 zqcz_ryxx
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
ZqczRyxxVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 人员ID
*/
private
Long
ryid
;
/**
* 基层任务ID:zqcz_jcrw.jcrwid
*/
private
Long
jcrwid
;
/**
* 人员名称
*/
@Excel
(
name
=
"人员名称"
)
private
String
rymc
;
/**
* 单位名称(存储上传的单位名称,领导班子、三室一中心、班站)
*/
@Excel
(
name
=
"单位"
)
private
String
dwmc
;
/**
* 人员分类:1 - 领导班子,2 - 三室一中心,3 - 班站
*/
@Excel
(
name
=
"分类"
,
dictType
=
"zqcz_ryfl"
,
type
=
Excel
.
Type
.
EXPORT
)
private
String
ryfl
;
}
qianhe-ydsj/src/main/java/com/qianhe/zqcz/ryxx/mapper/ZqczRyxxMapper.java
0 → 100644
View file @
d2030fee
package
com
.
qianhe
.
zqcz
.
ryxx
.
mapper
;
import
com.qianhe.zqcz.ryxx.domain.ZqczRyxx
;
import
com.qianhe.zqcz.ryxx.domain.ZqczRyxxQuery
;
import
com.qianhe.zqcz.ryxx.domain.ZqczRyxxVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
@Mapper
public
interface
ZqczRyxxMapper
{
/**
* 条件查询
*/
List
<
ZqczRyxxVo
>
list
(
ZqczRyxxQuery
zqczRyxxQuery
);
/**
* 查询详情
*/
ZqczRyxxVo
info
(
@Param
(
"ryid"
)
Long
ryid
);
/**
* 新增
*/
int
add
(
ZqczRyxx
zqczRyxx
);
/**
* 修改
*/
int
edit
(
ZqczRyxx
zqczRyxx
);
/**
* 删除
*/
int
delete
(
Long
[]
ids
);
/**
* 根据基础任务ID删除
*/
int
deleteByJcrwid
(
@Param
(
"jcrwid"
)
Long
jcrwid
);
/**
* 批量插入
*/
int
batchAdd
(
@Param
(
"ryxxList"
)
List
<
ZqczRyxx
>
ryxxList
);
}
qianhe-ydsj/src/main/java/com/qianhe/zqcz/ryxx/service/ZqczRyxxService.java
0 → 100644
View file @
d2030fee
package
com
.
qianhe
.
zqcz
.
ryxx
.
service
;
import
com.qianhe.zqcz.ryxx.domain.ZqczRyxx
;
import
com.qianhe.zqcz.ryxx.domain.ZqczRyxxQuery
;
import
com.qianhe.zqcz.ryxx.domain.ZqczRyxxVo
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.util.List
;
public
interface
ZqczRyxxService
{
/**
* 条件查询
*/
List
<
ZqczRyxxVo
>
list
(
ZqczRyxxQuery
zqczRyxxQuery
);
/**
* 查询详情
*/
ZqczRyxxVo
info
(
Long
ryid
);
/**
* 新增
*/
int
add
(
ZqczRyxx
zqczRyxx
,
String
username
)
;
/**
* 修改
*/
int
edit
(
ZqczRyxx
zqczRyxx
,
String
username
)
;
/**
* 删除
*/
int
delete
(
Long
[]
ids
);
/**
* 根据基础任务ID删除
*/
int
deleteByJcrwid
(
Long
jcrwid
);
/**
* 导入
*/
int
importExcel
(
Long
jcrwid
,
MultipartFile
file
);
}
qianhe-ydsj/src/main/java/com/qianhe/zqcz/ryxx/service/impl/ZqczRyxxServiceImpl.java
0 → 100644
View file @
d2030fee
package
com
.
qianhe
.
zqcz
.
ryxx
.
service
.
impl
;
import
com.qianhe.common.constant.MtConstant
;
import
com.qianhe.common.exception.BusinessException
;
import
com.qianhe.common.utils.SecurityUtils
;
import
com.qianhe.common.utils.StringUtils
;
import
com.qianhe.zqcz.pwxx.domain.ZqczPwxx
;
import
com.qianhe.zqcz.ryxx.domain.ZqczRyxx
;
import
com.qianhe.zqcz.ryxx.domain.ZqczRyxxQuery
;
import
com.qianhe.zqcz.ryxx.domain.ZqczRyxxVo
;
import
com.qianhe.zqcz.ryxx.mapper.ZqczRyxxMapper
;
import
com.qianhe.zqcz.ryxx.service.ZqczRyxxService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.poi.ss.usermodel.DataFormatter
;
import
org.apache.poi.xssf.usermodel.XSSFRow
;
import
org.apache.poi.xssf.usermodel.XSSFSheet
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
import
java.util.*
;
@Slf4j
@Service
public
class
ZqczRyxxServiceImpl
implements
ZqczRyxxService
{
@Autowired
private
ZqczRyxxMapper
zqczRyxxMapper
;
/**
* 条件查询
*/
@Override
public
List
<
ZqczRyxxVo
>
list
(
ZqczRyxxQuery
zqczRyxxQuery
)
{
List
<
ZqczRyxxVo
>
dataList
=
zqczRyxxMapper
.
list
(
zqczRyxxQuery
);
return
dataList
;
}
/**
* 查询详情
*/
@Override
public
ZqczRyxxVo
info
(
Long
id
)
{
ZqczRyxxVo
info
=
zqczRyxxMapper
.
info
(
id
);
return
info
;
}
/**
* 新增
*/
@Override
public
int
add
(
ZqczRyxx
zqczRyxx
,
String
username
)
{
zqczRyxx
.
setCreate_by
(
username
);
zqczRyxx
.
setUpdate_by
(
username
);
zqczRyxx
.
setCreate_time
(
new
Date
());
return
zqczRyxxMapper
.
add
(
zqczRyxx
);
}
/**
* 修改
*/
@Override
public
int
edit
(
ZqczRyxx
zqczRyxx
,
String
username
)
{
zqczRyxx
.
setUpdate_by
(
username
);
return
zqczRyxxMapper
.
edit
(
zqczRyxx
);
}
/**
* 删除
*/
@Override
public
int
delete
(
Long
[]
ids
)
{
return
zqczRyxxMapper
.
delete
(
ids
);
}
/**
* 根据基础任务ID删除
*/
@Override
public
int
deleteByJcrwid
(
Long
jcrwid
)
{
return
zqczRyxxMapper
.
deleteByJcrwid
(
jcrwid
);
}
/**
* 导入
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
int
importExcel
(
Long
jcrwid
,
MultipartFile
file
)
{
String
username
=
SecurityUtils
.
getLoginUser
().
getUsername
();
// 当前用户
XSSFWorkbook
workbook
=
null
;
try
{
workbook
=
new
XSSFWorkbook
(
file
.
getInputStream
());
XSSFSheet
sheet
=
workbook
.
getSheetAt
(
0
);
int
lastRowNum
=
sheet
.
getLastRowNum
();
List
<
ZqczRyxx
>
dataList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<=
lastRowNum
;
i
++)
{
// 跳过标题行
if
(
i
==
0
)
{
continue
;
}
XSSFRow
row
=
sheet
.
getRow
(
i
);
if
(
row
==
null
)
{
continue
;
}
// 人员名称(A列)
String
rymc
=
new
DataFormatter
().
formatCellValue
(
row
.
getCell
(
0
)).
trim
();
if
(
StringUtils
.
isEmpty
(
rymc
))
{
throw
new
BusinessException
(
"导入失败,第"
+
(
i
+
1
)
+
"行,人员名称不能为空"
);
}
// 单位(B列)
String
dwmc
=
new
DataFormatter
().
formatCellValue
(
row
.
getCell
(
1
)).
trim
();
if
(
StringUtils
.
isEmpty
(
dwmc
))
{
throw
new
BusinessException
(
"导入失败,第"
+
(
i
+
1
)
+
"行,单位不能为空"
);
}
// 分类(C列)
String
ryflName
=
new
DataFormatter
().
formatCellValue
(
row
.
getCell
(
2
)).
trim
();
String
ryfl
=
MtConstant
.
ZQCZ_RYLX_MAP
.
get
(
ryflName
);
if
(
StringUtils
.
isEmpty
(
rymc
))
{
throw
new
BusinessException
(
"导入失败,第"
+
(
i
+
1
)
+
"行,分类必须为'领导班子'、'三室一中心'、'班站'"
);
}
// 封装数据
ZqczRyxx
ryxxInfo
=
ZqczRyxx
.
builder
()
.
jcrwid
(
jcrwid
)
.
rymc
(
rymc
)
.
dwmc
(
dwmc
)
.
ryfl
(
ryfl
)
.
build
();
dataList
.
add
(
ryxxInfo
);
}
if
(
Optional
.
ofNullable
(
dataList
).
orElse
(
Collections
.
emptyList
()).
isEmpty
())
{
throw
new
BusinessException
(
"读取Excel文件失败,上传数据为空"
);
}
// 先根据jcrwid删除之前的评委信息
zqczRyxxMapper
.
deleteByJcrwid
(
jcrwid
);
// 在批量插入
int
pwSize
=
zqczRyxxMapper
.
batchAdd
(
dataList
);
return
pwSize
;
}
catch
(
BusinessException
e
)
{
throw
e
;
}
catch
(
IOException
e
)
{
throw
new
BusinessException
(
"读取Excel文件失败,请检查文件格式"
);
}
finally
{
if
(
workbook
!=
null
)
{
try
{
workbook
.
close
();
}
catch
(
IOException
ignored
)
{
}
}
}
}
}
qianhe-ydsj/src/main/resources/mapper/zqcz/ryxx/ZqczRyxxMapper.xml
0 → 100644
View file @
d2030fee
<?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.qianhe.zqcz.ryxx.mapper.ZqczRyxxMapper"
>
<!-- 返回实体 -->
<resultMap
id=
"ZqczRyxxResult"
type=
"com.qianhe.zqcz.ryxx.domain.ZqczRyxxVo"
>
<result
property=
"ryid"
column=
"RYID"
/>
<result
property=
"jcrwid"
column=
"JCRWID"
/>
<result
property=
"rymc"
column=
"RYMC"
/>
<result
property=
"dwmc"
column=
"DWMC"
/>
<result
property=
"ryfl"
column=
"RYFL"
/>
</resultMap>
<!-- 通用查询 -->
<sql
id=
"selectCommon"
>
SELECT RYID, JCRWID, RYMC, DWMC, RYFL from zqcz_ryxx
</sql>
<!-- 条件查询 -->
<select
id=
"list"
parameterType=
"com.qianhe.zqcz.ryxx.domain.ZqczRyxxQuery"
resultMap=
"ZqczRyxxResult"
>
<include
refid=
"selectCommon"
></include>
<where>
<if
test=
"jcrwid != null "
>
AND JCRWID = #{jcrwid}
</if>
<if
test=
"rymc != null and rymc !='' "
>
AND RYMC like concat('%', #{rymc}, '%')
</if>
<if
test=
"dwmc != null and dwmc !='' "
>
AND DWMC like concat('%', #{dwmc}, '%')
</if>
<if
test=
"ryfl != null and ryfl !='' "
>
AND RYFL = #{ryfl}
</if>
</where>
ORDER BY update_time
</select>
<!-- 查询详情 -->
<select
id=
"info"
parameterType=
"long"
resultMap=
"ZqczRyxxResult"
>
<include
refid=
"selectCommon"
></include>
WHERE RYID = #{ryid}
</select>
<!-- 新增 -->
<insert
id=
"add"
parameterType=
"com.qianhe.zqcz.ryxx.domain.ZqczRyxx"
>
INSERT INTO zqcz_ryxx
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"jcrwid != null "
>
JCRWID,
</if>
<if
test=
"rymc != null and rymc != ''"
>
RYMC,
</if>
<if
test=
"dwmc != null and dwmc != ''"
>
DWMC,
</if>
<if
test=
"ryfl != null and ryfl != ''"
>
RYFL,
</if>
<if
test=
"create_by != null and create_by != ''"
>
CREATE_BY,
</if>
<if
test=
"create_time != null "
>
CREATE_TIME,
</if>
<if
test=
"update_by != null and update_by != ''"
>
UPDATE_BY,
</if>
<if
test=
"update_time != null "
>
UPDATE_TIME,
</if>
<if
test=
"remark != null and remark != ''"
>
REMARK,
</if>
<if
test=
"yl1 != null and yl1 != ''"
>
YL1,
</if>
<if
test=
"yl2 != null and yl2 != ''"
>
YL2,
</if>
<if
test=
"yl3 != null and yl3 != ''"
>
YL3,
</if>
<if
test=
"yl4 != null and yl4 != ''"
>
YL4,
</if>
<if
test=
"yl5 != null and yl5 != ''"
>
YL5,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"jcrwid != null"
>
#{jcrwid},
</if>
<if
test=
"rymc != null"
>
#{rymc},
</if>
<if
test=
"dwmc != null"
>
#{dwmc},
</if>
<if
test=
"ryfl != null"
>
#{ryfl},
</if>
<if
test=
"create_by != null"
>
#{create_by},
</if>
<if
test=
"create_time != null"
>
#{create_time},
</if>
<if
test=
"update_by != null"
>
#{update_by},
</if>
<if
test=
"update_time != null"
>
#{update_time},
</if>
<if
test=
"remark != null"
>
#{remark},
</if>
<if
test=
"yl1 != null"
>
#{yl1},
</if>
<if
test=
"yl2 != null"
>
#{yl2},
</if>
<if
test=
"yl3 != null"
>
#{yl3},
</if>
<if
test=
"yl4 != null"
>
#{yl4},
</if>
<if
test=
"yl5 != null"
>
#{yl5},
</if>
</trim>
</insert>
<!-- 修改 -->
<update
id=
"edit"
parameterType=
"com.qianhe.zqcz.ryxx.domain.ZqczRyxx"
>
UPDATE zqcz_ryxx
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"jcrwid != null"
>
JCRWID = #{jcrwid},
</if>
<if
test=
"rymc != null and rymc != ''"
>
RYMC = #{rymc},
</if>
<if
test=
"dwmc != null and dwmc != ''"
>
DWMC = #{dwmc},
</if>
<if
test=
"ryfl != null and ryfl != ''"
>
RYFL = #{ryfl},
</if>
<if
test=
"create_by != null"
>
CREATE_BY = #{create_by},
</if>
<if
test=
"create_time != null"
>
CREATE_TIME = #{create_time},
</if>
<if
test=
"update_by != null"
>
UPDATE_BY = #{update_by},
</if>
<if
test=
"update_time != null"
>
UPDATE_TIME = #{update_time},
</if>
<if
test=
"remark != null"
>
REMARK = #{remark},
</if>
<if
test=
"yl1 != null"
>
YL1 = #{yl1},
</if>
<if
test=
"yl2 != null"
>
YL2 = #{yl2},
</if>
<if
test=
"yl3 != null"
>
YL3 = #{yl3},
</if>
<if
test=
"yl4 != null"
>
YL4 = #{yl4},
</if>
<if
test=
"yl5 != null"
>
YL5 = #{yl5},
</if>
</trim>
WHERE RYID = #{ryid}
</update>
<!-- 删除 -->
<delete
id=
"delete"
parameterType=
"long"
>
DELETE FROM zqcz_ryxx WHERE RYID IN
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
<!-- 根据基础任务ID删除 -->
<delete
id=
"deleteByJcrwid"
parameterType=
"long"
>
DELETE FROM zqcz_ryxx WHERE JCRWID = #{jcrwid}
</delete>
<!-- 人员信息表批量插入 -->
<insert
id=
"batchAdd"
parameterType=
"java.util.List"
>
<choose>
<when
test=
"ryxxList != null and ryxxList.size() > 0 and !ryxxList.isEmpty()"
>
INSERT INTO zqcz_ryxx
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"ryxxList[0].jcrwid != null"
>
JCRWID,
</if>
<if
test=
"ryxxList[0].dwmc != null and ryxxList[0].dwmc != ''"
>
DWMC,
</if>
<if
test=
"ryxxList[0].ryfl != null and ryxxList[0].ryfl != ''"
>
RYFL,
</if>
<if
test=
"ryxxList[0].rymc != null and ryxxList[0].rymc != ''"
>
RYMC,
</if>
<if
test=
"ryxxList[0].createBy != null and ryxxList[0].createBy != ''"
>
CREATE_BY,
</if>
<if
test=
"ryxxList[0].createTime != null"
>
CREATE_TIME,
</if>
<if
test=
"ryxxList[0].updateBy != null and ryxxList[0].updateBy != ''"
>
UPDATE_BY,
</if>
<if
test=
"ryxxList[0].remark != null and ryxxList[0].remark != ''"
>
REMARK,
</if>
<if
test=
"ryxxList[0].yl1 != null and ryxxList[0].yl1 != ''"
>
YL1,
</if>
<if
test=
"ryxxList[0].yl2 != null and ryxxList[0].yl2 != ''"
>
YL2,
</if>
<if
test=
"ryxxList[0].yl3 != null and ryxxList[0].yl3 != ''"
>
YL3,
</if>
<if
test=
"ryxxList[0].yl4 != null and ryxxList[0].yl4 != ''"
>
YL4,
</if>
<if
test=
"ryxxList[0].yl5 != null and ryxxList[0].yl5 != ''"
>
YL5,
</if>
UPDATE_TIME
</trim>
VALUES
<foreach
collection=
"ryxxList"
item=
"item"
index=
"index"
separator=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"item.jcrwid != null"
>
#{item.jcrwid},
</if>
<if
test=
"item.dwmc != null and item.dwmc != ''"
>
#{item.dwmc},
</if>
<if
test=
"item.ryfl != null and item.ryfl != ''"
>
#{item.ryfl},
</if>
<if
test=
"item.rymc != null and item.rymc != ''"
>
#{item.rymc},
</if>
<if
test=
"item.createBy != null and item.createBy != ''"
>
#{item.createBy},
</if>
<if
test=
"item.createTime != null"
>
#{item.createTime},
</if>
<if
test=
"item.updateBy != null and item.updateBy != ''"
>
#{item.updateBy},
</if>
<if
test=
"item.remark != null and item.remark != ''"
>
#{item.remark},
</if>
<if
test=
"item.yl1 != null and item.yl1 != ''"
>
#{item.yl1},
</if>
<if
test=
"item.yl2 != null and item.yl2 != ''"
>
#{item.yl2},
</if>
<if
test=
"item.yl3 != null and item.yl3 != ''"
>
#{item.yl3},
</if>
<if
test=
"item.yl4 != null and item.yl4 != ''"
>
#{item.yl4},
</if>
<if
test=
"item.yl5 != null and item.yl5 != ''"
>
#{item.yl5},
</if>
now()
</trim>
</foreach>
</when>
<otherwise>
SELECT 0 FROM DUAL
</otherwise>
</choose>
</insert>
</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