Commit eb397dab by MMF

MMF 2026-04-14 帮扶计划优化

parent 6ef4dbc4
...@@ -64,4 +64,17 @@ public class ZqbfXmzBfxmController extends BaseController { ...@@ -64,4 +64,17 @@ public class ZqbfXmzBfxmController extends BaseController {
return error(e.getMessage()); return error(e.getMessage());
} }
} }
/**
* 帮扶项目树
*/
@GetMapping("/tree")
public AjaxResult tree() {
try {
return success(zqbfXmzBfxmService.tree());
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
} }
...@@ -34,6 +34,19 @@ public class ZqbfXmzBfxqController extends BaseController { ...@@ -34,6 +34,19 @@ public class ZqbfXmzBfxqController extends BaseController {
} }
/** /**
* 查询详情
*/
@GetMapping("/{id}")
public AjaxResult info(@PathVariable Long id) {
try {
return success(zqbfXmzBfxqService.info(id));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 新增 * 新增
*/ */
@PostMapping @PostMapping
......
package com.qianhe.zqbf.controller;
import com.qianhe.common.core.controller.BaseController;
import com.qianhe.common.core.domain.AjaxResult;
import com.qianhe.zqbf.domain.ZqczXmzBfjlQuery;
import com.qianhe.zqbf.service.ZqczXmzBffkService;
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.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/zqbf/bffk")
public class ZqczXmzBffkController extends BaseController {
@Autowired
private ZqczXmzBffkService zqczXmzBffkService;
/**
* 分页查询
*/
@GetMapping("/{id}")
public AjaxResult info(@PathVariable Long id) {
try {
return success(zqczXmzBffkService.info(id));
} 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.zqbf.domain.ZqbfXmzBfzjQuery;
import com.qianhe.zqbf.domain.ZqczXmzBfjl;
import com.qianhe.zqbf.domain.ZqczXmzBfjlQuery;
import com.qianhe.zqbf.service.ZqczXmzBfjlService;
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/bfjl")
public class ZqczXmzBfjlController extends BaseController {
@Autowired
private ZqczXmzBfjlService zqczXmzBfjlService;
/**
* 分页查询
*/
@GetMapping("/list")
public AjaxResult list(ZqczXmzBfjlQuery zqczXmzBfjlQuery) {
try {
return success(zqczXmzBfjlService.list(zqczXmzBfjlQuery));
} 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.zqbf.domain.ZqczXmzBfpz;
import com.qianhe.zqbf.domain.ZqczXmzDdzj;
import com.qianhe.zqbf.service.ZqczXmzBfpzService;
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/bfpz")
public class ZqczXmzBfpzController extends BaseController {
@Autowired
private ZqczXmzBfpzService zqczXmzBfpzService;
/**
* 分页查询
*/
@GetMapping("/list")
public AjaxResult list(ZqczXmzBfpz zqczXmzBfpz) {
try {
return success(zqczXmzBfpzService.list(zqczXmzBfpz));
} 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.zqbf.domain.ZqczXmzBfjlQuery;
import com.qianhe.zqbf.domain.ZqczXmzDdzj;
import com.qianhe.zqbf.service.ZqczXmzDdzjService;
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/ddzj")
public class ZqczXmzDdzjController extends BaseController {
@Autowired
private ZqczXmzDdzjService xmzDdzjService;
/**
* 分页查询
*/
@GetMapping("/list")
public AjaxResult list(ZqczXmzDdzj zqczXmzDdzj) {
try {
return success(xmzDdzjService.list(zqczXmzDdzj));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
}
package com.qianhe.zqbf.domain;
import java.util.ArrayList;
import java.util.List;
public class DictTreeselectVO {
private String value;
private String label;
/**
* 节点
*/
private String parentId;
private List<DictTreeselectVO> children = new ArrayList<DictTreeselectVO>();
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public List<DictTreeselectVO> getChildren() {
return children;
}
public void setChildren(List<DictTreeselectVO> children) {
this.children = children;
}
}
package com.qianhe.zqbf.domain;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
public class TreeSelectT implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 节点ID
*/
private String value;
/**
* 节点名称
*/
private String label;
/**
* 子节点
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<TreeSelectT> children;
public TreeSelectT() {}
public TreeSelectT(DictTreeselectVO dictTreeselectVO) {
this.value = dictTreeselectVO.getValue();
this.label = dictTreeselectVO.getLabel();
this.children = dictTreeselectVO.getChildren().stream().map(TreeSelectT::new).collect(Collectors.toList());
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public List<TreeSelectT> getChildren() {
return children;
}
public void setChildren(List<TreeSelectT> children) {
this.children = children;
}
}
\ No newline at end of file
...@@ -30,7 +30,7 @@ public class ZqbfXmzBfxqVo implements Serializable { ...@@ -30,7 +30,7 @@ public class ZqbfXmzBfxqVo implements Serializable {
/** /**
* 单位名称 * 单位名称
*/ */
@Excel(name = "单位名称") @Excel(name = "单位")
private String dwmc; private String dwmc;
/** /**
* 项目ID:zqbf_xmz_bfxm.id * 项目ID:zqbf_xmz_bfxm.id
...@@ -60,13 +60,13 @@ public class ZqbfXmzBfxqVo implements Serializable { ...@@ -60,13 +60,13 @@ public class ZqbfXmzBfxqVo implements Serializable {
* 帮扶时间 * 帮扶时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "帮扶开始时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date bfkssj; private Date bfkssj;
/** /**
* 帮扶时间 * 帮扶时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "帮扶结束时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date bfjssj; private Date bfjssj;
/** /**
* 联系人 * 联系人
...@@ -76,6 +76,23 @@ public class ZqbfXmzBfxqVo implements Serializable { ...@@ -76,6 +76,23 @@ public class ZqbfXmzBfxqVo implements Serializable {
/** /**
* 联系电话 * 联系电话
*/ */
@Excel(name = "联系电话") @Excel(name = "联系方式")
private String lxdh; private String lxdh;
/**
* 帮扶时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date gxsj;
/**
* 完成时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date wcsj;
/**
* 帮扶描述
*/
private String bfms;
} }
...@@ -28,5 +28,9 @@ public class ZqczXmzDdzj implements Serializable { ...@@ -28,5 +28,9 @@ public class ZqczXmzDdzj implements Serializable {
/** /**
* 负责人 1=是 2=否 * 负责人 1=是 2=否
*/ */
private String zjmc;
/**
* 负责人 1=是 2=否
*/
private String fzr; private String fzr;
} }
package com.qianhe.zqbf.service; package com.qianhe.zqbf.service;
import com.qianhe.zqbf.domain.TreeSelectT;
import com.qianhe.zqbf.domain.ZqbfXmzBfxm; import com.qianhe.zqbf.domain.ZqbfXmzBfxm;
import com.qianhe.zqbf.domain.ZqbfXmzBfxmQuery; import com.qianhe.zqbf.domain.ZqbfXmzBfxmQuery;
import com.qianhe.zqbf.domain.ZqbfXmzBfxmVo; import com.qianhe.zqbf.domain.ZqbfXmzBfxmVo;
...@@ -31,4 +32,9 @@ public interface ZqbfXmzBfxmService { ...@@ -31,4 +32,9 @@ public interface ZqbfXmzBfxmService {
* 删除 * 删除
*/ */
int delete(Long[] ids); int delete(Long[] ids);
/**
* 帮扶项目树
*/
List<TreeSelectT> tree();
} }
package com.qianhe.zqbf.service;
import com.qianhe.zqbf.domain.ZqczXmzBffk;
public interface ZqczXmzBffkService {
/**
* 查询详情
*/
ZqczXmzBffk info(Long id);
}
package com.qianhe.zqbf.service;
import com.qianhe.zqbf.domain.ZqczXmzBfjl;
import com.qianhe.zqbf.domain.ZqczXmzBfjlQuery;
import java.util.List;
public interface ZqczXmzBfjlService {
/**
* 条件查询
*/
List<ZqczXmzBfjl> list(ZqczXmzBfjlQuery zqczXmzBfjlQuery);
}
package com.qianhe.zqbf.service;
import com.qianhe.zqbf.domain.ZqczXmzBfpz;
import java.util.List;
public interface ZqczXmzBfpzService {
/**
* 条件查询
*/
List<ZqczXmzBfpz> list(ZqczXmzBfpz zqczXmzBfpz);
}
package com.qianhe.zqbf.service;
import com.qianhe.zqbf.domain.ZqczXmzDdzj;
import java.util.List;
public interface ZqczXmzDdzjService {
/**
* 条件查询
*/
List<ZqczXmzDdzj> list(ZqczXmzDdzj zqczXmzDdzj);
}
package com.qianhe.zqbf.service.impl; package com.qianhe.zqbf.service.impl;
import com.qianhe.zqbf.domain.ZqbfXmzBfxm; import com.qianhe.common.core.domain.entity.SysDictData;
import com.qianhe.zqbf.domain.ZqbfXmzBfxmQuery; import com.qianhe.system.mapper.SysDictDataMapper;
import com.qianhe.zqbf.domain.ZqbfXmzBfxmVo; import com.qianhe.zqbf.domain.*;
import com.qianhe.zqbf.mapper.ZqbfXmzBfxmMapper; import com.qianhe.zqbf.mapper.ZqbfXmzBfxmMapper;
import com.qianhe.zqbf.service.ZqbfXmzBfxmService; import com.qianhe.zqbf.service.ZqbfXmzBfxmService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date; import java.util.*;
import java.util.List; import java.util.stream.Collectors;
@Service @Service
public class ZqbfXmzBfxmServiceImpl implements ZqbfXmzBfxmService { public class ZqbfXmzBfxmServiceImpl implements ZqbfXmzBfxmService {
@Autowired @Autowired
private ZqbfXmzBfxmMapper zqbfXmzBfxmMapper; private ZqbfXmzBfxmMapper zqbfXmzBfxmMapper;
@Autowired
private SysDictDataMapper dictDataMapper;
/** /**
...@@ -62,4 +64,52 @@ public class ZqbfXmzBfxmServiceImpl implements ZqbfXmzBfxmService { ...@@ -62,4 +64,52 @@ public class ZqbfXmzBfxmServiceImpl implements ZqbfXmzBfxmService {
public int delete(Long[] ids) { public int delete(Long[] ids) {
return zqbfXmzBfxmMapper.delete(ids); return zqbfXmzBfxmMapper.delete(ids);
} }
@Override
public List<TreeSelectT> tree() {
// 1. 获取源数据并快速返回
List<ZqbfXmzBfxmVo> sourceList = zqbfXmzBfxmMapper.list(ZqbfXmzBfxmQuery.builder().build());
if (sourceList == null || sourceList.isEmpty()) {
return Collections.emptyList();
}
// 2. 获取字典数据
List<SysDictData> dictList = dictDataMapper.selectDictDataByType("zqbf_xmz_zjzj");
if (dictList == null || dictList.isEmpty()) {
return Collections.emptyList();
}
// 3. 构建项目分组 Map(按 xmzb 分组),避免每次 stream 过滤
Map<String, List<ZqbfXmzBfxmVo>> groupMap = sourceList.stream()
.filter(item -> item.getXmzb() != null)
.collect(Collectors.groupingBy(ZqbfXmzBfxmVo::getXmzb));
// 4. 构建树形结构
List<TreeSelectT> dataList = new ArrayList<>(dictList.size());
for (SysDictData row : dictList) {
String dictValue = row.getDictValue();
if (dictValue == null) {
continue; // 跳过无效的字典值
}
TreeSelectT treeSelectT = new TreeSelectT();
treeSelectT.setLabel(row.getDictLabel());
treeSelectT.setValue(dictValue);
List<TreeSelectT> children = new ArrayList<>();
List<ZqbfXmzBfxmVo> childrenList = groupMap.getOrDefault(dictValue, Collections.emptyList());
for (ZqbfXmzBfxmVo item : childrenList) {
TreeSelectT child = new TreeSelectT();
child.setLabel(item.getXmmc());
child.setValue(String.valueOf(item.getXmid()));
children.add(child);
}
treeSelectT.setChildren(children);
dataList.add(treeSelectT);
}
return dataList;
}
} }
package com.qianhe.zqbf.service.impl;
import com.qianhe.zqbf.domain.ZqczXmzBffk;
import com.qianhe.zqbf.mapper.ZqczXmzBffkMapper;
import com.qianhe.zqbf.service.ZqczXmzBffkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ZqczXmzBffkServiceImpl implements ZqczXmzBffkService {
@Autowired
private ZqczXmzBffkMapper xmzBffkMapper;
/**
* 查询详情
*/
@Override
public ZqczXmzBffk info(Long id) {
ZqczXmzBffk info = xmzBffkMapper.info(id);
return info;
}
}
package com.qianhe.zqbf.service.impl;
import com.qianhe.zqbf.domain.ZqczXmzBfjl;
import com.qianhe.zqbf.domain.ZqczXmzBfjlQuery;
import com.qianhe.zqbf.mapper.ZqczXmzBfjlMapper;
import com.qianhe.zqbf.service.ZqbfXmzTjfxService;
import com.qianhe.zqbf.service.ZqczXmzBfjlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
@Service
public class ZqczXmzBfjlServiceImpl implements ZqczXmzBfjlService {
@Autowired
private ZqczXmzBfjlMapper zqczXmzBfjlMapper;
/**
* 条件查询
*/
@Override
public List<ZqczXmzBfjl> list(ZqczXmzBfjlQuery zqczXmzBfjlQuery) {
List<ZqczXmzBfjl> dataList = zqczXmzBfjlMapper.list(zqczXmzBfjlQuery);
return dataList;
}
}
package com.qianhe.zqbf.service.impl;
import com.qianhe.zqbf.domain.ZqczXmzBfpz;
import com.qianhe.zqbf.mapper.ZqczXmzBfpzMapper;
import com.qianhe.zqbf.service.ZqczXmzBfpzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ZqczXmzBfpzServiceImpl implements ZqczXmzBfpzService {
@Autowired
private ZqczXmzBfpzMapper xmzBfpzMapper;
@Override
public List<ZqczXmzBfpz> list(ZqczXmzBfpz zqczXmzBfpz) {
List<ZqczXmzBfpz> dataList = xmzBfpzMapper.list(zqczXmzBfpz);
return dataList;
}
}
package com.qianhe.zqbf.service.impl;
import com.qianhe.zqbf.domain.ZqczXmzDdzj;
import com.qianhe.zqbf.mapper.ZqczXmzDdzjMapper;
import com.qianhe.zqbf.service.ZqczXmzDdzjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
@Service
public class ZqczXmzDdzjServiceImpl implements ZqczXmzDdzjService {
@Autowired
private ZqczXmzDdzjMapper ddzjMapper;
/**
* 条件查询
*/
@Override
public List<ZqczXmzDdzj> list(ZqczXmzDdzj zqczXmzDdzj) {
List<ZqczXmzDdzj> dataList = ddzjMapper.list(zqczXmzDdzj);
return dataList;
}
}
package com.qianhe.zqbfbdw.bfzj.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.zqbfbdw.bfzj.domain.ZqbfBdwBfzj;
import com.qianhe.zqbfbdw.bfzj.domain.ZqbfBdwBfzjQuery;
import com.qianhe.zqbfbdw.bfzj.domain.ZqbfBdwBfzjVo;
import com.qianhe.zqbfbdw.bfzj.service.ZqbfBdwBfzjService;
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("/zqbfbdw/bfzj")
public class ZqbfBdwBfzjController extends BaseController {
@Autowired
private ZqbfBdwBfzjService zqbfBdwBfzjService;
/**
* 分页查询
*/
@GetMapping("/list")
public TableDataInfo list(ZqbfBdwBfzjQuery zqbfBdwBfzjQuery) {
startPage();
return getDataTable(zqbfBdwBfzjService.list(zqbfBdwBfzjQuery));
}
/**
* 查询详情
*/
@GetMapping("/{id}")
public AjaxResult info(@PathVariable Long id) {
try {
return success(zqbfBdwBfzjService.info(id));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 新增
*/
@PostMapping
public AjaxResult add(@RequestBody ZqbfBdwBfzj zqbfBdwBfzj) {
try {
return toAjax(zqbfBdwBfzjService.add(zqbfBdwBfzj, getUsername()));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 修改
*/
@PutMapping
public AjaxResult edit(@RequestBody ZqbfBdwBfzj zqbfBdwBfzj) {
try {
return toAjax(zqbfBdwBfzjService.edit(zqbfBdwBfzj, getUsername()));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 删除
*/
@DeleteMapping("/{ids}")
public AjaxResult delete(@PathVariable Long[] ids) {
try {
return toAjax(zqbfBdwBfzjService.delete(ids));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
/**
* 导出
*/
@PostMapping("/export")
public void export(HttpServletResponse response, ZqbfBdwBfzjQuery zqbfBdwBfzjQuery) {
List<ZqbfBdwBfzjVo> dataList = zqbfBdwBfzjService.list(zqbfBdwBfzjQuery);
ExcelUtil<ZqbfBdwBfzjVo> util = new ExcelUtil<>(ZqbfBdwBfzjVo.class);
util.exportExcel(response, dataList, "sheetName");
}
}
package com.qianhe.zqbfbdw.bfzj.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 ZqbfBdwBfzj implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 专家ID
*/
private Long zjid;
/**
* 单位ID
*/
private Long dwid;
/**
* 专家名称
*/
private String zjmc;
/**
* 专家性别
*/
private String zjxb;
/**
* 出生日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date csrq;
/**
* 专家工种(字典)
*/
private String zjgz;
/**
* 职业技能等级(字典)
*/
private String zyjndj;
/**
* 指导方向(字典)
*/
private String zdfx;
/**
* 负责人 1=是 2=否
*/
private String fzr;
/**
* 统一账号
*/
private String tyzh;
/**
* 手机号
*/
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.zqbfbdw.bfzj.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;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqbfBdwBfzjQuery extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 专家ID
*/
private Long zjid;
/**
* 单位ID
*/
private Long dwid;
/**
* 专家名称
*/
private String zjmc;
/**
* 开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date kssj;
/**
* 结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date jssj;
}
package com.qianhe.zqbfbdw.bfzj.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 ZqbfBdwBfzjVo 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 = "性别")
private String zjxb;
/**
* 出生日期
*/
@Excel(name = "出生日期")
private String csrq;
/**
* 专家工种(字典)
*/
@Excel(name = "工种")
private String zjgz;
/**
* 职业技能等级(字典)
*/
@Excel(name = "职业技能等级")
private String zyjndj;
/**
* 指导方向(字典)
*/
@Excel(name = "指导方向")
private String zdfx;
/**
* 负责人 1=是 2=否
*/
@Excel(name = "负责人")
private String fzr;
/**
* 统一账号
*/
@Excel(name = "统一账号")
private String tyzh;
/**
* 手机号
*/
@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")
@Excel(name = "更新时间", width = 30, dateFormat = "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.zqbfbdw.bfzj.mapper;
import com.qianhe.zqbfbdw.bfzj.domain.ZqbfBdwBfzj;
import com.qianhe.zqbfbdw.bfzj.domain.ZqbfBdwBfzjQuery;
import com.qianhe.zqbfbdw.bfzj.domain.ZqbfBdwBfzjVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface ZqbfBdwBfzjMapper {
/**
* 条件查询
*/
List<ZqbfBdwBfzjVo> list(ZqbfBdwBfzjQuery zqbfBdwBfzjQuery);
/**
* 查询详情
*/
ZqbfBdwBfzjVo info(Long id);
/**
* 新增
*/
int add(ZqbfBdwBfzj zqbfBdwBfzj);
/**
* 修改
*/
int edit(ZqbfBdwBfzj zqbfBdwBfzj);
/**
* 删除
*/
int delete(Long[] ids);
}
package com.qianhe.zqbfbdw.bfzj.service;
import com.qianhe.zqbfbdw.bfzj.domain.ZqbfBdwBfzj;
import com.qianhe.zqbfbdw.bfzj.domain.ZqbfBdwBfzjQuery;
import com.qianhe.zqbfbdw.bfzj.domain.ZqbfBdwBfzjVo;
import java.util.List;
public interface ZqbfBdwBfzjService {
/**
* 条件查询
*/
List<ZqbfBdwBfzjVo> list(ZqbfBdwBfzjQuery zqbfBdwBfzjQuery);
/**
* 查询详情
*/
ZqbfBdwBfzjVo info(Long id);
/**
* 新增
*/
int add(ZqbfBdwBfzj zqbfBdwBfzj, String username);
/**
* 修改
*/
int edit(ZqbfBdwBfzj zqbfBdwBfzj, String username);
/**
* 删除
*/
int delete(Long[] ids);
}
package com.qianhe.zqbfbdw.bfzj.service.impl;
import com.qianhe.zqbfbdw.bfzj.domain.ZqbfBdwBfzj;
import com.qianhe.zqbfbdw.bfzj.domain.ZqbfBdwBfzjQuery;
import com.qianhe.zqbfbdw.bfzj.domain.ZqbfBdwBfzjVo;
import com.qianhe.zqbfbdw.bfzj.mapper.ZqbfBdwBfzjMapper;
import com.qianhe.zqbfbdw.bfzj.service.ZqbfBdwBfzjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class ZqbfBdwBfzjServiceImpl implements ZqbfBdwBfzjService {
@Autowired
private ZqbfBdwBfzjMapper zqbfBdwBfzjMapper;
/**
* 条件查询
*/
@Override
public List<ZqbfBdwBfzjVo> list(ZqbfBdwBfzjQuery zqbfBdwBfzjQuery) {
List<ZqbfBdwBfzjVo> dataList = zqbfBdwBfzjMapper.list(zqbfBdwBfzjQuery);
return dataList;
}
/**
* 查询详情
*/
@Override
public ZqbfBdwBfzjVo info(Long id) {
ZqbfBdwBfzjVo info = zqbfBdwBfzjMapper.info(id);
return info;
}
/**
* 新增
*/
@Override
public int add(ZqbfBdwBfzj zqbfBdwBfzj, String username) {
zqbfBdwBfzj.setCjr(username);
zqbfBdwBfzj.setCjsj(new Date());
zqbfBdwBfzj.setGxr(username);
return zqbfBdwBfzjMapper.add(zqbfBdwBfzj);
}
/**
* 修改
*/
@Override
public int edit(ZqbfBdwBfzj zqbfBdwBfzj, String username) {
zqbfBdwBfzj.setGxr(username);
return zqbfBdwBfzjMapper.edit(zqbfBdwBfzj);
}
/**
* 删除
*/
@Override
public int delete(Long[] ids) {
return zqbfBdwBfzjMapper.delete(ids);
}
}
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
<result property="bfjssj" column="bfjssj"/> <result property="bfjssj" column="bfjssj"/>
<result property="lxr" column="lxr"/> <result property="lxr" column="lxr"/>
<result property="lxdh" column="lxdh"/> <result property="lxdh" column="lxdh"/>
<result property="gxsj" column="gxsj"/>
<result property="wcsj" column="wcsj"/>
<result property="bfms" column="bfms"/>
</resultMap> </resultMap>
<!-- 通用查询 --> <!-- 通用查询 -->
<sql id="selectCommon"> <sql id="selectCommon">
...@@ -32,20 +35,21 @@ ...@@ -32,20 +35,21 @@
bfxq.bfkssj, bfxq.bfkssj,
bfxq.bfjssj, bfxq.bfjssj,
bfxq.lxr, bfxq.lxr,
bfxq.lxdh bfxq.lxdh,
bfxq.gxsj,
bfxq.wcsj,
bfxq.bfms
FROM FROM
zqbf_xmz_bfxq bfxq zqbf_xmz_bfxq bfxq
LEFT JOIN sys_dept dept ON bfxq.dwid = dept.dept_id LEFT JOIN sys_dept dept ON bfxq.dwid = dept.dept_id
LEFT JOIN zqbf_xmz_bfxm bfxm ON bfxq.xmid = bfxm.xmid 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> </sql>
<!-- 条件查询 --> <!-- 条件查询 -->
<select id="list" parameterType="ZqbfXmzBfxqQuery" resultMap="ZqbfXmzBfxqResult"> <select id="list" parameterType="ZqbfXmzBfxqQuery" resultMap="ZqbfXmzBfxqResult">
<include refid="selectCommon"></include> <include refid="selectCommon"></include>
<where> <where>
<if test="xqid != null ">AND bfxq.xqid = #{xqid}</if> <if test="xqid != null ">AND bfxq.xqid = #{xqid}</if>
<if test="user_id != null ">AND ddzj.user_id = #{user_id}</if> <if test="user_id != null ">AND ddzj.ddzj = #{user_id}</if>
<if test="dwid != null ">AND (dept.dept_id = #{dwid} OR FIND_IN_SET(#{dwid}, dept.ancestors))</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="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="dqzt != null and dqzt != ''">AND bfxq.dqzt &gt;= #{dqzt}</if>
...@@ -53,7 +57,22 @@ ...@@ -53,7 +57,22 @@
<if test="jssj != null">AND bfxq.bfjssj &lt;= #{jssj}</if> <if test="jssj != null">AND bfxq.bfjssj &lt;= #{jssj}</if>
${params.dataScope} ${params.dataScope}
</where> </where>
ORDER BY bfxq.bfkssj DESC, bfxq.bfjssj DESC GROUP BY
bfxq.xqid,
bfxq.dwid,
CONCAT( dept.dept_name, dept.create_by ),
bfxq.xmid,
bfxm.xmmc,
bfxm.xmzb,
bfxq.xqms,
bfxq.dqzt,
bfxq.bfkssj,
bfxq.bfjssj,
bfxq.lxr,
bfxq.lxdh,
bfxq.wcsj,
bfxq.bfms
ORDER BY bfxq.gxsj DESC
</select> </select>
<!-- 查询详情 --> <!-- 查询详情 -->
<select id="info" parameterType="long" resultMap="ZqbfXmzBfxqResult"> <select id="info" parameterType="long" resultMap="ZqbfXmzBfxqResult">
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</sql> </sql>
<!-- 查询详情 --> <!-- 查询详情 -->
<select id="info" parameterType="long" resultMap="ZqczXmzBffkResult"> <select id="info" parameterType="long" resultMap="ZqczXmzBffkResult">
<include refid="selectCommon"></include> WHERE fkid = #{fkid} <include refid="selectCommon"></include> WHERE xqid = #{id}
</select> </select>
<!-- 新增 --> <!-- 新增 -->
<insert id="add" parameterType="ZqczXmzBffk"> <insert id="add" parameterType="ZqczXmzBffk">
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<where> <where>
<if test="xqid != null ">AND xqid = #{xqid}</if> <if test="xqid != null ">AND xqid = #{xqid}</if>
</where> </where>
ORDER BY xxx ORDER BY gxsj desc
</select> </select>
<!-- 新增 --> <!-- 新增 -->
<insert id="batchAdd" parameterType="ZqczXmzBfpz"> <insert id="batchAdd" parameterType="ZqczXmzBfpz">
......
...@@ -8,20 +8,28 @@ ...@@ -8,20 +8,28 @@
<result property="ddid" column="ddid"/> <result property="ddid" column="ddid"/>
<result property="xqid" column="xqid"/> <result property="xqid" column="xqid"/>
<result property="ddzj" column="ddzj"/> <result property="ddzj" column="ddzj"/>
<result property="zjmc" column="zjmc"/>
<result property="fzr" column="fzr"/> <result property="fzr" column="fzr"/>
</resultMap> </resultMap>
<!-- 通用查询 --> <!-- 通用查询 -->
<sql id="selectCommon"> <sql id="selectCommon">
SELECT ddid, xqid, ddzj, fzr from zqcz_xmz_ddzj SELECT
ddzj.ddid,
ddzj.xqid,
ddzj.ddzj,
bfzj.zjmc,
ddzj.fzr
FROM
zqcz_xmz_ddzj ddzj LEFT JOIN zqbf_xmz_bfzj bfzj ON ddzj.ddzj=bfzj.zjid
</sql> </sql>
<!-- 条件查询 --> <!-- 条件查询 -->
<select id="list" parameterType="ZqczXmzDdzj" resultMap="ZqczXmzDdzjResult"> <select id="list" parameterType="ZqczXmzDdzj" resultMap="ZqczXmzDdzjResult">
<include refid="selectCommon"></include> <include refid="selectCommon"></include>
<where> <where>
<if test="xqid != null ">AND xqid = #{xqid}</if> <if test="xqid != null ">AND ddzj.xqid = #{xqid}</if>
<if test="ddzj != null ">AND ddzj = #{ddzj}</if> <if test="ddzj != null ">AND ddzj.ddzj = #{ddzj}</if>
</where> </where>
ORDER BY ddid ORDER BY ddzj.ddid
</select> </select>
<!-- 新增 --> <!-- 新增 -->
<insert id="batchAdd" parameterType="ZqczXmzDdzj"> <insert id="batchAdd" parameterType="ZqczXmzDdzj">
......
<?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.zqbfbdw.bfzj.mapper.ZqbfBdwBfzjMapper">
<!-- 返回实体 -->
<resultMap id="ZqbfBdwBfzjResult" type="ZqbfBdwBfzjVo">
<result property="zjid" column="zjid"/>
<result property="dwid" column="dwid"/>
<result property="dwmc" column="dwmc"/>
<result property="zjmc" column="zjmc"/>
<result property="zjxb" column="zjxb"/>
<result property="csrq" column="csrq"/>
<result property="zjgz" column="zjgz"/>
<result property="zyjndj" column="zyjndj"/>
<result property="zdfx" column="zdfx"/>
<result property="fzr" column="fzr"/>
<result property="tyzh" column="tyzh"/>
<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.zjxb,
bfzj.csrq,
bfzj.zjgz,
bfzj.zyjndj,
bfzj.zdfx,
bfzj.fzr,
bfzj.tyzh,
bfzj.sjh,
bfzj.cjr,
bfzj.cjsj,
bfzj.gxr,
bfzj.gxsj,
bfzj.bz,
bfzj.yl1,
bfzj.yl2,
bfzj.yl3,
bfzj.yl4,
bfzj.yl5
FROM
zqbf_bdw_bfzj bfzj LEFT JOIN sys_dept dept ON bfzj.dwid=dept.dept_id
</sql>
<!-- 条件查询 -->
<select id="list" parameterType="ZqbfBdwBfzjQuery" resultMap="ZqbfBdwBfzjResult">
<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>
<if test="kssj != null">AND bfzj.gxsj &gt;= #{kssj}</if>
<if test="jssj != null">AND bfzj.gxsj &lt;= #{kssj}</if>
</where>
ORDER BY gxsj DESC
</select>
<!-- 查询详情 -->
<select id="info" parameterType="long" resultMap="ZqbfBdwBfzjResult">
<include refid="selectCommon"></include> WHERE bfzj.zjid = #{zjid}
</select>
<!-- 新增 -->
<insert id="add" parameterType="ZqbfBdwBfzj">
INSERT INTO zqbf_bdw_bfzj
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dwid != null ">dwid,</if>
<if test="zjmc != null and zjmc != ''">zjmc,</if>
<if test="zjxb != null and zjxb != ''">zjxb,</if>
<if test="csrq != null">csrq,</if>
<if test="zjgz != null and zjgz != ''">zjgz,</if>
<if test="zyjndj != null and zyjndj != ''">zyjndj,</if>
<if test="zdfx != null and zdfx != ''">zdfx,</if>
<if test="fzr != null and fzr != ''">fzr,</if>
<if test="tyzh != null and tyzh != ''">tyzh,</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="zjmc != null and zjmc != ''">#{zjmc},</if>
<if test="zjxb != null and zjxb != ''">#{zjxb},</if>
<if test="csrq != null">#{csrq},</if>
<if test="zjgz != null and zjgz != ''">#{zjgz},</if>
<if test="zyjndj != null and zyjndj != ''">#{zyjndj},</if>
<if test="zdfx != null and zdfx != ''">#{zdfx},</if>
<if test="fzr != null and fzr != ''">#{fzr},</if>
<if test="tyzh != null and tyzh != ''">#{tyzh},</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>
now()
</trim>
</insert>
<!-- 修改 -->
<update id="edit" parameterType="ZqbfBdwBfzj">
UPDATE zqbf_bdw_bfzj
<trim prefix="SET" suffixOverrides=",">
<if test="dwid != null ">dwid = #{dwid},</if>
<if test="zjmc != null and zjmc != ''">zjmc = #{zjmc},</if>
<if test="zjxb != null and zjxb != ''">zjxb = #{zjxb},</if>
<if test="csrq != null">csrq = #{csrq},</if>
<if test="zjgz != null and zjgz != ''">zjgz = #{zjgz},</if>
<if test="zyjndj != null and zyjndj != ''">zyjndj = #{zyjndj},</if>
<if test="zdfx != null and zdfx != ''">zdfx = #{zdfx},</if>
<if test="fzr != null and fzr != ''">fzr = #{fzr},</if>
<if test="tyzh != null and tyzh != ''">tyzh = #{tyzh},</if>
<if test="sjh != null and sjh != ''">sjh = #{sjh},</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 zjid = #{zjid}
</update>
<!-- 删除 -->
<delete id="delete" parameterType="long">
DELETE FROM zqbf_bdw_bfzj WHERE zjid IN
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</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