Commit c242dac1 by MMF

MMF 2026-03-24 新增项目抽检模块

parent d524bf9b
package com.qianhe.common.enums.zqcz;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public enum ZqczRyflEnum {
LINGDAO_BANZI("1", "领导班子"),
SANSHI_YIZHONGXIN("2", "三室一中心"),
BANZHAN("3", "班站");
private final String code;
private final String name;
ZqczRyflEnum(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
/**
* 通过编码找名称
*/
public static String getNameByCode(String code) {
if (code == null || code.trim().isEmpty()) {
return "";
}
for (ZqczRyflEnum e : values()) {
if (e.code.equals(code.trim())) {
return e.name;
}
}
return "";
}
/**
* 通过名称找编码
*/
public static String getCodeByName(String name) {
// 空值校验
if (name == null || name.trim().isEmpty()) {
return "";
}
// 遍历枚举找匹配(忽略大小写,兼容"应急处置"/"应急处置 "等情况)
for (ZqczRyflEnum e : values()) {
if (e.name.equalsIgnoreCase(name.trim())) {
return e.code;
}
}
// 无匹配返回空
return "";
}
/**
* 通过编码找整个枚举对象
*/
public static ZqczRyflEnum getEnumByCode(String code) {
if (code == null || code.trim().isEmpty()) {
return null;
}
for (ZqczRyflEnum e : values()) {
if (e.code.equals(code.trim())) {
return e;
}
}
return null;
}
/**
* 获取所有名称
*/
public static List<String> getAllNames() {
return Arrays.stream(values())
.map(ZqczRyflEnum::getName)
.collect(Collectors.toList());
}
/**
* 获取所有编码
*/
public static List<String> getAllCodes() {
return Arrays.stream(values())
.map(ZqczRyflEnum::getCode)
.collect(Collectors.toList());
}
/**
* 获取所有name-code的映射
*/
public static Map<String, String> getNameToCodeMap() {
return Arrays.stream(values())
.collect(Collectors.toMap(
ZqczRyflEnum::getName, // key = name
ZqczRyflEnum::getCode, // value = code
(oldValue, newValue) -> oldValue // 避免重复name(兜底,实际枚举中name唯一)
));
}
/**
* 获取所有的code-name的映射
*/
public static Map<String, String> getCodeToNameMap() {
return Arrays.stream(values())
.collect(Collectors.toMap(
ZqczRyflEnum::getCode, // key = code
ZqczRyflEnum::getName, // value = name
(oldValue, newValue) -> oldValue // 避免重复code(兜底,实际枚举中code唯一)
));
}
/**
* 将当前枚举转为「编码-名称」格式字符串(如:code-name)
*/
private String toCodeNameStr() {
return String.format("%s-%s", this.code, this.name);
}
/**
* 获取所有「编码-名称」格式的字符串列表 如:["code-name", "code-name", ...]
*/
public static List<String> getAllCodeNameStrs() {
return Arrays.stream(values())
.map(ZqczRyflEnum::toCodeNameStr) // 调用单个拼接方法
.collect(Collectors.toList());
}
/**
* 获取所有「编码-名称」格式的字符串,以竖线分隔 如:"code-name|code-name|code-name"
*/
public static String getAllCodeNameStrWithSeparator() {
return String.join("|", getAllCodeNameStrs());
}
}
......@@ -113,10 +113,13 @@ public class ZqczJcrwController extends BaseController {
/**
* 基层抽检查询
*/
@GetMapping("/jcrwInfo/{zsrwid}")
public AjaxResult jcrwInfo(@PathVariable Long zsrwid) {
@GetMapping("/jcrwInfo")
public AjaxResult jcrwInfo(ZqczJcrwQuery zqczJcrwQuery) {
try {
return success(zqczJcrwService.jcrwInfo(zsrwid));
return success(zqczJcrwService.jcrwInfo(zqczJcrwQuery));
} catch (BusinessException e) {
log.warn("最强操作-基层任务-基层抽检查询" + e.getMessage());
return warn(e.getMessage());
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
......
......@@ -17,6 +17,10 @@ import java.util.Date;
public class ZqczJcrwQuery extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 直属任务 zqcz_zsrw.zsrwid
*/
private Long zsrwid;
/**
* 基层单位名称
*/
private String jcdwmc;
......
......@@ -27,6 +27,11 @@ public class ZqczJcrwVo {
private Long jcrwid;
/**
* 基层单位ID
*/
private Long jcdwid;
/**
* 基层单位名称
*/
@Excel(name = "基层单位")
......
......@@ -23,7 +23,7 @@ public interface ZqczJcrwMapper {
/**
* 根据直属任务ID查询
*/
List<ZqczJcrwVo> infoByZsrwId(Long zsrwid);
List<ZqczJcrwVo> infoByZsrwId(ZqczJcrwQuery zqczJcrwQuery);
/**
* 新增
......
......@@ -39,7 +39,7 @@ public interface ZqczJcrwService {
/**
* 基层抽检查询
*/
ZqczJccjVo jcrwInfo(Long zsrwid);
ZqczJccjVo jcrwInfo(ZqczJcrwQuery zqczJcrwQuery);
/**
* 基层任务抽取
......
......@@ -93,17 +93,21 @@ public class ZqczJcrwServiceImpl implements ZqczJcrwService {
* 基层抽检查询
*/
@Override
public ZqczJccjVo jcrwInfo(Long zsrwid) {
public ZqczJccjVo jcrwInfo(ZqczJcrwQuery zqczJcrwQuery) {
Long zsrwid = zqczJcrwQuery.getZsrwid();
if (zsrwid == null) {
throw new BusinessException("直属任务ID不能为空");
}
// 1. 根据直属任务ID 查询直属任务
ZqczZsrwVo zsrwInfo = zqczZsrwMapper.info(zsrwid);
if (zsrwInfo == null) {
log.warn("最强操作 --- 基层抽检查询 --- 直属任务ID:{} --- 暂无直属任务", zsrwid);
return new ZqczJccjVo();
throw new BusinessException(String.format("暂无直属任务,当前直属任务ID:%s", zsrwid));
}
// 2. 根据直属任务ID 查询基层任务
startPage();
List<ZqczJcrwVo> dataList = zqczJcrwMapper.infoByZsrwId(zsrwid);
List<ZqczJcrwVo> dataList = zqczJcrwMapper.infoByZsrwId(zqczJcrwQuery);
// 构建分页结构
TableDataInfo tableDataInfo = new TableDataInfo();
......
......@@ -149,14 +149,14 @@ public class ZqczXmglServiceImpl implements ZqczXmglService {
// 项目专业处理
String xmzyStr = cellValueMap.get("项目专业");
if (!ZqczXmzyEnum.getAllNames().contains(xmzyStr)) {
throw new BusinessException(String.format("项目专业必须为%s, 当前值 %s", ZqczXmzyEnum.getAllCodeNameStrWithSeparator(), xmzyStr));
throw new BusinessException(String.format("第%s行,项目专业必须为%s, 当前值 %s", i + 1, ZqczXmzyEnum.getAllCodeNameStrWithSeparator(), xmzyStr));
}
String xmzy = ZqczXmzyEnum.getCodeByName(xmzyStr);
// 项目类别处理
String xmlbStr = cellValueMap.get("项目类别");
if (!ZqczXmlbEnum.getAllNames().contains(xmlbStr)) {
throw new BusinessException(String.format("项目类别必须为%s, 当前值 %s", ZqczXmlbEnum.getAllCodeNameStrWithSeparator(), xmlbStr));
throw new BusinessException(String.format("第%s行,项目类别必须为%s, 当前值 %s", i + 1, ZqczXmlbEnum.getAllCodeNameStrWithSeparator(), xmlbStr));
}
String xmlb = ZqczXmlbEnum.getCodeByName(xmlbStr);
......@@ -166,13 +166,13 @@ public class ZqczXmglServiceImpl implements ZqczXmglService {
if (MtConstant.ZQCZ_XMZY_CYZY_CODE.equals(xmzy)) {
gzcj = ZqczCyzyGzcjEnum.getCodeByName(gzcjStr);
if (StringUtils.isEmpty(gzcj)) {
throw new BusinessException(String.format("工作场景必须为%s, 当前工作场景 %s", ZqczCyzyGzcjEnum.getAllCodeNameStrWithSeparator(), gzcjStr));
throw new BusinessException(String.format("第%s行,工作场景必须为%s, 当前工作场景 %s", i + 1, ZqczCyzyGzcjEnum.getAllCodeNameStrWithSeparator(), gzcjStr));
}
}
if (MtConstant.ZQCZ_XMZY_JSZY_CODE.equals(xmzy)) {
gzcj = ZqczJszyGzcjEnum.getCodeByName(gzcjStr);
if (gzcj == null) {
throw new BusinessException(String.format("工作场景必须为%s, 当前工作场景 %s", ZqczJszyGzcjEnum.getAllCodeNameStrWithSeparator(), gzcjStr));
throw new BusinessException(String.format("第%s行,工作场景必须为%s, 当前工作场景 %s", i + 1, ZqczJszyGzcjEnum.getAllCodeNameStrWithSeparator(), gzcjStr));
}
}
......@@ -189,6 +189,8 @@ public class ZqczXmglServiceImpl implements ZqczXmglService {
.gzcj(gzcj)
.xmmc(xmmc)
.xmrs(xmrs)
.create_by(username)
.update_by(username)
.build();
return zqczXmgl;
}, dataList -> {
......
package com.qianhe.zqcz.xmrylsjl.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.xmrylsjl.domain.ZqczXmRyLsjl;
import com.qianhe.zqcz.xmrylsjl.domain.ZqczXmRyLsjlQuery;
import com.qianhe.zqcz.xmrylsjl.domain.ZqczXmRyLsjlVo;
import com.qianhe.zqcz.xmrylsjl.service.ZqczXmRyLsjlService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Slf4j
@RestController
@RequestMapping("/zqcz/lsjl")
public class ZqczXmRyLsjlController extends BaseController {
@Autowired
private ZqczXmRyLsjlService zqczXmRyLsjlService;
/**
* 分页查询
*/
@GetMapping("/list")
public AjaxResult list(ZqczXmRyLsjlQuery zqczXmRyLsjlQuery) {
return success(zqczXmRyLsjlService.list(zqczXmRyLsjlQuery));
}
/**
* 项目抽检
*/
@PostMapping("/spotCheckAdd")
public AjaxResult spotCheckAdd(@RequestBody ZqczXmRyLsjlQuery zqczXmRyLsjlQuery) {
try {
return toAjax(zqczXmRyLsjlService.spotCheckAdd(zqczXmRyLsjlQuery));
} catch (BusinessException e) {
log.warn("最强操作-项目抽检失败:" + e.getMessage());
return warn(e.getMessage());
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 导出
*/
@PostMapping("/export")
public void export(HttpServletResponse response, ZqczXmRyLsjlQuery zqczXmRyLsjlQuery) {
List<ZqczXmRyLsjlVo> dataList = zqczXmRyLsjlService.list(zqczXmRyLsjlQuery);
ExcelUtil<ZqczXmRyLsjlVo> util = new ExcelUtil<>(ZqczXmRyLsjlVo.class);
util.exportExcel(response, dataList, "sheetName");
}
}
package com.qianhe.zqcz.xmrylsjl.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qianhe.common.annotation.Excel;
import com.qianhe.common.core.domain.BaseEntity;
import com.qianhe.common.utils.SecurityUtils;
import com.qianhe.zqcz.ryxx.domain.ZqczRyxxVo;
import com.qianhe.zqcz.xmgl.domain.ZqczXmglVo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 最强操作-项目人员 历史记录 Model
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqczXmRyLsjl extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long xmryid;
/**
* 基层任务ID:关联zqcz_jcrw.jcrwid
*/
private Long jcrwid;
/**
* 基层单位名称 关联 zqcz_jcdw.jcdwid
*/
private Long jcdwid;
/**
* 项目名称
*/
private String xmmc;
/**
* 项目专业:1-采油专业 2-集输专业
*/
private String xmzy;
/**
* 项目类别:1-个人应急项目 2-团队应急项目 3-单人/双人操作项目 4-团队操作项目 字典:zqcz_xmlb
*/
private String xmlb;
/**
* 工作场景码表:采油zqcz_cyzy_gzcj 集输zqcz_jszy_gzcj
*/
private String gzcj;
/**
* 人员名称
*/
private String rymc;
/**
* 单位名称(存储上传的单位名称,领导班子、三室一中心、班站)
*/
private String dwmc;
/**
* 创建者
*/
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;
public ZqczXmRyLsjl(Long jcrwid, Long jcdwid, ZqczRyxxVo ryxxVo, ZqczXmglVo xmglVo) {
this.jcrwid = jcrwid;
this.jcdwid = jcdwid;
this.xmmc = xmglVo.getXmmc();
this.xmzy = xmglVo.getXmzy();
this.xmlb = xmglVo.getXmlb();
this.gzcj = xmglVo.getGzcj();
this.rymc = ryxxVo.getRymc();
this.dwmc = ryxxVo.getDwmc();
this.create_by = SecurityUtils.getLoginUser().getUsername();
this.update_by = SecurityUtils.getLoginUser().getUsername();
this.create_time = new Date();
}
}
package com.qianhe.zqcz.xmrylsjl.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;
/**
* 最强操作-项目人员 历史记录 Model
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqczXmRyLsjlQuery extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 基层任务ID:关联 zqcz_jcrw.jcrwid
*/
private Long jcrwid;
/**
* 基层任务ID:关联 zqcz_jcdw.jcdwid
*/
private Long jcdwid;
/**
* 项目专业:1 - 采油专业,2 - 集输专业 字典:zqcz_xmzy
*/
private String xmzy;
}
package com.qianhe.zqcz.xmrylsjl.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;
/**
* 最强操作-项目人员 历史记录 Model
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqczXmRyLsjlVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long xmryid;
/**
* 基层任务ID:关联zqcz_jcrw.jcrwid
*/
private Long jcrwid;
/**
* 基层单位ID: 关联 zqcz_jcdw.jcdwid
*/
private Long jcdwid;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date update_time;
/**
* 基层单位名称
*/
@Excel(name = "基层单位名称")
private String jcdwmc;
/**
* 单位名称(存储上传的单位名称,领导班子、三室一中心、班站)
*/
@Excel(name = "班站名称")
private String dwmc;
/**
* 项目类别:1-个人应急项目 2-团队应急项目 3-单人/双人操作项目 4-团队操作项目 字典 zqcz_xmlb
*/
@Excel(name = "项目类别",dictType = "zqcz_xmlb",type = Excel.Type.EXPORT)
private String xmlb;
/**
* 人员名称
*/
@Excel(name = "盲抽人员名称")
private String rymc;
/**
* 项目名称
*/
@Excel(name = "盲抽项目名称")
private String xmmc;
}
package com.qianhe.zqcz.xmrylsjl.mapper;
import com.qianhe.zqcz.xmgl.domain.ZqczXmgl;
import com.qianhe.zqcz.xmrylsjl.domain.ZqczXmRyLsjl;
import com.qianhe.zqcz.xmrylsjl.domain.ZqczXmRyLsjlQuery;
import com.qianhe.zqcz.xmrylsjl.domain.ZqczXmRyLsjlVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface ZqczXmRyLsjlMapper {
/**
* 条件查询
*/
List<ZqczXmRyLsjlVo> list(ZqczXmRyLsjlQuery zqczXmRyLsjlQuery);
/**
* 查询详情
*/
ZqczXmRyLsjlVo info(Long id);
/**
* 新增
*/
int add(ZqczXmRyLsjl zqczXmRyLsjl);
/**
* 修改
*/
int edit(ZqczXmRyLsjl zqczXmRyLsjl);
/**
* 删除
*/
int delete(Long[] ids);
/**
* 批量新增
*/
int batchAdd(@Param("dataList") List<ZqczXmRyLsjl> dataList);
/**
* 根据基层任务ID 删除
*/
int deleteByJcrwid(@Param("jcrwid") Long jcrwid);
}
package com.qianhe.zqcz.xmrylsjl.service;
import com.qianhe.zqcz.xmrylsjl.domain.ZqczXmRyLsjl;
import com.qianhe.zqcz.xmrylsjl.domain.ZqczXmRyLsjlQuery;
import com.qianhe.zqcz.xmrylsjl.domain.ZqczXmRyLsjlVo;
import java.util.List;
public interface ZqczXmRyLsjlService {
/**
* 条件查询
*/
List<ZqczXmRyLsjlVo> list(ZqczXmRyLsjlQuery zqczXmRyLsjlQuery);
/**
* 根据基层任务ID 开始项目抽检
*/
int spotCheckAdd(ZqczXmRyLsjlQuery zqczXmRyLsjlQuery);
}
......@@ -7,6 +7,7 @@
<resultMap id="ZqczJcrwResult" type="com.qianhe.zqcz.jcrw.domain.ZqczJcrwVo">
<id property="jcrwid" column="jcrwid"/>
<result property="zsrwid" column="zsrwid"/>
<result property="jcdwid" column="jcdwid"/>
<result property="jcdwmc" column="jcdwmc"/>
<result property="jczzlx" column="jczzlx"/>
<result property="cjlx" column="cjlx"/>
......@@ -17,6 +18,7 @@
SELECT
jcrw.zsrwid,
jcrw.jcrwid,
jcrw.jcdwid,
jcdw.jcdwmc,
jcrw.cjlx,
jcdw.jczzlx,
......@@ -39,7 +41,7 @@
<include refid="selectCommon"></include> WHERE jcrw.jcrwid = #{jcrwid}
</select>
<!-- 根据直属任务ID查询 -->
<select id="infoByZsrwId" parameterType="long" resultMap="ZqczJcrwResult">
<select id="infoByZsrwId" parameterType="com.qianhe.zqcz.jcrw.domain.ZqczJcrwQuery" resultMap="ZqczJcrwResult">
<include refid="selectCommon"></include> WHERE jcrw.zsrwid = #{zsrwid}
</select>
<!-- 新增 -->
......
......@@ -123,9 +123,9 @@
<if test="dataList[0].gzcj != null and dataList[0].gzcj != ''">GZCJ,</if>
<if test="dataList[0].xmrs != null">XMRS,</if>
<if test="dataList[0].xmzt != null and dataList[0].xmzt != ''">XMZT,</if>
<if test="dataList[0].createBy != null and dataList[0].createBy != ''">CREATE_BY,</if>
<if test="dataList[0].createTime != null">CREATE_TIME,</if>
<if test="dataList[0].updateBy != null and dataList[0].updateBy != ''">UPDATE_BY,</if>
<if test="dataList[0].create_by != null and dataList[0].create_by != ''">CREATE_BY,</if>
<if test="dataList[0].create_time != null">CREATE_TIME,</if>
<if test="dataList[0].update_by != null and dataList[0].update_by != ''">UPDATE_BY,</if>
<if test="dataList[0].remark != null and dataList[0].remark != ''">REMARK,</if>
<if test="dataList[0].yl1 != null and dataList[0].yl1 != ''">YL1,</if>
<if test="dataList[0].yl2 != null and dataList[0].yl2 != ''">YL2,</if>
......@@ -143,9 +143,9 @@
<if test="item.gzcj != null and item.gzcj != ''">#{item.gzcj},</if>
<if test="item.xmrs != null">#{item.xmrs},</if>
<if test="item.xmzt != null and item.xmzt != ''">#{item.xmzt},</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.create_by != null and item.create_by != ''">#{item.create_by},</if>
<if test="item.create_time != null">#{item.create_time},</if>
<if test="item.update_by != null and item.update_by != ''">#{item.update_by},</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>
......
<?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.xmrylsjl.mapper.ZqczXmRyLsjlMapper">
<!-- 返回实体 -->
<resultMap id="ZqczXmRyLsjlResult" type="com.qianhe.zqcz.xmrylsjl.domain.ZqczXmRyLsjlVo">
<result property="xmryid" column="XMRYID"/>
<result property="jcrwid" column="JCRWID"/>
<result property="xmmc" column="XMMC"/>
<result property="xmlb" column="XMLB"/>
<result property="rymc" column="RYMC"/>
<result property="dwmc" column="DWMC"/>
<result property="update_time" column="UPDATE_TIME"/>
<result property="jcdwmc" column="JCDWMC"/>
</resultMap>
<!-- 通用查询 -->
<sql id="selectCommon">
SELECT
lsjl.XMRYID,
lsjl.JCRWID,
lsjl.XMMC,
lsjl.XMLB,
lsjl.RYMC,
lsjl.DWMC,
lsjl.JCDWID,
jcdw.jcdwmc AS JCDWMC,
lsjl.UPDATE_TIME
FROM
zqcz_xm_ry_lsjl lsjl
LEFT JOIN zqcz_jcdw jcdw ON lsjl.jcdwid = jcdw.jcdwid
</sql>
<!-- 条件查询 -->
<select id="list" parameterType="com.qianhe.zqcz.xmrylsjl.domain.ZqczXmRyLsjlQuery" resultMap="ZqczXmRyLsjlResult">
<include refid="selectCommon"></include>
<where>
<if test="jcrwid != null ">AND lsjl.JCRWID = #{jcrwid}</if>
</where>
ORDER BY lsjl.xmlb
</select>
<!-- 查询详情 -->
<select id="info" parameterType="long" resultMap="ZqczXmRyLsjlResult">
<include refid="selectCommon"></include> WHERE lsjl.XMRYID = #{xmryid}
</select>
<!-- 新增 -->
<insert id="add" parameterType="ZqczXmRyLsjl">
INSERT INTO zqcz_xm_ry_lsjl
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="xmryid != null ">XMRYID,</if>
<if test="jcrwid != null ">JCRWID,</if>
<if test="jcdwid != null">JCDWID,</if>
<if test="xmmc != null and xmmc != ''">XMMC,</if>
<if test="xmzy != null and xmzy != ''">XMZY,</if>
<if test="xmlb != null and xmlb != ''">XMLB,</if>
<if test="gzcj != null and gzcj != ''">GZCJ,</if>
<if test="rymc != null and rymc != ''">RYMC,</if>
<if test="dwmc != null and dwmc != ''">DWMC,</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="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>
UPDATE_TIME
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="xmryid != null">#{xmryid},</if>
<if test="jcrwid != null">#{jcrwid},</if>
<if test="jcdwid != null">#{jcdwid},</if>
<if test="xmmc != null and xmmc != ''">#{xmmc},</if>
<if test="xmzy != null and xmzy != ''">#{xmzy},</if>
<if test="xmlb != null and xmlb != ''">#{xmlb},</if>
<if test="gzcj != null and gzcj != ''">#{gzcj},</if>
<if test="rymc != null and rymc != ''">#{rymc},</if>
<if test="dwmc != null and dwmc != ''">#{dwmc},</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="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>
now()
</trim>
</insert>
<!-- 修改 -->
<update id="edit" parameterType="ZqczXmRyLsjl">
UPDATE zqcz_xm_ry_lsjl
<trim prefix="SET" suffixOverrides=",">
<if test="jcrwid != null">JCRWID = #{jcrwid},</if>
<if test="jcdwid != null">JCDWID = #{jcdwid},</if>
<if test="xmmc != null and xmmc != ''">XMMC = #{xmmc},</if>
<if test="xmzy != null and xmzy != ''">XMZY = #{xmzy},</if>
<if test="xmlb != null and xmlb != ''">XMLB = #{xmlb},</if>
<if test="gzcj != null and gzcj != ''">GZCJ = #{gzcj},</if>
<if test="rymc != null and rymc != ''">RYMC = #{rymc},</if>
<if test="dwmc != null and dwmc != ''">DWMC = #{dwmc},</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="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>
UPDATE_TIME = now()
</trim>
WHERE XMRYID = #{xmryid}
</update>
<!-- 删除 -->
<delete id="delete" parameterType="long">
DELETE FROM zqcz_xm_ry_lsjl WHERE XMRYID IN
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 批量新增 -->
<insert id="batchAdd" parameterType="java.util.List">
<choose>
<when test="dataList != null and dataList.size() > 0 and !dataList.isEmpty()">
INSERT INTO zqcz_xm_ry_lsjl
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dataList[0].jcrwid != null">JCRWID,</if>
<if test="dataList[0].jcdwid != null">JCDWID,</if>
<if test="dataList[0].xmmc != null and dataList[0].xmmc != ''">XMMC,</if>
<if test="dataList[0].xmzy != null and dataList[0].xmzy != ''">XMZY,</if>
<if test="dataList[0].xmlb != null and dataList[0].xmlb != ''">XMLB,</if>
<if test="dataList[0].gzcj != null and dataList[0].gzcj != ''">GZCJ,</if>
<if test="dataList[0].rymc != null and dataList[0].rymc != ''">RYMC,</if>
<if test="dataList[0].dwmc != null and dataList[0].dwmc != ''">DWMC,</if>
<if test="dataList[0].create_by != null and dataList[0].create_by != ''">CREATE_BY,</if>
<if test="dataList[0].create_time != null">CREATE_TIME,</if>
<if test="dataList[0].update_by != null and dataList[0].update_by != ''">UPDATE_BY,</if>
<if test="dataList[0].remark != null and dataList[0].remark != ''">REMARK,</if>
<if test="dataList[0].yl1 != null and dataList[0].yl1 != ''">YL1,</if>
<if test="dataList[0].yl2 != null and dataList[0].yl2 != ''">YL2,</if>
<if test="dataList[0].yl3 != null and dataList[0].yl3 != ''">YL3,</if>
<if test="dataList[0].yl4 != null and dataList[0].yl4 != ''">YL4,</if>
<if test="dataList[0].yl5 != null and dataList[0].yl5 != ''">YL5,</if>
UPDATE_TIME
</trim>
VALUES
<foreach collection="dataList" item="item" index="index" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="item.jcrwid != null">#{item.jcrwid},</if>
<if test="item.jcdwid != null">#{item.jcdwid},</if>
<if test="item.xmmc != null and item.xmmc != ''">#{item.xmmc},</if>
<if test="item.xmzy != null and item.xmzy != ''">#{item.xmzy},</if>
<if test="item.xmlb != null and item.xmlb != ''">#{item.xmlb},</if>
<if test="item.gzcj != null and item.gzcj != ''">#{item.gzcj},</if>
<if test="item.rymc != null and item.rymc != ''">#{item.rymc},</if>
<if test="item.dwmc != null and item.dwmc != ''">#{item.dwmc},</if>
<if test="item.create_by != null and item.create_by != ''">#{item.create_by},</if>
<if test="item.create_time != null">#{item.create_time},</if>
<if test="item.update_by != null and item.update_by != ''">#{item.update_by},</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>
<!-- 根据基层任务ID删除 -->
<delete id="deleteByJcrwid" parameterType="long">
DELETE FROM zqcz_xm_ry_lsjl WHERE JCRWID = #{jcrwid}
</delete>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment