Commit 6ef4dbc4 by MMF

MMF 2026-04-13 项目组帮扶

parent db18a29c
...@@ -139,4 +139,9 @@ public class Constants ...@@ -139,4 +139,9 @@ public class Constants
*/ */
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
"org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config" }; "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config" };
/**
* 所有权限标识
*/
public static final String ALL_PERMISSION = "*:*:*";
} }
...@@ -154,4 +154,24 @@ public class MtConstant { ...@@ -154,4 +154,24 @@ public class MtConstant {
* 最强操作-项目类别 列表 * 最强操作-项目类别 列表
*/ */
public static final List<String> ZQCZ_XMLB_LIST = Arrays.asList(ZQCZ_XMLB_GRYJXM_CODE, ZQCZ_XMLB_TDYJXM_CODE, ZQCZ_XMLB_DRSRCZXM_CODE, ZQCZ_XMLB_TDCZXM_CODE); public static final List<String> ZQCZ_XMLB_LIST = Arrays.asList(ZQCZ_XMLB_GRYJXM_CODE, ZQCZ_XMLB_TDYJXM_CODE, ZQCZ_XMLB_DRSRCZXM_CODE, ZQCZ_XMLB_TDCZXM_CODE);
// =========================================
// ============= 三个最强 ==========
// =========================================
/**
* 三个最强 项目组
*/
public static final String SGZQ_XMZ = "sgzq_xmz";
/**
* 三个最强 项目组领导
*/
public static final String SGZQ_XMZ_LD = "sgzq_xmz_ld";
/**
* 三个最强 项目组专家
*/
public static final String SGZQ_XMZ_ZJ = "sgzq_zj";
/**
* 三个最强 基层单位
*/
public static final String SGZQ_JCDW = "sgzq_jcdw";
} }
package com.qianhe.common.utils;
import com.qianhe.common.core.domain.entity.SysDept;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class MtTreeUtils {
/**
* 查询指定单位的下一级单位
* @param deptList 所有单位的列表
* @param parentId 目标单位的ID(查询其下一级)
* @return 下一级单位列表(无则返回空列表)
*/
public static List<SysDept> getDirectChildren(List<SysDept> deptList, Long parentId) {
if (deptList == null || parentId == null) {
return new ArrayList<>();
}
// 筛选出父级ID等于目标parentId的单位
return deptList.stream()
.filter(org -> parentId.equals(org.getParentId()))
.collect(Collectors.toList());
}
}
package com.qianhe.common.utils; package com.qianhe.common.utils;
import com.qianhe.common.constant.HttpStatus; import com.qianhe.common.constant.HttpStatus;
import com.qianhe.common.core.domain.entity.SysRole;
import com.qianhe.common.exception.ServiceException; import com.qianhe.common.exception.ServiceException;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
...@@ -8,6 +9,14 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; ...@@ -8,6 +9,14 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import com.qianhe.common.constant.HttpStatus; import com.qianhe.common.constant.HttpStatus;
import com.qianhe.common.core.domain.model.LoginUser; import com.qianhe.common.core.domain.model.LoginUser;
import com.qianhe.common.exception.ServiceException; import com.qianhe.common.exception.ServiceException;
import org.springframework.util.PatternMatchUtils;
import com.qianhe.common.constant.Constants;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/** /**
* 安全服务工具类 * 安全服务工具类
...@@ -119,4 +128,23 @@ public class SecurityUtils ...@@ -119,4 +128,23 @@ public class SecurityUtils
{ {
return userId != null && 1L == userId; return userId != null && 1L == userId;
} }
/**
* 验证用户是否具备某权限
*
* @param permission 权限字符串
* @return 用户是否具备某权限
*/
public static boolean hasPermi(String permission)
{
List<SysRole> roles = getLoginUser().getUser().getRoles();
if (Optional.ofNullable(roles).orElse(Collections.emptyList()).isEmpty()) {
return false;
}
List<String> roleList = roles.stream().map(SysRole::getRoleKey).collect(Collectors.toList());
if (!roleList.contains(permission)) {
return false;
}
return true;
}
} }
...@@ -616,6 +616,28 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils ...@@ -616,6 +616,28 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
return sb.toString(); return sb.toString();
} }
/**
* 判断是否为空,并且不是空白字符
*
* @param str 要判断的value
* @return 结果
*/
public static boolean hasText(String str)
{
return (str != null && !str.isEmpty() && containsText(str));
}
private static boolean containsText(CharSequence str)
{
int strLen = str.length();
for (int i = 0; i < strLen; i++)
{
if (!Character.isWhitespace(str.charAt(i)))
{
return true;
}
}
return false;
}
} }
package com.qianhe.zqbf.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.zqbf.domain.ZqbfXmzBfxm;
import com.qianhe.zqbf.domain.ZqbfXmzBfxmQuery;
import com.qianhe.zqbf.service.ZqbfXmzBfxmService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Slf4j
@RestController
@RequestMapping("/zqbf/bfxm")
public class ZqbfXmzBfxmController extends BaseController {
@Autowired
private ZqbfXmzBfxmService zqbfXmzBfxmService;
/**
* 分页查询
*/
@GetMapping("/list")
public TableDataInfo list(ZqbfXmzBfxmQuery zqbfXmzBfxmQuery) {
startPage();
return getDataTable(zqbfXmzBfxmService.list(zqbfXmzBfxmQuery));
}
/**
* 新增
*/
@PostMapping
public AjaxResult add(@RequestBody ZqbfXmzBfxm zqbfXmzBfxm) {
try {
return toAjax(zqbfXmzBfxmService.add(zqbfXmzBfxm, getUsername()));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 修改
*/
@PutMapping
public AjaxResult edit(@RequestBody ZqbfXmzBfxm zqbfXmzBfxm) {
try {
return toAjax(zqbfXmzBfxmService.edit(zqbfXmzBfxm, getUsername()));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 删除
*/
@DeleteMapping("/{ids}")
public AjaxResult delete(@PathVariable Long[] ids) {
try {
return toAjax(zqbfXmzBfxmService.delete(ids));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
}
package com.qianhe.zqbf.controller;
import com.qianhe.common.core.controller.BaseController;
import com.qianhe.common.core.domain.AjaxResult;
import com.qianhe.common.core.domain.model.LoginUser;
import com.qianhe.common.core.page.TableDataInfo;
import com.qianhe.common.exception.BusinessException;
import com.qianhe.common.utils.poi.ExcelUtil;
import com.qianhe.zqbf.domain.*;
import com.qianhe.zqbf.service.ZqbfXmzBfxqService;
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;
import java.util.Set;
@Slf4j
@RestController
@RequestMapping("/zqbf/bfxq")
public class ZqbfXmzBfxqController extends BaseController {
@Autowired
private ZqbfXmzBfxqService zqbfXmzBfxqService;
/**
* 分页查询
*/
@GetMapping("/list")
public TableDataInfo list(ZqbfXmzBfxqQuery zqbfXmzBfxqQuery) {
startPage();
List<ZqbfXmzBfxqVo> dataList = zqbfXmzBfxqService.list(zqbfXmzBfxqQuery);
return getDataTable(dataList);
}
/**
* 新增
*/
@PostMapping
public AjaxResult add(@RequestBody ZqbfXmzBfxq zqbfXmzBfxq) {
try {
return toAjax(zqbfXmzBfxqService.add(zqbfXmzBfxq, getUsername()));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 修改
*/
@PutMapping
public AjaxResult edit(@RequestBody ZqbfXmzBfxq zqbfXmzBfxq) {
try {
return toAjax(zqbfXmzBfxqService.edit(zqbfXmzBfxq, getUsername()));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 删除
*/
@DeleteMapping("/{ids}")
public AjaxResult delete(@PathVariable Long[] ids) {
try {
return toAjax(zqbfXmzBfxqService.delete(ids));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 导出
*/
@PostMapping("/export")
public void export(HttpServletResponse response, ZqbfXmzBfxqQuery zqbfXmzBfxqQuery) {
List<ZqbfXmzBfxqVo> dataList = zqbfXmzBfxqService.list(zqbfXmzBfxqQuery);
ExcelUtil<ZqbfXmzBfxqVo> util = new ExcelUtil<>(ZqbfXmzBfxqVo.class);
util.exportExcel(response, dataList, "sheetName");
}
/**
* 提报需求
*/
@PutMapping("/sub")
public AjaxResult sub(@RequestBody ZqbfXmzBfxq zqbfXmzBfxq) {
try {
return toAjax(zqbfXmzBfxqService.sub(zqbfXmzBfxq, getUsername()));
} catch (BusinessException e) {
log.warn("最强帮扶-提报需求失败:" + e.getMessage());
return warn(e.getMessage());
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 撤销需求
*/
@PutMapping("/revoke")
public AjaxResult revoke(@RequestBody ZqbfXmzBfxq zqbfXmzBfxq) {
try {
return toAjax(zqbfXmzBfxqService.revoke(zqbfXmzBfxq, getUsername()));
} catch (BusinessException e) {
log.warn("最强帮扶-撤销需求失败:" + e.getMessage());
return warn(e.getMessage());
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 调度专家
*/
@PostMapping("/dispatch")
public AjaxResult dispatch(@RequestBody List<ZqczXmzDdzj> zqczXmzDdzjList) {
try {
return toAjax(zqbfXmzBfxqService.dispatch(zqczXmzDdzjList, getUsername()));
} catch (BusinessException e) {
log.warn("最强帮扶-调度专家失败:" + e.getMessage());
return warn(e.getMessage());
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 领导审核
*/
@PostMapping("/approval")
public AjaxResult approval(@RequestBody ZqczXmzApproval zqczXmzApproval) {
try {
return toAjax(zqbfXmzBfxqService.approval(zqczXmzApproval, getUsername()));
} catch (BusinessException e) {
log.warn("最强帮扶-领导审批失败:" + e.getMessage());
return warn(e.getMessage());
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 专家反馈
*/
@PostMapping("/feedback")
public AjaxResult feedback(@RequestBody ZqczXmzZjpj zqczXmzZjpj) {
try {
return toAjax(zqbfXmzBfxqService.feedback(zqczXmzZjpj, getUsername()));
} catch (BusinessException e) {
log.warn("最强帮扶-专家反馈失败:" + e.getMessage());
return warn(e.getMessage());
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 帮扶反馈
*/
@PostMapping("/support")
public AjaxResult support(@RequestBody ZqczXmzBffk zqczXmzBffk) {
try {
return toAjax(zqbfXmzBfxqService.support(zqczXmzBffk, getUsername()));
} catch (BusinessException e) {
log.warn("最强帮扶-帮扶反馈失败:" + e.getMessage());
return warn(e.getMessage());
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
}
package com.qianhe.zqbf.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.utils.poi.ExcelUtil;
import com.qianhe.zqbf.domain.ZqbfXmzBfzj;
import com.qianhe.zqbf.domain.ZqbfXmzBfzjQuery;
import com.qianhe.zqbf.domain.ZqbfXmzBfzjVo;
import com.qianhe.zqbf.service.ZqbfXmzBfzjService;
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("/zqbf/bfzj")
public class ZqbfXmzBfzjController extends BaseController {
@Autowired
private ZqbfXmzBfzjService zqbfXmzBfzjService;
/**
* 分页查询
*/
@GetMapping("/list")
public TableDataInfo list(ZqbfXmzBfzjQuery zqbfXmzBfzjQuery) {
startPage();
return getDataTable(zqbfXmzBfzjService.list(zqbfXmzBfzjQuery));
}
/**
* 查询详情
*/
@GetMapping("/{id}")
public AjaxResult info(@PathVariable Long id) {
try {
return success(zqbfXmzBfzjService.info(id));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 新增
*/
@PostMapping
public AjaxResult add(@RequestBody ZqbfXmzBfzj zqbfXmzBfzj) {
try {
return toAjax(zqbfXmzBfzjService.add(zqbfXmzBfzj, getUsername()));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 修改
*/
@PutMapping
public AjaxResult edit(@RequestBody ZqbfXmzBfzj zqbfXmzBfzj) {
try {
return toAjax(zqbfXmzBfzjService.edit(zqbfXmzBfzj, getUsername()));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 删除
*/
@DeleteMapping("/{ids}")
public AjaxResult delete(@PathVariable Long[] ids) {
try {
return toAjax(zqbfXmzBfzjService.delete(ids));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 导出
*/
@PostMapping("/export")
public void export(HttpServletResponse response, ZqbfXmzBfzjQuery zqbfXmzBfzjQuery) {
List<ZqbfXmzBfzjVo> dataList = zqbfXmzBfzjService.list(zqbfXmzBfzjQuery);
ExcelUtil<ZqbfXmzBfzjVo> util = new ExcelUtil<>(ZqbfXmzBfzjVo.class);
util.exportExcel(response, dataList, "sheetName");
}
}
package com.qianhe.zqbf.controller;
import com.qianhe.common.core.controller.BaseController;
import com.qianhe.common.core.domain.AjaxResult;
import com.qianhe.common.exception.BusinessException;
import com.qianhe.zqbf.domain.ZqczTjfxQuery;
import com.qianhe.zqbf.service.ZqbfXmzTjfxService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/zqbf/tjfx")
public class ZqbfXmzTjfxController extends BaseController {
@Autowired
private ZqbfXmzTjfxService zqbfXmzTjfxService;
/**
* 管理区上报数量
*/
@GetMapping("/glqsbsl")
public AjaxResult glqsbsl(ZqczTjfxQuery zqczTjfxQuery) {
try {
return success(zqbfXmzTjfxService.glqsbsl(zqczTjfxQuery));
} catch (BusinessException e) {
log.warn("最强帮扶-统计分析-管理区上报数量-查询失败:" + e.getMessage());
return warn(e.getMessage());
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
}
package com.qianhe.zqbf.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ChartBaseModel implements Serializable {
private static final long serialVersionUID = 1L;
// 图例
private List<Map<String, Object>> legendData;
// 参数单位
private List<String> dwData;
// X轴数据
private List<String> xAxisData;
// 数据集合
private List<Object> data;
// 其余参数
private Object others;
}
package com.qianhe.zqbf.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class GlqsbslVo implements Serializable {
private static final long serialVersionUID = 1L;
private Long dept_id;
private String dept_name;
/**
* 提报数量
*/
private Integer tbsl;
/**
* 已完成数量
*/
private Integer ywcsl;
}
package com.qianhe.zqbf.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqbfXmzBfxm implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 项目ID
*/
private Long xmid;
/**
* 上级ID
*/
private Long parent_id;
/**
* 祖级列表
*/
private String ancestors;
/**
* 项目名称
*/
private String xmmc;
/**
* 项目组别
*/
private String xmzb;
/**
* 项目类型:字典
*/
private String xmlx;
/**
* 排序
*/
private Integer order_num;
/**
* 一级单位名称
*/
private String level_1_org_name;
/**
* 二级单位名称
*/
private String level_2_org_name;
/**
* 三级单位名称
*/
private String level_3_org_name;
/**
* 四级单位名称
*/
private String level_4_org_name;
/**
* 五级单位名称
*/
private String level_5_org_name;
/**
* 创建者
*/
private String cjr;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date cjsj;
/**
* 修改人
*/
private String gxr;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date gxsj;
/**
* 备注
*/
private String bz;
/**
* 预留1
*/
private String yl1;
/**
* 预留2
*/
private String yl2;
/**
* 预留3
*/
private String yl3;
/**
* 预留4
*/
private String yl4;
/**
* 预留5
*/
private String yl5;
}
package com.qianhe.zqbf.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.io.Serializable;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqbfXmzBfxmQuery extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 项目名称
*/
private String xmmc;
/**
* 项目组别
*/
private String xmzb;
}
package com.qianhe.zqbf.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqbfXmzBfxmTree implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 项目ID
*/
private Long xmid;
/**
* 上级ID
*/
private Long parent_id;
/**
* 项目名称
*/
private String xmmc;
/**
* 项目类型:字典
*/
private String xmlx;
/**
* 排序
*/
private Integer order_num;
/**
* 是否有子叶
*/
private Boolean leaf;
/**
* 下层数据
*/
private List<ZqbfXmzBfxmTree> children;
}
package com.qianhe.zqbf.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqbfXmzBfxmVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 项目ID
*/
private Long xmid;
/**
* 上级ID
*/
private Long parent_id;
/**
* 祖级列表
*/
private String ancestors;
/**
* 项目名称
*/
private String xmmc;
/**
* 项目组别
*/
private String xmzb;
/**
* 项目类型:字典
*/
private String xmlx;
/**
* 排序
*/
private Integer order_num;
/**
* 一级单位名称
*/
private String level_1_org_name;
/**
* 二级单位名称
*/
private String level_2_org_name;
/**
* 三级单位名称
*/
private String level_3_org_name;
/**
* 四级单位名称
*/
private String level_4_org_name;
/**
* 五级单位名称
*/
private String level_5_org_name;
/**
* 创建者
*/
private String cjr;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date cjsj;
/**
* 修改人
*/
private String gxr;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date gxsj;
/**
* 备注
*/
private String bz;
/**
* 预留1
*/
private String yl1;
/**
* 预留2
*/
private String yl2;
/**
* 预留3
*/
private String yl3;
/**
* 预留4
*/
private String yl4;
/**
* 预留5
*/
private String yl5;
}
package com.qianhe.zqbf.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
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 ZqbfXmzBfxq implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 需求ID
*/
private Long xqid;
/**
* 基层单位ID
*/
private Long dwid;
/**
* 项目ID:zqbf_xmz_bfxm.id
*/
private Long xmid;
/**
* 帮扶开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date bfkssj;
/**
* 帮扶结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date bfjssj;
/**
* 联系人
*/
private String lxr;
/**
* 联系电话
*/
private String lxdh;
/**
* 当前状态,字典
*/
private String dqzt;
/**
* 需求描述
*/
private String xqms;
/**
* 回退描述
*/
private String htms;
/**
* 完成时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date wcsj;
/**
* 帮扶描述
*/
private String bfms;
/**
* 评价等级
*/
private String pjdj;
/**
* 评价描述
*/
private String pdms;
/**
* 创建者
*/
private String cjr;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date cjsj;
/**
* 修改人
*/
private String gxr;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date gxsj;
/**
* 备注
*/
private String bz;
/**
* 预留1
*/
private String yl1;
/**
* 预留2
*/
private String yl2;
/**
* 预留3
*/
private String yl3;
/**
* 预留4
*/
private String yl4;
/**
* 预留5
*/
private String yl5;
}
package com.qianhe.zqbf.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.io.Serializable;
import java.util.Date;
/**
* 最强帮扶 帮扶计划 Model
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqbfXmzBfxqQuery extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 需求ID
*/
private Long xqid;
/**
* 基层单位ID
*/
private Long dwid;
/**
* 专家ID
*/
private Long user_id;
/**
* 项目名称
*/
private String xmmc;
/**
* 当前状态,字典
*/
private String dqzt;
/**
* 开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date kssj;
/**
* 结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date jssj;
}
package com.qianhe.zqbf.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qianhe.common.annotation.Excel;
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 ZqbfXmzBfxqVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 需求ID
*/
private Long xqid;
/**
* 基层单位ID
*/
private Long dwid;
/**
* 单位名称
*/
@Excel(name = "单位名称")
private String dwmc;
/**
* 项目ID:zqbf_xmz_bfxm.id
*/
private Long xmid;
/**
* 项目名称
*/
@Excel(name = "项目名称")
private String xmmc;
/**
* 项目组别
*/
@Excel(name = "项目组别",dictType = "zqbf_xmz_zjzj",type = Excel.Type.EXPORT)
private String xmzb;
/**
* 需求描述
*/
@Excel(name = "需求描述")
private String xqms;
/**
* 当前状态,字典
*/
@Excel(name = "当前状态",dictType = "zqbf_xmz_dqzt",type = Excel.Type.EXPORT)
private String dqzt;
/**
* 帮扶时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "帮扶开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date bfkssj;
/**
* 帮扶时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "帮扶结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date bfjssj;
/**
* 联系人
*/
@Excel(name = "联系人")
private String lxr;
/**
* 联系电话
*/
@Excel(name = "联系电话")
private String lxdh;
}
package com.qianhe.zqbf.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqbfXmzBfzj implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 专家ID
*/
private Long zjid;
/**
* 绑定系统用户
*/
private Long user_id;
/**
* 单位ID
*/
private Long dwid;
/**
* 专家名称
*/
private String zjmc;
/**
* 专家职务
*/
private String zjzw;
/**
* 专家组级
*/
private String zjzj;
/**
* 手机号
*/
private String sjh;
/**
* 创建者
*/
private String cjr;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date cjsj;
/**
* 修改人
*/
private String gxr;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date gxsj;
/**
* 备注
*/
private String bz;
/**
* 预留1
*/
private String yl1;
/**
* 预留2
*/
private String yl2;
/**
* 预留3
*/
private String yl3;
/**
* 预留4
*/
private String yl4;
/**
* 预留5
*/
private String yl5;
}
package com.qianhe.zqbf.domain;
import com.qianhe.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqbfXmzBfzjQuery extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 专家ID
*/
private Long zjid;
/**
* 单位ID
*/
private Long dwid;
/**
* 专家名称
*/
private String zjmc;
}
package com.qianhe.zqbf.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qianhe.common.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqbfXmzBfzjVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 专家ID
*/
private Long zjid;
/**
* 单位ID
*/
private Long dwid;
/**
* 单位名称
*/
@Excel(name = "单位名称")
private String dwmc;
/**
* 专家名称
*/
@Excel(name = "专家名称")
private String zjmc;
/**
* 专家职务
*/
@Excel(name = "专家职务",dictType = "zqbf_xmz_zjzw",type = Excel.Type.EXPORT)
private String zjzw;
/**
* 专家组级
*/
@Excel(name = "专家组级",dictType = "zqbf_xmz_zjzj",type = Excel.Type.EXPORT)
private String zjzj;
/**
* 联系方式
*/
@Excel(name = "联系方式")
private String sjh;
/**
* 创建者
*/
private String cjr;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date cjsj;
/**
* 修改人
*/
private String gxr;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date gxsj;
/**
* 备注
*/
@Excel(name = "备注")
private String bz;
/**
* 预留1
*/
private String yl1;
/**
* 预留2
*/
private String yl2;
/**
* 预留3
*/
private String yl3;
/**
* 预留4
*/
private String yl4;
/**
* 预留5
*/
private String yl5;
}
package com.qianhe.zqbf.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;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqczTjfxQuery extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 井队
*/
private Long dwid;
/**
* 队号列表
*/
private List<Long> dhs;
/**
* 项目组别
*/
private String xmzb;
/**
* 开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date kssj;
/**
* 结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date jssj;
}
package com.qianhe.zqbf.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqczXmzApproval implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 需求ID
*/
private Long xqid;
/**
* 当前状态 5=已驳回 6=已审核(帮扶中)
*/
private String dqzt;
/**
* 回退描述
*/
private String htms;
}
package com.qianhe.zqbf.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqczXmzBffk implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 记录ID
*/
private Long fkid;
/**
* 需求ID
*/
private Long xqid;
/**
* 您所在的岗位/工种
*/
private String gw;
/**
* 您对本次专家指导帮扶的整体满意度
*/
private String myd;
/**
* 专家指导对您解决实际工作难题的帮助程度
*/
private String bzcd;
/**
* 专家的指导方式是否清晰易懂、便于学习?
*/
private String zdfs;
/**
* 通过专家帮扶,您认为自己哪方面提升最明显?(可多选)
*/
private String bfts;
/**
* 您认为本次专家指导的时长
*/
private String zdsc;
/**
* 您对今后的专家指导帮扶活动有哪些具体建议?
*/
private String jtjy;
/**
* 修改人
*/
private String gxr;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date gxsj;
/**
* 备注
*/
private String bz;
}
package com.qianhe.zqbf.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqczXmzBfjl implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 记录ID
*/
private Long jlid;
/**
* 需求ID
*/
private Long xqid;
/**
* 当前状态,字典
*/
private String dqzt;
/**
* 修改人
*/
private String gxr;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date gxsj;
/**
* 备注
*/
private String bz;
}
package com.qianhe.zqbf.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqczXmzBfjlQuery implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 需求ID
*/
private Long xqid;
/**
* 当前状态,字典
*/
private String dqzt;
}
package com.qianhe.zqbf.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqczXmzBfpz implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 凭证ID
*/
private Long pzid;
/**
* 需求ID
*/
private Long xqid;
/**
* 文件名称
*/
private String wjmc;
/**
* 文件路径
*/
private String wjlj;
/**
* 修改人
*/
private String gxr;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date gxsj;
}
package com.qianhe.zqbf.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqczXmzDdzj implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 调度ID
*/
private Long ddid;
/**
* 需求ID
*/
private Long xqid;
/**
* 专家ID
*/
private Long ddzj;
/**
* 负责人 1=是 2=否
*/
private String fzr;
}
package com.qianhe.zqbf.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqczXmzZjpj implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 需求ID
*/
private Long xqid;
/**
* 帮扶描述
*/
private String bfms;
/**
* 帮扶凭证
*/
private List<ZqczXmzBfpz> dataList;
}
package com.qianhe.zqbf.mapper;
import com.qianhe.zqbf.domain.ZqbfXmzBfxm;
import com.qianhe.zqbf.domain.ZqbfXmzBfxmQuery;
import com.qianhe.zqbf.domain.ZqbfXmzBfxmVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface ZqbfXmzBfxmMapper {
/**
* 条件查询
*/
List<ZqbfXmzBfxmVo> list(ZqbfXmzBfxmQuery zqbfXmzBfxmQuery);
/**
* 查询详情
*/
ZqbfXmzBfxmVo info(Long id);
/**
* 新增
*/
int add(ZqbfXmzBfxm zqbfXmzBfxm);
/**
* 修改
*/
int edit(ZqbfXmzBfxm zqbfXmzBfxm);
/**
* 删除
*/
int delete(Long[] ids);
}
package com.qianhe.zqbf.mapper;
import com.qianhe.zqbf.domain.ZqbfXmzBfxq;
import com.qianhe.zqbf.domain.ZqbfXmzBfxqQuery;
import com.qianhe.zqbf.domain.ZqbfXmzBfxqVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface ZqbfXmzBfxqMapper {
/**
* 条件查询
*/
List<ZqbfXmzBfxqVo> list(ZqbfXmzBfxqQuery zqbfXmzBfxqQuery);
/**
* 查询详情
*/
ZqbfXmzBfxqVo info(Long id);
/**
* 新增
*/
Long add(ZqbfXmzBfxq zqbfXmzBfxq);
/**
* 修改
*/
int edit(ZqbfXmzBfxq zqbfXmzBfxq);
/**
* 删除
*/
int delete(Long[] ids);
}
package com.qianhe.zqbf.mapper;
import com.qianhe.common.annotation.DataScope;
import com.qianhe.zqbf.domain.ZqbfXmzBfzj;
import com.qianhe.zqbf.domain.ZqbfXmzBfzjQuery;
import com.qianhe.zqbf.domain.ZqbfXmzBfzjVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface ZqbfXmzBfzjMapper {
/**
* 条件查询
*/
@DataScope(deptAlias = "dept")
List<ZqbfXmzBfzjVo> list(ZqbfXmzBfzjQuery zqbfXmzBfzjQuery);
/**
* 查询详情
*/
ZqbfXmzBfzjVo info(Long id);
/**
* 新增
*/
int add(ZqbfXmzBfzj zqbfXmzBfzj);
/**
* 修改
*/
int edit(ZqbfXmzBfzj zqbfXmzBfzj);
/**
* 删除
*/
int delete(Long[] ids);
}
package com.qianhe.zqbf.mapper;
import com.qianhe.zqbf.domain.GlqsbslVo;
import com.qianhe.zqbf.domain.ZqczTjfxQuery;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
public interface ZqbfXmzTjfxMapper {
/**
* 管理区上报数量
*/
List<GlqsbslVo> glqsbsl(ZqczTjfxQuery zqczTjfxQuery);
}
package com.qianhe.zqbf.mapper;
import com.qianhe.zqbf.domain.ZqczXmzBffk;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ZqczXmzBffkMapper {
/**
* 查询详情
*/
ZqczXmzBffk info(Long id);
/**
* 新增
*/
int add(ZqczXmzBffk zqczXmzBffk);
}
package com.qianhe.zqbf.mapper;
import com.qianhe.zqbf.domain.ZqczXmzBfjl;
import com.qianhe.zqbf.domain.ZqczXmzBfjlQuery;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface ZqczXmzBfjlMapper {
/**
* 条件查询
*/
List<ZqczXmzBfjl> list(ZqczXmzBfjlQuery zqczXmzBfjlQuery);
/**
* 新增
*/
int add(ZqczXmzBfjl zqczXmzBfjl);
/**
* 删除
*/
int delete(Long id);
}
package com.qianhe.zqbf.mapper;
import com.qianhe.zqbf.domain.ZqczXmzBfpz;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface ZqczXmzBfpzMapper {
/**
* 条件查询
*/
List<ZqczXmzBfpz> list(ZqczXmzBfpz zqczXmzBfpz);
/**
* 新增
*/
int batchAdd(@Param("dataList") List<ZqczXmzBfpz> dataList);
/**
* 删除
*/
int delete(Long id);
}
package com.qianhe.zqbf.mapper;
import com.qianhe.zqbf.domain.ZqczXmzDdzj;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface ZqczXmzDdzjMapper {
/**
* 条件查询
*/
List<ZqczXmzDdzj> list(ZqczXmzDdzj zqczXmzDdzj);
/**
* 新增
*/
int batchAdd(@Param("dataList") List<ZqczXmzDdzj> dataList);
/**
* 删除
*/
int delete(Long id);
}
package com.qianhe.zqbf.service;
import com.qianhe.zqbf.domain.ZqbfXmzBfxm;
import com.qianhe.zqbf.domain.ZqbfXmzBfxmQuery;
import com.qianhe.zqbf.domain.ZqbfXmzBfxmVo;
import java.util.List;
public interface ZqbfXmzBfxmService {
/**
* 条件查询
*/
List<ZqbfXmzBfxmVo> list(ZqbfXmzBfxmQuery zqbfXmzBfxmQuery);
/**
* 查询详情
*/
ZqbfXmzBfxmVo info(Long id);
/**
* 新增
*/
int add(ZqbfXmzBfxm zqbfXmzBfxm, String username);
/**
* 修改
*/
int edit(ZqbfXmzBfxm zqbfXmzBfxm, String username);
/**
* 删除
*/
int delete(Long[] ids);
}
package com.qianhe.zqbf.service;
import com.qianhe.common.core.page.TableDataInfo;
import com.qianhe.zqbf.domain.*;
import java.util.List;
public interface ZqbfXmzBfxqService {
/**
* 分页查询
*/
List<ZqbfXmzBfxqVo> list(ZqbfXmzBfxqQuery zqbfXmzBfxqQuery);
/**
* 查询详情
*/
ZqbfXmzBfxqVo info(Long id);
/**
* 新增
*/
int add(ZqbfXmzBfxq zqbfXmzBfxq, String username);
/**
* 修改
*/
int edit(ZqbfXmzBfxq zqbfXmzBfxq, String username);
/**
* 删除
*/
int delete(Long[] ids);
/**
* 提报需求
*/
int sub(ZqbfXmzBfxq zqbfXmzBfxq, String username);
/**
* 撤销需求
*/
int revoke(ZqbfXmzBfxq zqbfXmzBfxq, String username);
/**
* 调度专家
*/
int dispatch(List<ZqczXmzDdzj> zqczXmzDdzjList, String username);
/**
* 领导审核
*/
int approval(ZqczXmzApproval zqczXmzApproval, String username);
/**
* 专家反馈
*/
int feedback(ZqczXmzZjpj zqczXmzZjpj, String username);
/**
* 帮扶反馈
*/
int support(ZqczXmzBffk zqczXmzBffk, String username);
}
package com.qianhe.zqbf.service;
import com.qianhe.zqbf.domain.ZqbfXmzBfzj;
import com.qianhe.zqbf.domain.ZqbfXmzBfzjQuery;
import com.qianhe.zqbf.domain.ZqbfXmzBfzjVo;
import java.util.List;
public interface ZqbfXmzBfzjService {
/**
* 条件查询
*/
List<ZqbfXmzBfzjVo> list(ZqbfXmzBfzjQuery zqbfXmzBfzjQuery);
/**
* 查询详情
*/
ZqbfXmzBfzjVo info(Long id);
/**
* 新增
*/
int add(ZqbfXmzBfzj zqbfXmzBfzj, String username);
/**
* 修改
*/
int edit(ZqbfXmzBfzj zqbfXmzBfzj, String username);
/**
* 删除
*/
int delete(Long[] ids);
}
package com.qianhe.zqbf.service;
import com.qianhe.zqbf.domain.ChartBaseModel;
import com.qianhe.zqbf.domain.ZqczTjfxQuery;
public interface ZqbfXmzTjfxService {
/**
* 管理区上报数量
*/
ChartBaseModel glqsbsl(ZqczTjfxQuery zqczTjfxQuery);
}
package com.qianhe.zqbf.service.impl;
import com.qianhe.zqbf.domain.ZqbfXmzBfxm;
import com.qianhe.zqbf.domain.ZqbfXmzBfxmQuery;
import com.qianhe.zqbf.domain.ZqbfXmzBfxmVo;
import com.qianhe.zqbf.mapper.ZqbfXmzBfxmMapper;
import com.qianhe.zqbf.service.ZqbfXmzBfxmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class ZqbfXmzBfxmServiceImpl implements ZqbfXmzBfxmService {
@Autowired
private ZqbfXmzBfxmMapper zqbfXmzBfxmMapper;
/**
* 条件查询
*/
@Override
public List<ZqbfXmzBfxmVo> list(ZqbfXmzBfxmQuery zqbfXmzBfxmQuery) {
List<ZqbfXmzBfxmVo> dataList = zqbfXmzBfxmMapper.list(zqbfXmzBfxmQuery);
return dataList;
}
/**
* 查询详情
*/
@Override
public ZqbfXmzBfxmVo info(Long id) {
ZqbfXmzBfxmVo info = zqbfXmzBfxmMapper.info(id);
return info;
}
/**
* 新增
*/
@Override
public int add(ZqbfXmzBfxm zqbfXmzBfxm, String username) {
zqbfXmzBfxm.setCjr(username);
zqbfXmzBfxm.setGxr(username);
zqbfXmzBfxm.setCjsj(new Date());
return zqbfXmzBfxmMapper.add(zqbfXmzBfxm);
}
/**
* 修改
*/
@Override
public int edit(ZqbfXmzBfxm zqbfXmzBfxm, String username) {
zqbfXmzBfxm.setGxr(username);
return zqbfXmzBfxmMapper.edit(zqbfXmzBfxm);
}
/**
* 删除
*/
@Override
public int delete(Long[] ids) {
return zqbfXmzBfxmMapper.delete(ids);
}
}
package com.qianhe.zqbf.service.impl;
import com.github.pagehelper.PageInfo;
import com.qianhe.common.annotation.DataScope;
import com.qianhe.common.core.domain.entity.SysRole;
import com.qianhe.common.core.page.TableDataInfo;
import com.qianhe.common.exception.BusinessException;
import com.qianhe.common.utils.SecurityUtils;
import com.qianhe.common.utils.StringUtils;
import com.qianhe.zqbf.domain.*;
import com.qianhe.zqbf.mapper.*;
import com.qianhe.zqbf.service.ZqbfXmzBfxqService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.qianhe.common.constant.MtConstant;
import java.util.*;
import static com.qianhe.common.utils.PageUtils.startPage;
@Service
public class ZqbfXmzBfxqServiceImpl implements ZqbfXmzBfxqService {
@Autowired
private ZqbfXmzBfxqMapper zqbfXmzBfxqMapper;
@Autowired
private ZqczXmzBfjlMapper zqczXmzBfjlMapper;
@Autowired
private ZqczXmzDdzjMapper zqczXmzDdzjMapper;
@Autowired
private ZqczXmzBfpzMapper zqczXmzBfpzMapper;
@Autowired
private ZqczXmzBffkMapper zqczXmzBffkMapper;
/**
* 分页查询
* 项目组权限(查询提报的所有数据)
* 项目组权限(查询提报的所有数据)
* 项目组专家(只查询分配给自己的数据)
* 基层单位(查询本部门以及一下数据)
*/
@Override
@DataScope(deptAlias = "dept", userAlias = "bfzj")
public List<ZqbfXmzBfxqVo> list(ZqbfXmzBfxqQuery zqbfXmzBfxqQuery) {
if (SecurityUtils.hasPermi(MtConstant.SGZQ_XMZ) || SecurityUtils.hasPermi(MtConstant.SGZQ_XMZ_LD)) {
zqbfXmzBfxqQuery.setDqzt("3");
}
List<ZqbfXmzBfxqVo> dataList = zqbfXmzBfxqMapper.list(zqbfXmzBfxqQuery);
return dataList;
}
/**
* 查询详情
*/
@Override
public ZqbfXmzBfxqVo info(Long id) {
ZqbfXmzBfxqVo info = zqbfXmzBfxqMapper.info(id);
return info;
}
/**
* 新增
*/
@Transactional
@Override
public int add(ZqbfXmzBfxq zqbfXmzBfxq, String username) {
// 新增帮扶需求
zqbfXmzBfxq.setDqzt("1");
zqbfXmzBfxq.setGxr(username);
zqbfXmzBfxq.setCjr(username);
zqbfXmzBfxq.setCjsj(new Date());
Long xqid = zqbfXmzBfxqMapper.add(zqbfXmzBfxq);
// 新增帮扶记录
ZqczXmzBfjl zqczXmzBfjl = new ZqczXmzBfjl();
zqczXmzBfjl.setXqid(xqid);
zqczXmzBfjl.setDqzt("1");
zqczXmzBfjl.setGxr(username);
zqczXmzBfjlMapper.add(zqczXmzBfjl);
return 1;
}
/**
* 修改
*/
@Override
public int edit(ZqbfXmzBfxq zqbfXmzBfxq, String username) {
zqbfXmzBfxq.setGxr(username);
return zqbfXmzBfxqMapper.edit(zqbfXmzBfxq);
}
/**
* 删除
*/
@Override
public int delete(Long[] ids) {
return zqbfXmzBfxqMapper.delete(ids);
}
/**
* 提报需求
*/
@Transactional
@Override
public int sub(ZqbfXmzBfxq zqbfXmzBfxq, String username) {
Long xqid = zqbfXmzBfxq.getXqid();
// 查询当前需求
ZqbfXmzBfxqVo zqbfXmzBfxqVo = info(xqid);
if (zqbfXmzBfxqVo == null) {
throw new BusinessException("暂无当前需求");
}
if (!Arrays.asList("1", "2").contains(zqbfXmzBfxqVo.getDqzt())) { // 如果当前需求不是待提交与撤销则不允许提交
throw new BusinessException("当前环节不允许提交");
}
// 修改需求
zqbfXmzBfxq.setDqzt("3");
edit(zqbfXmzBfxq, username);
// 新增帮扶记录
ZqczXmzBfjl zqczXmzBfjl = new ZqczXmzBfjl();
zqczXmzBfjl.setXqid(xqid);
zqczXmzBfjl.setDqzt("3");
zqczXmzBfjl.setGxr(username);
zqczXmzBfjlMapper.add(zqczXmzBfjl);
return 1;
}
/**
* 撤销需求
*/
@Transactional
@Override
public int revoke(ZqbfXmzBfxq zqbfXmzBfxq, String username) {
Long xqid = zqbfXmzBfxq.getXqid();
String htms = zqbfXmzBfxq.getHtms();
// 查询当前需求
ZqbfXmzBfxqVo zqbfXmzBfxqVo = info(xqid);
if (zqbfXmzBfxqVo == null) {
throw new BusinessException("暂无当前需求");
}
if (!"3".equals(zqbfXmzBfxqVo.getDqzt())) { // 如果当前需求不是待提交与撤销则不允许提交
throw new BusinessException("当前环节不允许提交");
}
if (StringUtils.isEmpty(htms)) {
throw new BusinessException("撤销描述不能为空");
}
// 修改需求
zqbfXmzBfxq.setDqzt("2");
edit(zqbfXmzBfxq, username);
// 新增帮扶记录
ZqczXmzBfjl zqczXmzBfjl = new ZqczXmzBfjl();
zqczXmzBfjl.setXqid(xqid);
zqczXmzBfjl.setDqzt("2");
zqczXmzBfjl.setGxr(username);
zqczXmzBfjl.setBz(htms);
zqczXmzBfjlMapper.add(zqczXmzBfjl);
return 1;
}
/**
* 调度专家
*/
@Transactional
@Override
public int dispatch(List<ZqczXmzDdzj> zqczXmzDdzjList, String username) {
if (Optional.ofNullable(zqczXmzDdzjList).orElse(Collections.emptyList()).isEmpty()) {
throw new BusinessException("专家列表不能为空");
}
// 删除之前的专家信息
ZqczXmzDdzj zqczXmzDdzj = zqczXmzDdzjList.get(0);
Long xqid = zqczXmzDdzj.getXqid();
ZqbfXmzBfxqVo zqbfXmzBfxqVo = info(xqid);
if (zqbfXmzBfxqVo == null) {
throw new BusinessException("暂无当前需求");
}
zqczXmzDdzjMapper.delete(xqid);
// 重新添加专家信息
zqczXmzDdzjMapper.batchAdd(zqczXmzDdzjList);
// 修改需求
ZqbfXmzBfxq zqbfXmzBfxq = new ZqbfXmzBfxq();
zqbfXmzBfxq.setXqid(xqid);
zqbfXmzBfxq.setDqzt("4");
edit(zqbfXmzBfxq, username);
// 新增帮扶记录
ZqczXmzBfjl zqczXmzBfjl = new ZqczXmzBfjl();
zqczXmzBfjl.setXqid(xqid);
zqczXmzBfjl.setDqzt("4");
zqczXmzBfjl.setGxr(username);
zqczXmzBfjlMapper.add(zqczXmzBfjl);
return 1;
}
/**
* 领导审核
*/
@Transactional
@Override
public int approval(ZqczXmzApproval zqczXmzApproval, String username) {
Long xqid = zqczXmzApproval.getXqid();
String dqzt = zqczXmzApproval.getDqzt();
String htms = zqczXmzApproval.getHtms();
ZqbfXmzBfxqVo zqbfXmzBfxqVo = info(xqid);
if (zqbfXmzBfxqVo == null) {
throw new BusinessException("暂无当前需求");
}
if (!Arrays.asList("5", "6").contains(dqzt)) { // 审核状态
throw new BusinessException("无效审核:5=已驳回6=已审核(帮扶中)");
}
if ("5".equals(dqzt) && StringUtils.isEmpty(htms)) {
throw new BusinessException("回退原因不能为空");
}
// 修改需求
ZqbfXmzBfxq zqbfXmzBfxq = new ZqbfXmzBfxq();
zqbfXmzBfxq.setXqid(xqid);
zqbfXmzBfxq.setDqzt(dqzt);
edit(zqbfXmzBfxq, username);
// 新增帮扶记录
ZqczXmzBfjl zqczXmzBfjl = new ZqczXmzBfjl();
zqczXmzBfjl.setXqid(xqid);
zqczXmzBfjl.setDqzt(dqzt);
zqczXmzBfjl.setGxr(username);
zqczXmzBfjl.setBz(htms);
zqczXmzBfjlMapper.add(zqczXmzBfjl);
return 1;
}
/**
* 专家反馈
*/
@Transactional
@Override
public int feedback(ZqczXmzZjpj zqczXmzZjpj, String username) {
Long xqid = zqczXmzZjpj.getXqid(); // 需求ID
String bfms = zqczXmzZjpj.getBfms(); // 帮扶描述
List<ZqczXmzBfpz> dataList = zqczXmzZjpj.getDataList(); // 帮扶凭证
ZqbfXmzBfxqVo zqbfXmzBfxqVo = info(xqid);
if (zqbfXmzBfxqVo == null) {
throw new BusinessException("暂无当前需求");
}
if (Optional.ofNullable(dataList).orElse(Collections.emptyList()).isEmpty()) {
throw new BusinessException("帮扶凭证不能为空");
}
// 修改需求
ZqbfXmzBfxq zqbfXmzBfxq = new ZqbfXmzBfxq();
zqbfXmzBfxq.setXqid(xqid);
zqbfXmzBfxq.setDqzt("7");
zqbfXmzBfxq.setBfms(bfms);
zqbfXmzBfxq.setWcsj(new Date());
edit(zqbfXmzBfxq, username);
// 新增帮扶记录
ZqczXmzBfjl zqczXmzBfjl = new ZqczXmzBfjl();
zqczXmzBfjl.setXqid(xqid);
zqczXmzBfjl.setDqzt("7");
zqczXmzBfjl.setGxr(username);
zqczXmzBfjlMapper.add(zqczXmzBfjl);
// 保存帮扶凭证
for (ZqczXmzBfpz zqczXmzBfpz : dataList) {
zqczXmzBfpz.setXqid(xqid);
zqczXmzBfpz.setGxr(username);
}
zqczXmzBfpzMapper.batchAdd(dataList);
return 1;
}
/**
* 帮扶反馈
*/
@Override
public int support(ZqczXmzBffk zqczXmzBffk, String username) {
Long xqid = zqczXmzBffk.getXqid();
// 修改需求
ZqbfXmzBfxq zqbfXmzBfxq = new ZqbfXmzBfxq();
zqbfXmzBfxq.setXqid(xqid);
zqbfXmzBfxq.setDqzt("8");
zqbfXmzBfxq.setWcsj(new Date());
edit(zqbfXmzBfxq, username);
// 新增帮扶记录
ZqczXmzBfjl zqczXmzBfjl = new ZqczXmzBfjl();
zqczXmzBfjl.setXqid(xqid);
zqczXmzBfjl.setDqzt("8");
zqczXmzBfjl.setGxr(username);
zqczXmzBfjlMapper.add(zqczXmzBfjl);
// 新增反馈
zqczXmzBffk.setGxr(username);
zqczXmzBffkMapper.add(zqczXmzBffk);
return 1;
}
}
package com.qianhe.zqbf.service.impl;
import com.qianhe.zqbf.domain.ZqbfXmzBfzj;
import com.qianhe.zqbf.domain.ZqbfXmzBfzjQuery;
import com.qianhe.zqbf.domain.ZqbfXmzBfzjVo;
import com.qianhe.zqbf.mapper.ZqbfXmzBfzjMapper;
import com.qianhe.zqbf.service.ZqbfXmzBfzjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class ZqbfXmzBfzjServiceImpl implements ZqbfXmzBfzjService {
@Autowired
private ZqbfXmzBfzjMapper zqbfXmzBfzjMapper;
/**
* 条件查询
*/
@Override
public List<ZqbfXmzBfzjVo> list(ZqbfXmzBfzjQuery zqbfXmzBfzjQuery) {
List<ZqbfXmzBfzjVo> dataList = zqbfXmzBfzjMapper.list(zqbfXmzBfzjQuery);
return dataList;
}
/**
* 查询详情
*/
@Override
public ZqbfXmzBfzjVo info(Long id) {
ZqbfXmzBfzjVo info = zqbfXmzBfzjMapper.info(id);
return info;
}
/**
* 新增
*/
@Override
public int add(ZqbfXmzBfzj zqbfXmzBfzj, String username) {
zqbfXmzBfzj.setCjr(username);
zqbfXmzBfzj.setGxr(username);
zqbfXmzBfzj.setCjsj(new Date());
return zqbfXmzBfzjMapper.add(zqbfXmzBfzj);
}
/**
* 修改
*/
@Override
public int edit(ZqbfXmzBfzj zqbfXmzBfzj, String username) {
zqbfXmzBfzj.setGxr(username);
return zqbfXmzBfzjMapper.edit(zqbfXmzBfzj);
}
/**
* 删除
*/
@Override
public int delete(Long[] ids) {
return zqbfXmzBfzjMapper.delete(ids);
}
}
package com.qianhe.zqbf.service.impl;
import com.qianhe.common.core.domain.entity.SysDept;
import com.qianhe.common.utils.MtTreeUtils;
import com.qianhe.system.service.ISysDeptService;
import com.qianhe.zqbf.domain.ChartBaseModel;
import com.qianhe.zqbf.domain.GlqsbslVo;
import com.qianhe.zqbf.domain.ZqczTjfxQuery;
import com.qianhe.zqbf.mapper.ZqbfXmzTjfxMapper;
import com.qianhe.zqbf.service.ZqbfXmzTjfxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class ZqbfXmzTjfxServiceImpl implements ZqbfXmzTjfxService {
@Autowired
private ISysDeptService deptService;
@Autowired
private ZqbfXmzTjfxMapper xmzTjfxMapper;
/**
* 管理区上报数量
*/
@Override
public ChartBaseModel glqsbsl(ZqczTjfxQuery zqczTjfxQuery) {
// 数据查询
List<GlqsbslVo> dataList = xmzTjfxMapper.glqsbsl(zqczTjfxQuery);
// 数据转换
ChartBaseModel chartModel = convertToChartBaseModel(dataList);
return chartModel;
}
/**
* 将 GlqsbslVo 列表转换为 ChartBaseModel
* @param voList 原始数据列表
* @return ChartBaseModel 对象
*/
public static ChartBaseModel convertToChartBaseModel(List<GlqsbslVo> voList) {
if (voList == null || voList.isEmpty()) {
return ChartBaseModel.builder()
.legendData(new ArrayList<>())
.dwData(new ArrayList<>())
.xAxisData(new ArrayList<>())
.data(new ArrayList<>())
.others(null)
.build();
}
// X轴数据:部门名称
List<String> xAxisData = voList.stream()
.map(GlqsbslVo::getDept_name)
.collect(Collectors.toList());
// 构建图例数据
List<Map<String, Object>> legendData = buildLegendData();
// 构建数据集合(包含提报数量和已完成数量)
List<Object> data = buildDataSeries(voList);
// 参数单位
List<String> dwData = Arrays.asList("个", "个");
return ChartBaseModel.builder()
.legendData(legendData)
.dwData(dwData)
.xAxisData(xAxisData)
.data(data)
.build();
}
/**
* 构建图例数据
*/
private static List<Map<String, Object>> buildLegendData() {
List<Map<String, Object>> legendList = new ArrayList<>();
Map<String, Object> legend1 = new HashMap<>();
legend1.put("name", "提报数量");
legend1.put("type", "bar");
legendList.add(legend1);
Map<String, Object> legend2 = new HashMap<>();
legend2.put("name", "已完成数量");
legend2.put("type", "line");
legendList.add(legend2);
return legendList;
}
/**
* 构建数据系列
*/
private static List<Object> buildDataSeries(List<GlqsbslVo> voList) {
List<Object> seriesList = new ArrayList<>();
// 提报数量系列
Map<String, Object> tbslSeries = new HashMap<>();
tbslSeries.put("name", "提报数量");
tbslSeries.put("type", "bar");
tbslSeries.put("data", voList.stream()
.map(GlqsbslVo::getTbsl)
.collect(Collectors.toList()));
seriesList.add(tbslSeries);
// 已完成数量系列
Map<String, Object> ywcslSeries = new HashMap<>();
ywcslSeries.put("name", "已完成数量");
ywcslSeries.put("type", "line");
ywcslSeries.put("data", voList.stream()
.map(GlqsbslVo::getYwcsl)
.collect(Collectors.toList()));
seriesList.add(ywcslSeries);
return seriesList;
}
}
<?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.zqbf.mapper.ZqbfXmzBfxmMapper">
<!-- 返回实体 -->
<resultMap id="ZqbfXmzBfxmResult" type="ZqbfXmzBfxmVo">
<result property="xmid" column="xmid"/>
<result property="parent_id" column="parent_id"/>
<result property="ancestors" column="ancestors"/>
<result property="xmmc" column="xmmc"/>
<result property="xmzb" column="xmzb"/>
<result property="xmlx" column="xmlx"/>
<result property="order_num" column="order_num"/>
<result property="level_1_org_name" column="level_1_org_name"/>
<result property="level_2_org_name" column="level_2_org_name"/>
<result property="level_3_org_name" column="level_3_org_name"/>
<result property="level_4_org_name" column="level_4_org_name"/>
<result property="level_5_org_name" column="level_5_org_name"/>
<result property="cjr" column="cjr"/>
<result property="cjsj" column="cjsj"/>
<result property="gxr" column="gxr"/>
<result property="gxsj" column="gxsj"/>
<result property="bz" column="bz"/>
<result property="yl1" column="yl1"/>
<result property="yl2" column="yl2"/>
<result property="yl3" column="yl3"/>
<result property="yl4" column="yl4"/>
<result property="yl5" column="yl5"/>
</resultMap>
<!-- 通用查询 -->
<sql id="selectCommon">
SELECT xmid, parent_id, ancestors, xmmc, xmzb, xmlx, order_num, level_1_org_name, level_2_org_name, level_3_org_name, level_4_org_name, level_5_org_name, cjr, cjsj, gxr, gxsj, bz, yl1, yl2, yl3, yl4, yl5 from zqbf_xmz_bfxm
</sql>
<!-- 条件查询 -->
<select id="list" parameterType="ZqbfXmzBfxmQuery" resultMap="ZqbfXmzBfxmResult">
<include refid="selectCommon"></include>
<where>
<if test="xmmc != null and xmmc !='' ">AND xmmc like concat('%', #{xmmc}, '%')</if>
<if test="xmzb != null and xmzb !='' ">AND xmzb =#{xmzb}</if>
</where>
ORDER BY xmzb, gxsj DESC
</select>
<!-- 查询详情 -->
<select id="info" parameterType="long" resultMap="ZqbfXmzBfxmResult">
<include refid="selectCommon"></include> WHERE xmid = #{id}
</select>
<!-- 新增 -->
<insert id="add" parameterType="ZqbfXmzBfxm">
INSERT INTO zqbf_xmz_bfxm
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parent_id != null">parent_id,</if>
<if test="ancestors != null and ancestors != ''">ancestors,</if>
<if test="xmmc != null and xmmc != ''">xmmc,</if>
<if test="xmzb != null and xmzb != ''">xmzb,</if>
<if test="xmlx != null and xmlx != ''">xmlx,</if>
<if test="order_num != null">order_num,</if>
<if test="level_1_org_name != null and level_1_org_name != ''">level_1_org_name,</if>
<if test="level_2_org_name != null and level_2_org_name != ''">level_2_org_name,</if>
<if test="level_3_org_name != null and level_3_org_name != ''">level_3_org_name,</if>
<if test="level_4_org_name != null and level_4_org_name != ''">level_4_org_name,</if>
<if test="level_5_org_name != null and level_5_org_name != ''">level_5_org_name,</if>
<if test="cjr != null and cjr != ''">cjr,</if>
<if test="cjsj != null">cjsj,</if>
<if test="gxr != null and gxr != ''">gxr,</if>
<if test="bz != null and bz != ''">bz,</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>
gxsj
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parent_id != null">#{parent_id},</if>
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
<if test="xmmc != null and xmmc != ''">#{xmmc},</if>
<if test="xmzb != null and xmzb != ''">#{xmzb},</if>
<if test="xmlx != null and xmlx != ''">#{xmlx},</if>
<if test="order_num != null">#{order_num},</if>
<if test="level_1_org_name != null and level_1_org_name != ''">#{level_1_org_name},</if>
<if test="level_2_org_name != null and level_2_org_name != ''">#{level_2_org_name},</if>
<if test="level_3_org_name != null and level_3_org_name != ''">#{level_3_org_name},</if>
<if test="level_4_org_name != null and level_4_org_name != ''">#{level_4_org_name},</if>
<if test="level_5_org_name != null and level_5_org_name != ''">#{level_5_org_name},</if>
<if test="cjr != null and cjr != ''">#{cjr},</if>
<if test="cjsj != null">#{cjsj},</if>
<if test="gxr != null and gxr != ''">#{gxr},</if>
<if test="bz != null and bz != ''">#{bz},</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>
now()
</trim>
</insert>
<!-- 修改 -->
<update id="edit" parameterType="ZqbfXmzBfxm">
UPDATE zqbf_xmz_bfxm
<trim prefix="SET" suffixOverrides=",">
<if test="parent_id != null">parent_id = #{parent_id},</if>
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
<if test="xmmc != null and xmmc != ''">xmmc = #{xmmc},</if>
<if test="xmzb != null and xmzb != ''">xmzb = #{xmzb},</if>
<if test="xmlx != null and xmlx != ''">xmlx = #{xmlx},</if>
<if test="order_num != null">order_num = #{order_num},</if>
<if test="level_1_org_name != null and level_1_org_name != ''">level_1_org_name = #{level_1_org_name},</if>
<if test="level_2_org_name != null and level_2_org_name != ''">level_2_org_name = #{level_2_org_name},</if>
<if test="level_3_org_name != null and level_3_org_name != ''">level_3_org_name = #{level_3_org_name},</if>
<if test="level_4_org_name != null and level_4_org_name != ''">level_4_org_name = #{level_4_org_name},</if>
<if test="level_5_org_name != null and level_5_org_name != ''">level_5_org_name = #{level_5_org_name},</if>
<if test="cjr != null and cjr != ''">cjr = #{cjr},</if>
<if test="cjsj != null">cjsj = #{cjsj},</if>
<if test="gxr != null and gxr != ''">gxr = #{gxr},</if>
<if test="bz != null">bz = #{bz},</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>
gxsj = now()
</trim>
WHERE xmid = #{xmid}
</update>
<!-- 删除 -->
<delete id="delete" parameterType="long">
DELETE FROM zqbf_xmz_bfxm WHERE BBM IN
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?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.zqbf.mapper.ZqbfXmzBfxqMapper">
<!-- 返回实体 -->
<resultMap id="ZqbfXmzBfxqResult" type="ZqbfXmzBfxqVo">
<result property="xqid" column="xqid"/>
<result property="dwid" column="dwid"/>
<result property="dwmc" column="dwmc"/>
<result property="xmid" column="xmid"/>
<result property="xmmc" column="xmmc"/>
<result property="xmzb" column="xmzb"/>
<result property="xqms" column="xqms"/>
<result property="dqzt" column="dqzt"/>
<result property="bfkssj" column="bfkssj"/>
<result property="bfjssj" column="bfjssj"/>
<result property="lxr" column="lxr"/>
<result property="lxdh" column="lxdh"/>
</resultMap>
<!-- 通用查询 -->
<sql id="selectCommon">
SELECT
bfxq.xqid,
bfxq.dwid,
CONCAT( dept.dept_name, dept.create_by ) AS dwmc,
bfxq.xmid,
bfxm.xmmc,
bfxm.xmzb,
bfxq.xqms,
bfxq.dqzt,
bfxq.bfkssj,
bfxq.bfjssj,
bfxq.lxr,
bfxq.lxdh
FROM
zqbf_xmz_bfxq bfxq
LEFT JOIN sys_dept dept ON bfxq.dwid = dept.dept_id
LEFT JOIN zqbf_xmz_bfxm bfxm ON bfxq.xmid = bfxm.xmid
LEFT JOIN zqcz_xmz_ddzj ddzj ON bfxq.xqid = ddzj.xqid
LEFT JOIN zqbf_xmz_bfzj bfzj ON ddzj.ddzj = bfzj.zjid
</sql>
<!-- 条件查询 -->
<select id="list" parameterType="ZqbfXmzBfxqQuery" resultMap="ZqbfXmzBfxqResult">
<include refid="selectCommon"></include>
<where>
<if test="xqid != null ">AND bfxq.xqid = #{xqid}</if>
<if test="user_id != null ">AND ddzj.user_id = #{user_id}</if>
<if test="dwid != null ">AND (dept.dept_id = #{dwid} OR FIND_IN_SET(#{dwid}, dept.ancestors))</if>
<if test="xmmc != null and xmmc != ''">AND bfxm.xmmc like concat('%', #{xmmc}, '%')</if>
<if test="dqzt != null and dqzt != ''">AND bfxq.dqzt &gt;= #{dqzt}</if>
<if test="kssj != null">AND bfxq.bfkssj &gt;= #{kssj}</if>
<if test="jssj != null">AND bfxq.bfjssj &lt;= #{jssj}</if>
${params.dataScope}
</where>
ORDER BY bfxq.bfkssj DESC, bfxq.bfjssj DESC
</select>
<!-- 查询详情 -->
<select id="info" parameterType="long" resultMap="ZqbfXmzBfxqResult">
<include refid="selectCommon"></include> WHERE bfxq.xqid = #{id}
</select>
<!-- 新增 -->
<insert id="add" parameterType="ZqbfXmzBfxq" useGeneratedKeys="true" keyProperty="xqid">
INSERT INTO zqbf_xmz_bfxq
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dwid != null ">dwid,</if>
<if test="xmid != null ">xmid,</if>
<if test="bfkssj != null ">bfkssj,</if>
<if test="bfjssj != null ">bfjssj,</if>
<if test="lxr != null and lxr != ''">lxr,</if>
<if test="lxdh != null and lxdh != ''">lxdh,</if>
<if test="dqzt != null and dqzt != ''">dqzt,</if>
<if test="xqms != null and xqms != ''">xqms,</if>
<if test="htms != null and htms != ''">htms,</if>
<if test="wcsj != null ">wcsj,</if>
<if test="bfms != null and bfms != ''">bfms,</if>
<if test="pjdj != null and pjdj != ''">pjdj,</if>
<if test="pdms != null and pdms != ''">pdms,</if>
<if test="cjr != null and cjr != ''">cjr,</if>
<if test="cjsj != null ">cjsj,</if>
<if test="gxr != null and gxr != ''">gxr,</if>
<if test="bz != null and bz != ''">bz,</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>
gxsj
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dwid != null ">#{dwid},</if>
<if test="xmid != null ">#{xmid},</if>
<if test="bfkssj != null ">#{bfkssj},</if>
<if test="bfjssj != null ">#{bfjssj},</if>
<if test="lxr != null and lxr != ''">#{lxr},</if>
<if test="lxdh != null and lxdh != ''">#{lxdh},</if>
<if test="dqzt != null and dqzt != ''">#{dqzt},</if>
<if test="xqms != null and xqms != ''">#{xqms},</if>
<if test="htms != null and htms != ''">#{htms},</if>
<if test="wcsj != null ">#{wcsj},</if>
<if test="bfms != null and bfms != ''">#{bfms},</if>
<if test="pjdj != null and pjdj != ''">#{pjdj},</if>
<if test="pdms != null and pdms != ''">#{pdms},</if>
<if test="cjr != null and cjr != ''">#{cjr},</if>
<if test="cjsj != null ">#{cjsj},</if>
<if test="gxr != null and gxr != ''">#{gxr},</if>
<if test="bz != null and bz != ''">#{bz},</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>
now()
</trim>
</insert>
<!-- 修改 -->
<update id="edit" parameterType="ZqbfXmzBfxq">
UPDATE zqbf_xmz_bfxq
<trim prefix="SET" suffixOverrides=",">
<if test="dwid != null ">dwid = #{dwid},</if>
<if test="xmid != null ">xmid = #{xmid},</if>
<if test="bfkssj != null ">bfkssj = #{bfkssj},</if>
<if test="bfjssj != null ">bfjssj = #{bfjssj},</if>
<if test="lxr != null and lxr != ''">lxr = #{lxr},</if>
<if test="lxdh != null and lxdh != ''">lxdh = #{lxdh},</if>
<if test="dqzt != null and dqzt != ''">dqzt = #{dqzt},</if>
<if test="xqms != null and xqms != ''">xqms = #{xqms},</if>
<if test="htms != null and htms != ''">htms = #{htms},</if>
<if test="wcsj != null ">wcsj = #{wcsj},</if>
<if test="bfms != null and bfms != ''">bfms = #{bfms},</if>
<if test="pjdj != null and pjdj != ''">pjdj = #{pjdj},</if>
<if test="pdms != null and pdms != ''">pdms = #{pdms},</if>
<if test="cjr != null and cjr != ''">cjr = #{cjr},</if>
<if test="cjsj != null ">cjsj = #{cjsj},</if>
<if test="gxr != null and gxr != ''">gxr = #{gxr},</if>
<if test="bz != null and bz != ''">bz = #{bz},</if>
<if test="yl1 != null and yl1 != ''">yl1 = #{yl1},</if>
<if test="yl2 != null and yl2 != ''">yl2 = #{yl2},</if>
<if test="yl3 != null and yl3 != ''">yl3 = #{yl3},</if>
<if test="yl4 != null and yl4 != ''">yl4 = #{yl4},</if>
<if test="yl5 != null and yl5 != ''">yl5 = #{yl5},</if>
gxsj = now()
</trim>
WHERE xqid = #{xqid}
</update>
<!-- 删除 -->
<delete id="delete" parameterType="long">
DELETE FROM zqbf_xmz_bfxq WHERE xqid IN
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?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.zqbf.mapper.ZqbfXmzBfzjMapper">
<!-- 返回实体 -->
<resultMap id="ZqbfXmzBfzjResult" type="ZqbfXmzBfzjVo">
<result property="zjid" column="zjid"/>
<result property="dwid" column="dwid"/>
<result property="dwmc" column="dwmc"/>
<result property="zjmc" column="zjmc"/>
<result property="zjzw" column="zjzw"/>
<result property="zjzj" column="zjzj"/>
<result property="sjh" column="sjh"/>
<result property="cjr" column="cjr"/>
<result property="cjsj" column="cjsj"/>
<result property="gxr" column="gxr"/>
<result property="gxsj" column="gxsj"/>
<result property="bz" column="bz"/>
<result property="yl1" column="yl1"/>
<result property="yl2" column="yl2"/>
<result property="yl3" column="yl3"/>
<result property="yl4" column="yl4"/>
<result property="yl5" column="yl5"/>
</resultMap>
<!-- 通用查询 -->
<sql id="selectCommon">
SELECT
bfzj.zjid,
bfzj.dwid,
CONCAT(dept.dept_name, dept.create_by) AS dwmc,
bfzj.zjmc,
bfzj.zjzw,
bfzj.zjzj,
bfzj.sjh,
bfzj.cjr,
bfzj.cjsj,
bfzj.gxr,
bfzj.gxsj,
bfzj.bz,
bfzj.yl1,
bfzj.yl2,
bfzj.yl3,
bfzj.yl4,
bfzj.yl5
FROM
zqbf_xmz_bfzj bfzj
LEFT JOIN sys_dept dept ON bfzj.dwid = dept.dept_id
</sql>
<!-- 条件查询 -->
<select id="list" parameterType="ZqbfXmzBfzjQuery" resultMap="ZqbfXmzBfzjResult">
<include refid="selectCommon"></include>
<where>
<if test="zjid != null ">AND bfzj.zjid = #{zjid}</if>
<if test="dwid != null ">AND (dept.dept_id = #{dwid} OR FIND_IN_SET(#{dwid}, dept.ancestors))</if>
<if test="zjmc != null and zjmc !='' ">AND bfzj.zjmc like concat('%', #{zjmc}, '%')</if>
${params.dataScope}
</where>
ORDER BY bfzj.zjzj, bfzj.gxsj DESC
</select>
<!-- 查询详情 -->
<select id="info" parameterType="long" resultMap="ZqbfXmzBfzjResult">
<include refid="selectCommon"></include> WHERE bfzj.zjid = #{id}
</select>
<!-- 新增 -->
<insert id="add" parameterType="ZqbfXmzBfzj">
INSERT INTO zqbf_xmz_bfzj
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dwid != null">dwid,</if>
<if test="user_id != null">user_id,</if>
<if test="zjmc != null and zjmc != ''">zjmc,</if>
<if test="zjzw != null and zjzw != ''">zjzw,</if>
<if test="zjzj != null and zjzj != ''">zjzj,</if>
<if test="sjh != null and sjh != ''">sjh,</if>
<if test="cjr != null and cjr != ''">cjr,</if>
<if test="cjsj != null ">cjsj,</if>
<if test="gxr != null and gxr != ''">gxr,</if>
<if test="bz != null and bz != ''">bz,</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>
gxsj
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dwid != null">#{dwid},</if>
<if test="user_id != null">#{user_id},</if>
<if test="zjmc != null and zjmc !=''">#{zjmc},</if>
<if test="zjzw != null and zjzw !=''">#{zjzw},</if>
<if test="zjzj != null and zjzj != ''">#{zjzj},</if>
<if test="sjh != null and sjh !=''">#{sjh},</if>
<if test="cjr != null and cjr !=''">#{cjr},</if>
<if test="cjsj != null">#{cjsj},</if>
<if test="gxr != null and gxr !=''">#{gxr},</if>
<if test="gxsj != null">#{gxsj},</if>
<if test="bz != null and bz !=''">#{bz},</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>
now()
</trim>
</insert>
<!-- 修改 -->
<update id="edit" parameterType="ZqbfXmzBfzj">
UPDATE zqbf_xmz_bfzj
<trim prefix="SET" suffixOverrides=",">
<if test="zjid != null">zjid = #{zjid},</if>
<if test="user_id != null">user_id = #{user_id},</if>
<if test="dwid != null">dwid = #{dwid},</if>
<if test="zjmc != null and zjmc != ''">zjmc = #{zjmc},</if>
<if test="zjzw != null and zjzw != ''">zjzw = #{zjzw},</if>
<if test="zjzj != null and zjzj != ''">zjzj = #{zjzj},</if>
<if test="sjh != null and sjh != ''">sjh = #{sjh},</if>
<if test="cjr != null">cjr = #{cjr},</if>
<if test="cjsj != null">cjsj = #{cjsj},</if>
<if test="gxr != null">gxr = #{gxr},</if>
<if test="bz != null">bz = #{bz},</if>
<if test="yl1 != null and yl1 != ''">yl1 = #{yl1},</if>
<if test="yl2 != null and yl2 != ''">yl2 = #{yl2},</if>
<if test="yl3 != null and yl3 != ''">yl3 = #{yl3},</if>
<if test="yl4 != null and yl4 != ''">yl4 = #{yl4},</if>
<if test="yl5 != null and yl5 != ''">yl5 = #{yl5},</if>
gxsj = now()
</trim>
WHERE zjid = #{zjid}
</update>
<!-- 删除 -->
<delete id="delete" parameterType="long">
DELETE FROM zqbf_xmz_bfzj WHERE zjid IN
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?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.zqbf.mapper.ZqbfXmzTjfxMapper">
<!-- 返回实体 -->
<resultMap id="GlqsbslResult" type="GlqsbslVo">
<result property="dept_id" column="dept_id"/>
<result property="dept_name" column="dept_name"/>
<result property="tbsl" column="tbsl"/>
<result property="ywcsl" column="ywcsl"/>
</resultMap>
<!-- 条件查询 -->
<select id="glqsbsl" parameterType="ZqczTjfxQuery" resultMap="GlqsbslResult">
WITH RECURSIVE child_tree AS (
SELECT dept_id, dept_id AS root_id
FROM sys_dept
<where>
<if test="dwid != null">
parent_id = #{dwid}
</if>
</where>
UNION ALL
SELECT d.dept_id, ct.root_id
FROM sys_dept d
INNER JOIN child_tree ct ON d.parent_id = ct.dept_id
),
stats_data AS (
SELECT
ct.root_id,
COUNT(bfxq.dwid) AS tbsl,
SUM(CASE WHEN bfxq.dqzt >= 7 THEN 1 ELSE 0 END) AS ywcsl
FROM child_tree ct
LEFT JOIN zqbf_xmz_bfxq bfxq ON ct.dept_id = bfxq.dwid
<!-- 时间区间重叠判断:两个区间有交集 -->
<if test="kssj != null and jssj != null">
AND NOT (bfxq.bfjssj &lt; #{kssj} OR bfxq.bfkssj &gt; #{jssj})
</if>
<if test="kssj != null and jssj == null">
AND bfxq.bfkssj &gt;= #{kssj}
</if>
<if test="jssj != null and kssj == null">
AND bfxq.bfjssj &lt;= #{jssj}
</if>
INNER JOIN zqbf_xmz_bfxm bfxm ON bfxq.xmid = bfxm.xmid
<if test="xmzb != null and xmzb != ''">
AND bfxm.xmzb = #{xmzb}
</if>
GROUP BY ct.root_id
)
SELECT
dept_id,
dept_name,
COALESCE(tbsl, 0) AS tbsl,
COALESCE(ywcsl, 0) AS ywcsl
FROM (
-- 情况1:有子节点时
SELECT
d.dept_id,
d.dept_name,
stats.tbsl,
stats.ywcsl,
1 AS sort_order
FROM sys_dept d
CROSS JOIN (
SELECT COUNT(*) AS cnt
FROM sys_dept
<where>
<if test="dwid != null">
parent_id = #{dwid}
</if>
</where>
) has_child
LEFT JOIN stats_data stats ON d.dept_id = stats.root_id
WHERE has_child.cnt > 0
<if test="dwid != null">
AND d.parent_id = #{dwid}
</if>
UNION ALL
-- 情况2:没有子节点时
SELECT
dept_id,
dept_name,
COALESCE(tbsl, 0) AS tbsl,
COALESCE(ywcsl, 0) AS ywcsl,
2 AS sort_order
FROM sys_dept
LEFT JOIN (
SELECT
COUNT(bfxq.dwid) AS tbsl,
SUM(CASE WHEN bfxq.dqzt >= 7 THEN 1 ELSE 0 END) AS ywcsl
FROM zqbf_xmz_bfxq bfxq
INNER JOIN zqbf_xmz_bfxm bfxm ON bfxq.xmid = bfxm.xmid
<if test="xmzb != null and xmzb != ''">
AND bfxm.xmzb = #{xmzb}
</if>
<where>
<if test="dwid != null">
AND bfxq.dwid = #{dwid}
</if>
<!-- 时间区间重叠判断 -->
<if test="kssj != null and jssj != null">
AND NOT (bfxq.bfjssj &lt; #{kssj} OR bfxq.bfkssj &gt; #{jssj})
</if>
<if test="kssj != null and jssj == null">
AND bfxq.bfkssj &gt;= #{kssj}
</if>
<if test="jssj != null and kssj == null">
AND bfxq.bfjssj &lt;= #{jssj}
</if>
</where>
) current_stats ON 1=1
<where>
<if test="dwid != null">
dept_id = #{dwid}
</if>
</where>
AND NOT EXISTS (
SELECT 1 FROM sys_dept
<where>
<if test="dwid != null">
parent_id = #{dwid}
</if>
</where>
)
) t
ORDER BY sort_order, tbsl DESC, ywcsl DESC
</select>
</mapper>
\ No newline at end of file
<?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.zqbf.mapper.ZqczXmzBffkMapper">
<!-- 返回实体 -->
<resultMap id="ZqczXmzBffkResult" type="ZqczXmzBffk">
<result property="fkid" column="fkid"/>
<result property="xqid" column="xqid"/>
<result property="gw" column="gw"/>
<result property="myd" column="myd"/>
<result property="bzcd" column="bzcd"/>
<result property="zdfs" column="zdfs"/>
<result property="bfts" column="bfts"/>
<result property="zdsc" column="zdsc"/>
<result property="jtjy" column="jtjy"/>
<result property="gxr" column="gxr"/>
<result property="gxsj" column="gxsj"/>
<result property="bz" column="bz"/>
</resultMap>
<!-- 通用查询 -->
<sql id="selectCommon">
SELECT fkid, xqid, gw, myd, bzcd, zdfs, bfts, zdsc, jtjy, gxr, gxsj, bz from zqcz_xmz_bffk
</sql>
<!-- 查询详情 -->
<select id="info" parameterType="long" resultMap="ZqczXmzBffkResult">
<include refid="selectCommon"></include> WHERE fkid = #{fkid}
</select>
<!-- 新增 -->
<insert id="add" parameterType="ZqczXmzBffk">
INSERT INTO zqcz_xmz_bffk
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="xqid != null ">xqid,</if>
<if test="gw != null and gw != ''">gw,</if>
<if test="myd != null and myd != ''">myd,</if>
<if test="bzcd != null and bzcd != ''">bzcd,</if>
<if test="zdfs != null and zdfs != ''">zdfs,</if>
<if test="bfts != null and bfts != ''">bfts,</if>
<if test="zdsc != null and zdsc != ''">zdsc,</if>
<if test="jtjy != null and jtjy != ''">jtjy,</if>
<if test="gxr != null and gxr != ''">gxr,</if>
<if test="bz != null and bz != ''">bz,</if>
gxsj
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="xqid != null ">#{xqid},</if>
<if test="gw != null and gw != ''">#{gw},</if>
<if test="myd != null and myd != ''">#{myd},</if>
<if test="bzcd != null and bzcd != ''">#{bzcd},</if>
<if test="zdfs != null and zdfs != ''">#{zdfs},</if>
<if test="bfts != null and bfts != ''">#{bfts},</if>
<if test="zdsc != null and zdsc != ''">#{zdsc},</if>
<if test="jtjy != null and jtjy != ''">#{jtjy},</if>
<if test="gxr != null and gxr != ''">#{gxr},</if>
<if test="bz != null and bz != ''">#{bz},</if>
now()
</trim>
</insert>
</mapper>
\ No newline at end of file
<?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.zqbf.mapper.ZqczXmzBfjlMapper">
<!-- 返回实体 -->
<resultMap id="ZqczXmzBfjlResult" type="ZqczXmzBfjl">
<result property="jlid" column="jlid"/>
<result property="xqid" column="xqid"/>
<result property="dqzt" column="dqzt"/>
<result property="gxr" column="gxr"/>
<result property="gxsj" column="gxsj"/>
<result property="bz" column="bz"/>
</resultMap>
<!-- 通用查询 -->
<sql id="selectCommon">
SELECT jlid, xqid, dqzt, gxr, gxsj, bz from zqcz_xmz_bfjl
</sql>
<!-- 条件查询 -->
<select id="list" parameterType="ZqczXmzBfjlQuery" resultMap="ZqczXmzBfjlResult">
<include refid="selectCommon"></include>
<where>
<if test="xqid != null ">AND xqid = #{xqid}</if>
<if test="dqzt != null and dqzt !='' ">AND dqzt = #{dqzt}</if>
</where>
ORDER BY gxsj
</select>
<!-- 新增 -->
<insert id="add" parameterType="ZqczXmzBfjl">
INSERT INTO zqcz_xmz_bfjl
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="xqid != null ">xqid,</if>
<if test="dqzt != null and dqzt != ''">dqzt,</if>
<if test="gxr != null and gxr != ''">gxr,</if>
<if test="bz != null and bz != ''">bz,</if>
gxsj
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="xqid != null ">#{xqid},</if>
<if test="dqzt != null and dqzt != ''">#{dqzt},</if>
<if test="gxr != null and gxr != ''">#{gxr},</if>
<if test="bz != null and bz != ''">#{bz},</if>
now()
</trim>
</insert>
<!-- 删除 -->
<delete id="delete" parameterType="long">
DELETE FROM zqcz_xmz_bfjl WHERE xmid = #{id}
</delete>
</mapper>
\ No newline at end of file
<?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.zqbf.mapper.ZqczXmzBfpzMapper">
<!-- 返回实体 -->
<resultMap id="ZqczXmzBfpzResult" type="ZqczXmzBfpz">
<result property="pzid" column="pzid"/>
<result property="xqid" column="xqid"/>
<result property="wjmc" column="wjmc"/>
<result property="wjlj" column="wjlj"/>
<result property="gxr" column="gxr"/>
<result property="gxsj" column="gxsj"/>
</resultMap>
<!-- 通用查询 -->
<sql id="selectCommon">
SELECT pzid, xqid, wjmc, wjlj, gxr, gxsj from zqcz_xmz_bfpz
</sql>
<!-- 条件查询 -->
<select id="list" parameterType="ZqczXmzBfpz" resultMap="ZqczXmzBfpzResult">
<include refid="selectCommon"></include>
<where>
<if test="xqid != null ">AND xqid = #{xqid}</if>
</where>
ORDER BY xxx
</select>
<!-- 新增 -->
<insert id="batchAdd" parameterType="ZqczXmzBfpz">
INSERT INTO zqcz_xmz_bfpz (xqid, wjmc, wjlj, gxr, gxsj)
VALUES
<foreach collection="dataList" item="item" separator=",">
(#{item.xqid}, #{item.wjmc}, #{item.wjlj}, #{item.gxr}, now())
</foreach>
</insert>
<!-- 删除 -->
<delete id="delete" parameterType="long">
DELETE FROM zqcz_xmz_bfpz WHERE xqid = #{id}
</delete>
</mapper>
\ No newline at end of file
<?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.zqbf.mapper.ZqczXmzDdzjMapper">
<!-- 返回实体 -->
<resultMap id="ZqczXmzDdzjResult" type="ZqczXmzDdzj">
<result property="ddid" column="ddid"/>
<result property="xqid" column="xqid"/>
<result property="ddzj" column="ddzj"/>
<result property="fzr" column="fzr"/>
</resultMap>
<!-- 通用查询 -->
<sql id="selectCommon">
SELECT ddid, xqid, ddzj, fzr from zqcz_xmz_ddzj
</sql>
<!-- 条件查询 -->
<select id="list" parameterType="ZqczXmzDdzj" resultMap="ZqczXmzDdzjResult">
<include refid="selectCommon"></include>
<where>
<if test="xqid != null ">AND xqid = #{xqid}</if>
<if test="ddzj != null ">AND ddzj = #{ddzj}</if>
</where>
ORDER BY ddid
</select>
<!-- 新增 -->
<insert id="batchAdd" parameterType="ZqczXmzDdzj">
INSERT INTO zqcz_xmz_ddzj (xqid, ddzj, fzr)
VALUES
<foreach collection="dataList" item="item" separator=",">
(#{item.xqid}, #{item.ddzj}, #{item.fzr})
</foreach>
</insert>
<!-- 删除 -->
<delete id="delete" parameterType="long">
DELETE FROM zqcz_xmz_ddzj WHERE xqid = #{id}
</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