add===>:移植齐鲁名医模块
This commit is contained in:
parent
4505624412
commit
ca0435f954
@ -133,4 +133,24 @@ public class Constants {
|
||||
*/
|
||||
public static final String[] JOB_ERROR_STR = {"java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
|
||||
"org.springframework", "org.apache", "com.xinelu.common.utils.file"};
|
||||
|
||||
/**
|
||||
* 科室编码前缀
|
||||
*/
|
||||
public static final String DEPARTMENT_CODE = "HDC";
|
||||
|
||||
/**
|
||||
* 健康咨询-科室人员资质证书证书编号前缀
|
||||
*/
|
||||
public static final String CERTIFICATE_CODE = "CE";
|
||||
|
||||
/**
|
||||
* 医院编码前缀
|
||||
*/
|
||||
public static final String HOSPITAL_CODE = "HS";
|
||||
|
||||
/**
|
||||
* 科室人员编码前缀
|
||||
*/
|
||||
public static final String PERSON_CODE = "PC";
|
||||
}
|
||||
|
||||
@ -0,0 +1,64 @@
|
||||
package com.xinelu.common.core.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description 基础实体类
|
||||
* @Author 纪寒
|
||||
* @Date 2022-09-02 10:02:07
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class BaseDomain {
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
private String searchValue;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
private Map<String, Object> params;
|
||||
|
||||
public Map<String, Object> getParams() {
|
||||
if (params == null) {
|
||||
params = new HashMap<>();
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
public void setParams(Map<String, Object> params) {
|
||||
this.params = params;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package com.xinelu.common.custominterface;
|
||||
|
||||
/**
|
||||
* @description 全局新增接口
|
||||
* @author jihan
|
||||
* @date 2022-07-28 11:52:00
|
||||
*/
|
||||
public interface Insert {
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package com.xinelu.common.custominterface;
|
||||
|
||||
/**
|
||||
* @Description 全局查询接口
|
||||
* @Author 纪寒
|
||||
* @Date 2022-09-06 10:58:16
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface Query {
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package com.xinelu.common.custominterface;
|
||||
|
||||
/**
|
||||
* @author ljh
|
||||
* @description 任务确认完成新增接口
|
||||
*/
|
||||
public interface TaskInsert {
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package com.xinelu.common.custominterface;
|
||||
|
||||
/**
|
||||
* @author jihan
|
||||
* @description 全局修改接口
|
||||
* @date 2022-07-28 11:52:00
|
||||
*/
|
||||
public interface Update {
|
||||
}
|
||||
@ -1,5 +1,8 @@
|
||||
package com.xinelu.common.utils;
|
||||
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Objects;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
@ -157,4 +160,45 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
|
||||
return Date.from(zdt.toInstant());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期的结束时间
|
||||
*
|
||||
* @param date 指定日期,如果为null,默认为当天
|
||||
* @return 结束日期
|
||||
* @author jihan
|
||||
*/
|
||||
public static LocalDateTime end(LocalDate date) {
|
||||
return LocalDateTime.of(null == date ? LocalDate.now() : date, LocalTime.MAX);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换日期到字符串
|
||||
*
|
||||
* @param date LocalDate
|
||||
* @param pattern 解析格式
|
||||
* @return 日期字符串
|
||||
* @Author jihan
|
||||
*/
|
||||
public static String formatDateToString(LocalDate date, String pattern) {
|
||||
if (Objects.isNull(date)) {
|
||||
throw new IllegalArgumentException("date time is null.");
|
||||
}
|
||||
return date.format(StringUtils.isNotBlank(pattern) ? DateTimeFormatter.ofPattern(pattern) : DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算两个时间的分钟差
|
||||
*
|
||||
* @param beginTime 开始时间
|
||||
* @param endTime 结束时间可以为null, 如果为null则表示now
|
||||
* @return 分钟差值
|
||||
* @author jihan
|
||||
*/
|
||||
public static long differenceMinutes(LocalDateTime beginTime, LocalDateTime endTime) {
|
||||
if (null == beginTime) {
|
||||
throw new IllegalArgumentException("开始时间不能为空");
|
||||
}
|
||||
return ChronoUnit.MINUTES.between(beginTime, null == endTime ? LocalDateTime.now() : endTime);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,81 @@
|
||||
package com.xinelu.common.utils.codes;
|
||||
|
||||
import com.xinelu.common.utils.DateUtils;
|
||||
import java.text.DecimalFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @Description 编号工具类
|
||||
* @Author 纪寒
|
||||
* @Date 2022-08-02 18:13:55
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Component
|
||||
public class GenerateSystemCodeUtil {
|
||||
|
||||
@Resource
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
/**
|
||||
* 使用Redis生成唯一不重复的编码
|
||||
*
|
||||
* @param prefixCode 编号前缀
|
||||
* @return 编号信息 MMdd
|
||||
*/
|
||||
public String generatePatientCode(String prefixCode) {
|
||||
DecimalFormat df = new DecimalFormat("0000");
|
||||
String dateFmt = DateUtils.formatDateToString(LocalDate.now(), "MMdd");
|
||||
Long maxVal = redisTemplate.opsForValue().increment(prefixCode, 1);
|
||||
//redis有效期开始时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
//redis有效期结束时间
|
||||
LocalDateTime end = DateUtils.end(LocalDate.now());
|
||||
redisTemplate.expire(prefixCode, DateUtils.differenceMinutes(now, end), TimeUnit.MINUTES);
|
||||
return dateFmt + df.format(maxVal);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 使用Redis生成唯一不重复的编码
|
||||
*
|
||||
* @param prefixCode 编号前缀
|
||||
* @return 编号信息 yyyyMMdd
|
||||
*/
|
||||
public String generateSystemCode(String prefixCode) {
|
||||
DecimalFormat df = new DecimalFormat("0000");
|
||||
String dateFmt = DateUtils.formatDateToString(LocalDate.now(), "yyyyMMdd");
|
||||
Long maxVal = redisTemplate.opsForValue().increment(prefixCode, 1);
|
||||
//redis有效期开始时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
//redis有效期结束时间
|
||||
LocalDateTime end = DateUtils.end(LocalDate.now());
|
||||
redisTemplate.expire(prefixCode, DateUtils.differenceMinutes(now, end), TimeUnit.MINUTES);
|
||||
return dateFmt + df.format(maxVal);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成科室编码
|
||||
*
|
||||
* @param prefixCode 科室名称前缀
|
||||
* @return 科室编码
|
||||
*/
|
||||
public String generateDepartCode(String prefixCode) {
|
||||
DecimalFormat df = new DecimalFormat("00000");
|
||||
String dateFmt = DateUtils.formatDateToString(LocalDate.now(), "yyyy");
|
||||
Long maxVal = redisTemplate.opsForValue().increment(prefixCode, 1);
|
||||
//redis有效期开始时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
//redis有效期结束时间
|
||||
LocalDateTime end = DateUtils.end(LocalDate.now().plusYears(0).with(TemporalAdjusters.lastDayOfYear()));
|
||||
redisTemplate.expire(prefixCode, DateUtils.differenceMinutes(now, end), TimeUnit.MINUTES);
|
||||
return dateFmt + df.format(maxVal);
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,11 @@ import com.xinelu.common.config.XinELuConfig;
|
||||
import com.xinelu.common.utils.DateUtils;
|
||||
import com.xinelu.common.utils.StringUtils;
|
||||
import com.xinelu.common.utils.uuid.IdUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
@ -22,6 +27,16 @@ import java.nio.charset.StandardCharsets;
|
||||
public class FileUtils {
|
||||
public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+";
|
||||
|
||||
/**
|
||||
* 匹配content中的<img />标签
|
||||
**/
|
||||
private static final String PATTEN_IMG = "<(img|IMG)(.*?)(/>|></img>|>)";
|
||||
|
||||
/**
|
||||
* 匹配<img />标签中的src
|
||||
**/
|
||||
private static final String PATTEN_SRC = "(src|SRC)=(\"|\')(.*?)(\"|\')";
|
||||
|
||||
/**
|
||||
* 输出指定文件的byte数组
|
||||
*
|
||||
@ -243,4 +258,38 @@ public class FileUtils {
|
||||
return baseName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取img标签中的src值
|
||||
*
|
||||
* @param content img的内容
|
||||
* @return List<String>
|
||||
*/
|
||||
public static List<String> getImgSrc(String content) {
|
||||
if (StringUtils.isBlank(content)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<String> list = new ArrayList<>();
|
||||
//开始匹配content中的<img />标签
|
||||
Pattern pImg = Pattern.compile(PATTEN_IMG);
|
||||
Matcher mImg = pImg.matcher(content);
|
||||
boolean resultImg = mImg.find();
|
||||
if (resultImg) {
|
||||
while (resultImg) {
|
||||
//获取到匹配的<img />标签中的内容
|
||||
String strImg = mImg.group(2);
|
||||
//开始匹配<img />标签中的src
|
||||
Pattern pSrc = Pattern.compile(PATTEN_SRC);
|
||||
Matcher mSrc = pSrc.matcher(strImg);
|
||||
if (mSrc.find()) {
|
||||
String strSrc = mSrc.group(3);
|
||||
if (StringUtils.isNotBlank(strSrc)) {
|
||||
list.add(strSrc);
|
||||
}
|
||||
}
|
||||
//匹配content中是否存在下一个<img />标签,有则继续以上步骤匹配<img />标签中的src
|
||||
resultImg = mImg.find();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
package com.xinelu.common.utils.regex;
|
||||
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import java.util.regex.Pattern;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @Description 正则表达式工具类
|
||||
* @Author 纪寒
|
||||
* @Date 2022-08-24 13:58:48
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Component
|
||||
public class RegexUtil {
|
||||
|
||||
/**
|
||||
* 校验手机号码
|
||||
*
|
||||
* @param phone 手机号码
|
||||
* @return 校验结果
|
||||
*/
|
||||
public boolean regexPhone(String phone) {
|
||||
if (StringUtils.isBlank(phone)) {
|
||||
throw new ServiceException("手机号码不能为空!");
|
||||
}
|
||||
//校验手机号
|
||||
String regex = "^(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(16[2567]{1})|(17[0-9]{1})|(18[0-9]{1})|(19[0-9]{1}))+\\d{8})$";
|
||||
return Pattern.matches(regex, phone);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验身份证号码
|
||||
*
|
||||
* @param cardNo 身份证号码
|
||||
* @return 校验结果
|
||||
*/
|
||||
public boolean regexCardNo(String cardNo) {
|
||||
if (StringUtils.isBlank(cardNo)) {
|
||||
throw new ServiceException("身份证号不能为空!");
|
||||
}
|
||||
//校验身份证号码
|
||||
String regex = "(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|" +
|
||||
"(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)";
|
||||
return Pattern.matches(regex, cardNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验座机手机号码
|
||||
*
|
||||
* @param seatNumber 座机手机号码
|
||||
* @return 校验结果
|
||||
*/
|
||||
public boolean regexSeatNumber(String seatNumber) {
|
||||
if (StringUtils.isBlank(seatNumber)) {
|
||||
throw new ServiceException("手机号码不能为空!");
|
||||
}
|
||||
//校验座机手机号
|
||||
String regex = "^(([0-9]{4,13}))";
|
||||
return Pattern.matches(regex, seatNumber);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
package com.xinelu.manage.controller.hospitaldepartmentinfo;
|
||||
|
||||
import com.xinelu.common.annotation.Log;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.custominterface.Update;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
import com.xinelu.manage.dto.hospitaldepartmentinfo.HospitalDepartmentDTO;
|
||||
import com.xinelu.manage.domain.hospitaldepartmentinfo.HospitalDepartmentInfo;
|
||||
import com.xinelu.manage.service.hospitaldepartmentinfo.IHospitalDepartmentInfoService;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 科室信息管理Controller
|
||||
*
|
||||
* @author zh
|
||||
* @date 2023-02-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/hospitalDepartment")
|
||||
public class HospitalDepartmentInfoController extends BaseController {
|
||||
@Resource
|
||||
private IHospitalDepartmentInfoService hospitalDepartmentInfoService;
|
||||
|
||||
/**
|
||||
* 查询科室信息管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalDepartment:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HospitalDepartmentInfo hospitalDepartmentInfo) {
|
||||
startPage();
|
||||
List<HospitalDepartmentInfo> list = hospitalDepartmentInfoService.selectHospitalDepartmentInfoList(hospitalDepartmentInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出科室信息管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalDepartment:export')")
|
||||
@Log(title = "科室信息管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HospitalDepartmentInfo hospitalDepartmentInfo) {
|
||||
List<HospitalDepartmentInfo> list = hospitalDepartmentInfoService.selectHospitalDepartmentInfoList(hospitalDepartmentInfo);
|
||||
ExcelUtil<HospitalDepartmentInfo> util = new ExcelUtil<>(HospitalDepartmentInfo.class);
|
||||
util.exportExcel(response, list, "科室信息管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取科室信息管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalDepartment:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(hospitalDepartmentInfoService.selectHospitalDepartmentInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增科室信息管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalDepartment:add')")
|
||||
@Log(title = "科室信息管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@Validated(Insert.class) @RequestBody HospitalDepartmentDTO hospitalDepartment) {
|
||||
return hospitalDepartmentInfoService.insertHospitalDepartmentInfo(hospitalDepartment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改科室信息管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalDepartment:edit')")
|
||||
@Log(title = "科室信息管理", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@Validated(Update.class) @RequestBody HospitalDepartmentInfo hospitalDepartmentInfo) {
|
||||
return hospitalDepartmentInfoService.updateHospitalDepartmentInfo(hospitalDepartmentInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除科室信息管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalDepartment:remove')")
|
||||
@Log(title = "科室信息管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(hospitalDepartmentInfoService.deleteHospitalDepartmentInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,101 @@
|
||||
package com.xinelu.manage.controller.hospitalinfo;
|
||||
|
||||
import com.xinelu.common.annotation.Log;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.custominterface.Update;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
import com.xinelu.manage.domain.hospitalinfo.HospitalInfo;
|
||||
import com.xinelu.manage.service.hospitalinfo.IHospitalInfoService;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* 医院信息管理Controller
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-02-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/hospital")
|
||||
public class HospitalInfoController extends BaseController {
|
||||
@Resource
|
||||
private IHospitalInfoService hospitalInfoService;
|
||||
|
||||
/**
|
||||
* 查询医院信息管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospital:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HospitalInfo hospitalInfo) {
|
||||
startPage();
|
||||
List<HospitalInfo> list = hospitalInfoService.selectHospitalInfoList(hospitalInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出医院信息管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospital:export')")
|
||||
@Log(title = "医院信息管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HospitalInfo hospitalInfo) {
|
||||
List<HospitalInfo> list = hospitalInfoService.selectHospitalInfoList(hospitalInfo);
|
||||
ExcelUtil<HospitalInfo> util = new ExcelUtil<>(HospitalInfo.class);
|
||||
util.exportExcel(response, list, "医院信息管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医院信息管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospital:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(hospitalInfoService.selectHospitalInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增医院信息管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospital:add')")
|
||||
@Log(title = "医院信息管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(Insert.class) HospitalInfo hospitalInfo) {
|
||||
return hospitalInfoService.insertHospitalInfo(hospitalInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改医院信息管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospital:edit')")
|
||||
@Log(title = "医院信息管理", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody @Validated(Update.class) HospitalInfo hospitalInfo) {
|
||||
return hospitalInfoService.updateHospitalInfo(hospitalInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除医院信息管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospital:remove')")
|
||||
@Log(title = "医院信息管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return hospitalInfoService.deleteHospitalInfoByIds(ids);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
package com.xinelu.manage.controller.hospitalpersoncertificate;
|
||||
|
||||
import com.xinelu.common.annotation.Log;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.custominterface.Update;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
import com.xinelu.manage.dto.hospitalpersoncertificate.HospitalPersonCertificateDTO;
|
||||
import com.xinelu.manage.service.hospitalpersoncertificate.IHospitalPersonCertificateService;
|
||||
import com.xinelu.manage.vo.hospitalpersoncertificate.HospitalPersonCertificateVO;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 健康咨询-科室人员资质证书信息Controller
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-02-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/certificate")
|
||||
public class HospitalPersonCertificateController extends BaseController {
|
||||
@Resource
|
||||
private IHospitalPersonCertificateService hospitalPersonCertificateService;
|
||||
|
||||
/**
|
||||
* 查询健康咨询-科室人员资质证书信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:certificate:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HospitalPersonCertificateDTO hospitalPersonCertificate) {
|
||||
startPage();
|
||||
List<HospitalPersonCertificateVO> list = hospitalPersonCertificateService.selectHospitalPersonCertificateList(hospitalPersonCertificate);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出健康咨询-科室人员资质证书信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:certificate:export')")
|
||||
@Log(title = "健康咨询-科室人员资质证书信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HospitalPersonCertificateDTO hospitalPersonCertificate) {
|
||||
List<HospitalPersonCertificateVO> list = hospitalPersonCertificateService.selectHospitalPersonCertificateList(hospitalPersonCertificate);
|
||||
ExcelUtil<HospitalPersonCertificateVO> util = new ExcelUtil<>(HospitalPersonCertificateVO.class);
|
||||
util.exportExcel(response, list, "健康咨询-科室人员资质证书信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取健康咨询-科室人员资质证书信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:certificate:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(hospitalPersonCertificateService.selectHospitalPersonCertificateById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增健康咨询-科室人员资质证书信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:certificate:add')")
|
||||
@Log(title = "健康咨询-科室人员资质证书信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@Validated(Insert.class) @RequestBody HospitalPersonCertificateDTO hospitalPersonCertificate) {
|
||||
return hospitalPersonCertificateService.insertHospitalPersonCertificate(hospitalPersonCertificate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改健康咨询-科室人员资质证书信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:certificate:edit')")
|
||||
@Log(title = "健康咨询-科室人员资质证书信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@Validated(Update.class) @RequestBody HospitalPersonCertificateDTO hospitalPersonCertificate) {
|
||||
return hospitalPersonCertificateService.updateHospitalPersonCertificate(hospitalPersonCertificate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除健康咨询-科室人员资质证书信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:certificate:remove')")
|
||||
@Log(title = "健康咨询-科室人员资质证书信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(hospitalPersonCertificateService.deleteHospitalPersonCertificateByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
package com.xinelu.manage.controller.hospitalpersoninfo;
|
||||
|
||||
import com.xinelu.common.annotation.Log;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.custominterface.Update;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDTO;
|
||||
import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService;
|
||||
import com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 健康咨询-科室人员信息Controller
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-02-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/hospitalPerson")
|
||||
public class HospitalPersonInfoController extends BaseController {
|
||||
@Resource
|
||||
private IHospitalPersonInfoService hospitalPersonInfoService;
|
||||
|
||||
/**
|
||||
* 查询健康咨询-科室人员信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalPerson:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HospitalPersonInfoVO hospitalPersonInfo) {
|
||||
startPage();
|
||||
List<HospitalPersonInfoVO> list = hospitalPersonInfoService.selectHospitalPersonInfoList(hospitalPersonInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出健康咨询-科室人员信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalPerson:export')")
|
||||
@Log(title = "健康咨询-科室人员信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HospitalPersonInfoVO hospitalPersonInfo) {
|
||||
List<HospitalPersonInfoVO> list = hospitalPersonInfoService.selectHospitalPersonInfoList(hospitalPersonInfo);
|
||||
ExcelUtil<HospitalPersonInfoVO> util = new ExcelUtil<>(HospitalPersonInfoVO.class);
|
||||
util.exportExcel(response, list, "健康咨询-科室人员信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取健康咨询-科室人员信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalPerson:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(hospitalPersonInfoService.selectHospitalPersonInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增健康咨询-科室人员信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalPerson:add')")
|
||||
@Log(title = "健康咨询-科室人员信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@Validated(Insert.class) @RequestBody HospitalPersonInfoDTO hospitalPersonInfo) {
|
||||
return hospitalPersonInfoService.insertHospitalPersonInfo(hospitalPersonInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改健康咨询-科室人员信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalPerson:edit')")
|
||||
@Log(title = "健康咨询-科室人员信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@Validated(Update.class) @RequestBody HospitalPersonInfoDTO hospitalPersonInfo) {
|
||||
return hospitalPersonInfoService.updateHospitalPersonInfo(hospitalPersonInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除健康咨询-科室人员信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalPerson:remove')")
|
||||
@Log(title = "健康咨询-科室人员信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return hospitalPersonInfoService.deleteHospitalPersonInfoByIds(ids);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,152 @@
|
||||
package com.xinelu.manage.domain.hospitaldepartmentinfo;
|
||||
|
||||
import com.xinelu.common.annotation.Excel;
|
||||
import com.xinelu.common.core.domain.BaseDomain;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.custominterface.Update;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.Objects;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
/**
|
||||
* 科室信息管理对象 hospital_department_info
|
||||
*
|
||||
* @author zh
|
||||
* @date 2023-02-13
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "科室信息管理对象", description = "hospital_department_info")
|
||||
public class HospitalDepartmentInfo extends BaseDomain {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 父级科室id
|
||||
*/
|
||||
@ApiModelProperty(value = "父级科室id")
|
||||
@Excel(name = "父级科室id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 医院表id
|
||||
*/
|
||||
@ApiModelProperty(value = "医院表id")
|
||||
@Excel(name = "医院表id")
|
||||
@NotNull(message = "医院信息不能为空", groups = {Insert.class, Update.class})
|
||||
private Long hospitalId;
|
||||
|
||||
/**
|
||||
* 医院名称
|
||||
*/
|
||||
@ApiModelProperty(value = "医院名称")
|
||||
@Excel(name = "医院名称")
|
||||
@NotBlank(message = "医院名称不能为空", groups = {Insert.class, Update.class})
|
||||
private String hospitalName;
|
||||
|
||||
/**
|
||||
* 科室编码
|
||||
*/
|
||||
@ApiModelProperty(value = "科室编码")
|
||||
@Excel(name = "科室编码")
|
||||
private String departmentCode;
|
||||
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
@ApiModelProperty(value = "科室名称")
|
||||
@Excel(name = "科室名称")
|
||||
@NotBlank(message = "科室名称不能为空", groups = {Insert.class, Update.class})
|
||||
@Length(max = 50, message = "科室名称不能超过50位", groups = {Insert.class, Update.class})
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
* 科室联系电话,手机号或者座机号
|
||||
*/
|
||||
@ApiModelProperty(value = "科室联系电话,手机号或者座机号")
|
||||
@Excel(name = "科室联系电话,手机号或者座机号")
|
||||
private String departmentPhone;
|
||||
|
||||
/**
|
||||
* 科室负责人名称
|
||||
*/
|
||||
@ApiModelProperty(value = "科室负责人名称")
|
||||
@Excel(name = "科室负责人名称")
|
||||
@Length(max = 20, message = "科室负责人名称不能超过20位", groups = { Insert.class, Update.class})
|
||||
private String departmentPerson;
|
||||
|
||||
/**
|
||||
* 科室地址
|
||||
*/
|
||||
@ApiModelProperty(value = "科室地址")
|
||||
@Excel(name = "科室地址")
|
||||
@NotBlank(message = "科室地址不能为空", groups = {Insert.class, Update.class})
|
||||
@Length(max = 300, message = "科室地址不能超过300位", groups = {Insert.class, Update.class})
|
||||
private String departmentAddress;
|
||||
|
||||
/**
|
||||
* 科室显示级别
|
||||
*/
|
||||
@ApiModelProperty(value = "科室显示级别")
|
||||
@Excel(name = "科室显示级别")
|
||||
private Integer departmentLevel;
|
||||
|
||||
/**
|
||||
* 科室显示顺序
|
||||
*/
|
||||
@ApiModelProperty(value = "科室显示顺序")
|
||||
@Excel(name = "科室显示顺序")
|
||||
@NotNull(message = "科室显示顺序不能为空", groups = {Insert.class, Update.class})
|
||||
private Integer departmentSort;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
HospitalDepartmentInfo that = (HospitalDepartmentInfo) o;
|
||||
return Objects.equals(hospitalId, that.hospitalId) && Objects.equals(departmentName, that.departmentName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(hospitalId, departmentName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("parentId", getParentId())
|
||||
.append("hospitalId", getHospitalId())
|
||||
.append("hospitalName", getHospitalName())
|
||||
.append("departmentCode", getDepartmentCode())
|
||||
.append("departmentName", getDepartmentName())
|
||||
.append("departmentPhone", getDepartmentPhone())
|
||||
.append("departmentPerson", getDepartmentPerson())
|
||||
.append("departmentAddress", getDepartmentAddress())
|
||||
.append("departmentLevel", getDepartmentLevel())
|
||||
.append("departmentSort", getDepartmentSort())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,105 @@
|
||||
package com.xinelu.manage.domain.hospitalinfo;
|
||||
|
||||
import com.xinelu.common.annotation.Excel;
|
||||
import com.xinelu.common.core.domain.BaseDomain;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.custominterface.Update;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
/**
|
||||
* 健康咨询-医院信息对象 hospital_info
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-02-13
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "健康咨询-医院信息对象", description = "hospital_info")
|
||||
public class HospitalInfo extends BaseDomain implements Serializable {
|
||||
private static final long serialVersionUID = -8171198728231183571L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 医院名称
|
||||
*/
|
||||
@ApiModelProperty(value = "医院名称")
|
||||
@Excel(name = "医院名称")
|
||||
@NotBlank(message = "医院名称不能为空", groups = { Insert.class, Update.class})
|
||||
@Length(max = 50, message = "医院名称不能超过50位", groups = {Insert.class, Update.class})
|
||||
private String hospitalName;
|
||||
|
||||
/**
|
||||
* 医院编码
|
||||
*/
|
||||
@ApiModelProperty(value = "医院编码")
|
||||
@Excel(name = "医院编码")
|
||||
private String hospitalCode;
|
||||
|
||||
/**
|
||||
* 医院地址
|
||||
*/
|
||||
@ApiModelProperty(value = "医院地址")
|
||||
@Excel(name = "医院地址")
|
||||
@NotBlank(message = "医院地址不能为空", groups = {Insert.class, Update.class})
|
||||
@Length(max = 300, message = "医院地址不能超过300位", groups = {Insert.class, Update.class})
|
||||
private String hospitalAddress;
|
||||
|
||||
/**
|
||||
* 联系电话,手机号或者座机
|
||||
*/
|
||||
@ApiModelProperty(value = "联系电话,手机号或者座机")
|
||||
@Excel(name = "联系电话,手机号或者座机")
|
||||
@NotBlank(message = "联系电话不能为空", groups = {Insert.class, Update.class})
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 医院简介,包含基本信息和医院图片富文本
|
||||
*/
|
||||
@ApiModelProperty(value = "医院简介,包含基本信息和医院图片富文本")
|
||||
@Excel(name = "医院简介,包含基本信息和医院图片富文本")
|
||||
@NotBlank(message = "医院简介不能为空", groups = {Insert.class, Update.class})
|
||||
private String hospitalIntroduce;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@ApiModelProperty(value = "显示顺序")
|
||||
@Excel(name = "显示顺序")
|
||||
@NotNull(message = "显示顺序不能为空", groups = {Insert.class, Update.class})
|
||||
private Integer hospitalSort;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("hospitalName", getHospitalName())
|
||||
.append("hospitalCode", getHospitalCode())
|
||||
.append("hospitalAddress", getHospitalAddress())
|
||||
.append("phone", getPhone())
|
||||
.append("hospitalIntroduce", getHospitalIntroduce())
|
||||
.append("hospitalSort", getHospitalSort())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package com.xinelu.manage.domain.hospitalpersoncertificate;
|
||||
|
||||
import com.xinelu.common.annotation.Excel;
|
||||
import com.xinelu.common.core.domain.BaseDomain;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.custominterface.Update;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
/**
|
||||
* 健康咨询-科室人员资质证书信息对象 hospital_person_certificate
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-02-23
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "健康咨询-科室人员资质证书信息对象", description = "hospital_person_certificate")
|
||||
public class HospitalPersonCertificate extends BaseDomain implements Serializable {
|
||||
private static final long serialVersionUID = -7652289041354453152L;
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 科室人员表id
|
||||
*/
|
||||
@ApiModelProperty(value = "科室人员表id")
|
||||
@Excel(name = "科室人员表id")
|
||||
private Long hospitalPersonId;
|
||||
|
||||
/**
|
||||
* 证书名称
|
||||
*/
|
||||
@ApiModelProperty(value = "证书名称")
|
||||
@Excel(name = "证书名称")
|
||||
@Length(max = 50, message = "证书名称不能超过50位", groups = { Insert.class, Update.class})
|
||||
private String certificateName;
|
||||
|
||||
/**
|
||||
* 证书编号
|
||||
*/
|
||||
@ApiModelProperty(value = "证书编号")
|
||||
@Excel(name = "证书编号")
|
||||
private String certificateCode;
|
||||
|
||||
/**
|
||||
* 证书图片存放路径
|
||||
*/
|
||||
@ApiModelProperty(value = "证书图片存放路径")
|
||||
@Excel(name = "证书图片存放路径")
|
||||
private String certificateUrl;
|
||||
|
||||
/**
|
||||
* 证书显示顺序
|
||||
*/
|
||||
@ApiModelProperty(value = "证书显示顺序")
|
||||
@Excel(name = "证书显示顺序")
|
||||
private Integer certificateSort;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("hospitalPersonId", getHospitalPersonId())
|
||||
.append("certificateName", getCertificateName())
|
||||
.append("certificateCode", getCertificateCode())
|
||||
.append("certificateUrl", getCertificateUrl())
|
||||
.append("certificateSort", getCertificateSort())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,153 @@
|
||||
package com.xinelu.manage.domain.hospitalpersoninfo;
|
||||
|
||||
import com.xinelu.common.annotation.Excel;
|
||||
import com.xinelu.common.core.domain.BaseDomain;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.custominterface.Update;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
/**
|
||||
* 健康咨询-科室人员信息对象 hospital_person_info
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-02-14
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "健康咨询-科室人员信息对象", description = "hospital_person_info")
|
||||
public class HospitalPersonInfo extends BaseDomain implements Serializable {
|
||||
private static final long serialVersionUID = 8750821883343940709L;
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属医院id
|
||||
*/
|
||||
@ApiModelProperty(value = "所属医院id")
|
||||
@Excel(name = "所属医院id")
|
||||
@NotNull(message = "所属医院不能为空!", groups = {Insert.class, Update.class})
|
||||
private Long hospitalId;
|
||||
|
||||
/**
|
||||
* 所属部门id
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门id")
|
||||
@Excel(name = "所属部门id")
|
||||
@NotNull(message = "所属部门不能为空!", groups = {Insert.class, Update.class})
|
||||
private Long departmentId;
|
||||
|
||||
/**
|
||||
* 科室人员编码
|
||||
*/
|
||||
@ApiModelProperty(value = "科室人员编码")
|
||||
@Excel(name = "科室人员编码")
|
||||
private String personCode;
|
||||
|
||||
/**
|
||||
* 科室人员名称
|
||||
*/
|
||||
@ApiModelProperty(value = "科室人员名称")
|
||||
@Excel(name = "科室人员名称")
|
||||
@NotBlank(message = "科室人员名称不能为空!", groups = { Insert.class, Update.class})
|
||||
@Length(max = 50, message = "科室人员名称不能超过50位", groups = {Insert.class, Update.class})
|
||||
private String personName;
|
||||
|
||||
/**
|
||||
* 科室人员联系电话
|
||||
*/
|
||||
@ApiModelProperty(value = "科室人员联系电话")
|
||||
@Excel(name = "科室人员联系电话")
|
||||
private String personPhone;
|
||||
|
||||
/**
|
||||
* 科室人员地址
|
||||
*/
|
||||
@ApiModelProperty(value = "科室人员地址")
|
||||
@Excel(name = "科室人员地址")
|
||||
@NotBlank(message = "科室人员地址不能为空!", groups = {Insert.class, Update.class})
|
||||
@Length(max = 300, message = "科室人员地址不能超过300位", groups = {Insert.class, Update.class})
|
||||
private String personAddress;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
@ApiModelProperty(value = "身份证号")
|
||||
@Excel(name = "身份证号")
|
||||
private String cardNo;
|
||||
|
||||
/**
|
||||
* 人员职称,主任医师:CHIEF_PHYSICIAN,副主任医师:DEPUTY_CHIEF_PHYSICIAN,主治医师:ATTENDING_DOCTOR,医师:PHYSICIAN,医士:HEALER,住院医师:RESIDENT_PHYSICIAN
|
||||
*/
|
||||
@ApiModelProperty(value = "人员职称,主任医师:CHIEF_PHYSICIAN,副主任医师:DEPUTY_CHIEF_PHYSICIAN,主治医师:ATTENDING_DOCTOR,医师:PHYSICIAN,医士:HEALER,住院医师:RESIDENT_PHYSICIAN")
|
||||
@Excel(name = "人员职称,主任医师:CHIEF_PHYSICIAN,副主任医师:DEPUTY_CHIEF_PHYSICIAN,主治医师:ATTENDING_DOCTOR,医师:PHYSICIAN,医士:HEALER,住院医师:RESIDENT_PHYSICIAN")
|
||||
@NotBlank(message = "人员职称不能为空!", groups = {Insert.class, Update.class})
|
||||
private String academicTitle;
|
||||
|
||||
/**
|
||||
* 咨询费用
|
||||
*/
|
||||
@ApiModelProperty(value = "咨询费用")
|
||||
@Excel(name = "咨询费用")
|
||||
@NotNull(message = "咨询费用不能为空", groups = {Insert.class, Update.class})
|
||||
private BigDecimal consultingFee;
|
||||
|
||||
/**
|
||||
* 个人简介
|
||||
*/
|
||||
@ApiModelProperty(value = "个人简介")
|
||||
@Excel(name = "个人简介")
|
||||
@NotBlank(message = "个人简介不能为空!", groups = {Insert.class, Update.class})
|
||||
private String personIntroduce;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@ApiModelProperty(value = "显示顺序")
|
||||
@Excel(name = "显示顺序")
|
||||
@NotNull(message = "显示顺序不能为空", groups = {Insert.class, Update.class})
|
||||
private Integer personSort;
|
||||
|
||||
/**
|
||||
* 科室人员头像地址
|
||||
*/
|
||||
private String personPictureUrl;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("hospitalId", getHospitalId())
|
||||
.append("departmentId", getDepartmentId())
|
||||
.append("personCode", getPersonCode())
|
||||
.append("personName", getPersonName())
|
||||
.append("personPhone", getPersonPhone())
|
||||
.append("personAddress", getPersonAddress())
|
||||
.append("cardNo", getCardNo())
|
||||
.append("academicTitle", getAcademicTitle())
|
||||
.append("consultingFee", getConsultingFee())
|
||||
.append("personIntroduce", getPersonIntroduce())
|
||||
.append("personSort", getPersonSort())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.xinelu.manage.dto.hospitaldepartmentinfo;
|
||||
|
||||
import com.xinelu.manage.domain.hospitaldepartmentinfo.HospitalDepartmentInfo;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 科室信息管理对象DTO
|
||||
*
|
||||
* @author zh
|
||||
* @date 2023-02-13
|
||||
*/
|
||||
@Data
|
||||
public class HospitalDepartmentDTO implements Serializable {
|
||||
private static final long serialVersionUID = -1068399981009897805L;
|
||||
|
||||
/**
|
||||
* 科室信息管理对象传入集合
|
||||
*/
|
||||
@Valid
|
||||
private List<HospitalDepartmentInfo> hospitalDepartmentInfoList;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.xinelu.manage.dto.hospitalpersoncertificate;
|
||||
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.custominterface.Update;
|
||||
import java.io.Serializable;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author ljh
|
||||
* @version 1.0
|
||||
* Create by 2023/2/24 14:59
|
||||
*/
|
||||
@Data
|
||||
public class CertificateUrlDTO implements Serializable {
|
||||
private static final long serialVersionUID = -7621645853517636891L;
|
||||
|
||||
/**
|
||||
* 证书图片存放路径
|
||||
*/
|
||||
@NotBlank(message = "证书图片存放路径不能为空", groups = { Insert.class, Update.class})
|
||||
private String certificateUrl;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.xinelu.manage.dto.hospitalpersoncertificate;
|
||||
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.custominterface.Update;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author ljh
|
||||
* @version 1.0
|
||||
* Create by 2023/2/24 14:37
|
||||
*/
|
||||
@Data
|
||||
public class HospitalPersonCertificateDTO implements Serializable {
|
||||
private static final long serialVersionUID = 8519380217374904308L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 科室人员表id
|
||||
*/
|
||||
@NotNull(message = "科室人员表id不能为空", groups = { Insert.class, Update.class})
|
||||
private Long hospitalPersonId;
|
||||
|
||||
/**
|
||||
* 证书名称
|
||||
*/
|
||||
@NotBlank(message = "科室人员表id不能为空", groups = {Insert.class, Update.class})
|
||||
private String certificateName;
|
||||
|
||||
/**
|
||||
* 证书编号
|
||||
*/
|
||||
private String certificateCode;
|
||||
|
||||
/**
|
||||
* 证书图片存放路径
|
||||
*/
|
||||
private String certificateUrl;
|
||||
|
||||
/**
|
||||
* 证书显示顺序
|
||||
*/
|
||||
@NotNull(message = "证书显示顺序不能为空", groups = {Insert.class, Update.class})
|
||||
private Integer certificateSort;
|
||||
|
||||
/**
|
||||
* 人员名称
|
||||
*/
|
||||
private String personName;
|
||||
|
||||
/**
|
||||
* 证书图片存放路径集合
|
||||
*/
|
||||
private List<CertificateUrlDTO> certificateUrlList;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.xinelu.manage.dto.hospitalpersoninfo;
|
||||
|
||||
import com.xinelu.manage.domain.hospitalpersoncertificate.HospitalPersonCertificate;
|
||||
import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author ljh
|
||||
* @version 1.0
|
||||
* Create by 2023/2/16 8:58
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class HospitalPersonInfoDTO extends HospitalPersonInfo implements Serializable {
|
||||
private static final long serialVersionUID = 326904841009413976L;
|
||||
|
||||
/**
|
||||
* 健康咨询-科室人员证书信息对象集合
|
||||
**/
|
||||
@Valid
|
||||
private List<HospitalPersonCertificate> hospitalPersonCertificateList;
|
||||
|
||||
}
|
||||
@ -0,0 +1,86 @@
|
||||
package com.xinelu.manage.mapper.hospitaldepartmentinfo;
|
||||
|
||||
import com.xinelu.manage.domain.hospitaldepartmentinfo.HospitalDepartmentInfo;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 科室信息管理Mapper接口
|
||||
*
|
||||
* @author zh
|
||||
* @date 2023-02-13
|
||||
*/
|
||||
public interface HospitalDepartmentInfoMapper {
|
||||
/**
|
||||
* 查询科室信息管理
|
||||
*
|
||||
* @param id 科室信息管理主键
|
||||
* @return 科室信息管理
|
||||
*/
|
||||
HospitalDepartmentInfo selectHospitalDepartmentInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询科室信息管理列表
|
||||
*
|
||||
* @param hospitalDepartmentInfo 科室信息管理
|
||||
* @return 科室信息管理集合
|
||||
*/
|
||||
List<HospitalDepartmentInfo> selectHospitalDepartmentInfoList(HospitalDepartmentInfo hospitalDepartmentInfo);
|
||||
|
||||
/**
|
||||
* 新增科室信息管理
|
||||
*
|
||||
* @param hospitalDepartmentInfo 科室信息管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertHospitalDepartmentInfo(HospitalDepartmentInfo hospitalDepartmentInfo);
|
||||
|
||||
/**
|
||||
* 修改科室信息管理
|
||||
*
|
||||
* @param hospitalDepartmentInfo 科室信息管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateHospitalDepartmentInfo(HospitalDepartmentInfo hospitalDepartmentInfo);
|
||||
|
||||
/**
|
||||
* 删除科室信息管理
|
||||
*
|
||||
* @param id 科室信息管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteHospitalDepartmentInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除科室信息管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteHospitalDepartmentInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量新增科室信息管理
|
||||
*
|
||||
* @param hospitalDepartmentInfoList 科室信息管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertHospitalDepartmentList(List<HospitalDepartmentInfo> hospitalDepartmentInfoList);
|
||||
|
||||
/**
|
||||
* 根据医院id及科室名称查询同科室名称数量
|
||||
*
|
||||
* @param hospitalId 医院id
|
||||
* @param departmentName 科室名称
|
||||
* @return 数量
|
||||
*/
|
||||
int selectHospitalDepartmentCount(@Param("hospitalId") Long hospitalId, @Param("departmentName") String departmentName);
|
||||
|
||||
/**
|
||||
* 查询当前医院下的所有科室信息
|
||||
*
|
||||
* @param hospitalIdList 医院id集合
|
||||
* @return 科学信息
|
||||
*/
|
||||
List<HospitalDepartmentInfo> getDepartmentInfoList(@Param("hospitalIdList") List<Long> hospitalIdList);
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
package com.xinelu.manage.mapper.hospitalinfo;
|
||||
|
||||
import com.xinelu.manage.domain.hospitalinfo.HospitalInfo;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 医院信息管理Mapper接口
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-02-13
|
||||
*/
|
||||
public interface HospitalInfoMapper {
|
||||
/**
|
||||
* 查询医院信息管理
|
||||
*
|
||||
* @param id 医院信息管理主键
|
||||
* @return 医院信息管理
|
||||
*/
|
||||
HospitalInfo selectHospitalInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询医院信息管理列表
|
||||
*
|
||||
* @param hospitalInfo 医院信息管理
|
||||
* @return 医院信息管理集合
|
||||
*/
|
||||
List<HospitalInfo> selectHospitalInfoList(HospitalInfo hospitalInfo);
|
||||
|
||||
/**
|
||||
* 新增医院信息管理
|
||||
*
|
||||
* @param hospitalInfo 医院信息管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertHospitalInfo(HospitalInfo hospitalInfo);
|
||||
|
||||
/**
|
||||
* 修改医院信息管理
|
||||
*
|
||||
* @param hospitalInfo 医院信息管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateHospitalInfo(HospitalInfo hospitalInfo);
|
||||
|
||||
/**
|
||||
* 删除医院信息管理
|
||||
*
|
||||
* @param id 医院信息管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteHospitalInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除医院信息管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteHospitalInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据传入医院名称查询是否有重复名称
|
||||
*
|
||||
* @param hospitalName 医院名称
|
||||
* @return 数量
|
||||
*/
|
||||
int selectHospitalNameCount(String hospitalName);
|
||||
|
||||
/**
|
||||
* 根据id批量查询医院信息
|
||||
*
|
||||
* @param ids id数组
|
||||
* @return List<HospitalInfo>
|
||||
*/
|
||||
List<HospitalInfo> selectHospitalList(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package com.xinelu.manage.mapper.hospitalpersoncertificate;
|
||||
|
||||
import com.xinelu.manage.dto.hospitalpersoncertificate.HospitalPersonCertificateDTO;
|
||||
import com.xinelu.manage.domain.hospitalpersoncertificate.HospitalPersonCertificate;
|
||||
import com.xinelu.manage.vo.hospitalpersoncertificate.HospitalPersonCertificateVO;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
/**
|
||||
* 健康咨询-科室人员资质证书信息Mapper接口
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-02-23
|
||||
*/
|
||||
public interface HospitalPersonCertificateMapper {
|
||||
/**
|
||||
* 查询健康咨询-科室人员资质证书信息
|
||||
*
|
||||
* @param id 健康咨询-科室人员资质证书信息主键
|
||||
* @return 健康咨询-科室人员资质证书信息
|
||||
*/
|
||||
List<HospitalPersonCertificateVO> selectHospitalPersonCertificateById(Long id);
|
||||
|
||||
/**
|
||||
* 查询健康咨询-科室人员资质证书信息列表
|
||||
*
|
||||
* @param hospitalPersonCertificate 健康咨询-科室人员资质证书信息
|
||||
* @return 健康咨询-科室人员资质证书信息集合
|
||||
*/
|
||||
List<HospitalPersonCertificateVO> selectHospitalPersonCertificateList(HospitalPersonCertificateDTO hospitalPersonCertificate);
|
||||
|
||||
/**
|
||||
* 新增健康咨询-科室人员资质证书信息
|
||||
*
|
||||
* @param hospitalPersonCertificate 健康咨询-科室人员资质证书信息
|
||||
* @return 结果
|
||||
*/
|
||||
int insertHospitalPersonCertificate(HospitalPersonCertificate hospitalPersonCertificate);
|
||||
|
||||
/**
|
||||
* 修改健康咨询-科室人员资质证书信息
|
||||
*
|
||||
* @param hospitalPersonCertificate 健康咨询-科室人员资质证书信息
|
||||
* @return 结果
|
||||
*/
|
||||
int updateHospitalPersonCertificate(HospitalPersonCertificate hospitalPersonCertificate);
|
||||
|
||||
/**
|
||||
* 删除健康咨询-科室人员资质证书信息
|
||||
*
|
||||
* @param id 健康咨询-科室人员资质证书信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteHospitalPersonCertificateById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除健康咨询-科室人员资质证书信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteHospitalPersonCertificateByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量新增健康咨询-科室人员资质证书信息
|
||||
*
|
||||
* @param hospitalPersonCertificateList 科室人员资质证书信息
|
||||
* @return int
|
||||
**/
|
||||
int insertHospitalPersonCertificateList(List<HospitalPersonCertificate> hospitalPersonCertificateList);
|
||||
|
||||
/**
|
||||
* 根据科室人员id查询科室人员资质证书信息
|
||||
*
|
||||
* @param hospitalPersonIdsList 科室人员资质证书信息
|
||||
* @return int
|
||||
**/
|
||||
List<HospitalPersonCertificate> selectHospitalPersonCertificateByIds(@Param("hospitalPersonIdsList") List<Long> hospitalPersonIdsList);
|
||||
|
||||
/**
|
||||
* 根据科室人员表id删除证书信息
|
||||
*
|
||||
* @param hospitalPersonIds 科室人员表id集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePersonCertificateByPersonIds(Long[] hospitalPersonIds);
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
package com.xinelu.manage.mapper.hospitalpersoninfo;
|
||||
|
||||
import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo;
|
||||
import com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
/**
|
||||
* 健康咨询-科室人员信息Mapper接口
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-02-14
|
||||
*/
|
||||
public interface HospitalPersonInfoMapper {
|
||||
/**
|
||||
* 查询健康咨询-科室人员信息
|
||||
*
|
||||
* @param id 健康咨询-科室人员信息主键
|
||||
* @return 健康咨询-科室人员信息
|
||||
*/
|
||||
HospitalPersonInfoVO selectHospitalPersonInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询健康咨询-科室人员信息列表
|
||||
*
|
||||
* @param hospitalPersonInfo 健康咨询-科室人员信息
|
||||
* @return 健康咨询-科室人员信息集合
|
||||
*/
|
||||
List<HospitalPersonInfoVO> selectHospitalPersonInfoList(HospitalPersonInfoVO hospitalPersonInfo);
|
||||
|
||||
/**
|
||||
* 新增健康咨询-科室人员信息
|
||||
*
|
||||
* @param hospitalPersonInfo 健康咨询-科室人员信息
|
||||
* @return 结果
|
||||
*/
|
||||
int insertHospitalPersonInfo(HospitalPersonInfo hospitalPersonInfo);
|
||||
|
||||
/**
|
||||
* 修改健康咨询-科室人员信息
|
||||
*
|
||||
* @param hospitalPersonInfo 健康咨询-科室人员信息
|
||||
* @return 结果
|
||||
*/
|
||||
int updateHospitalPersonInfo(HospitalPersonInfo hospitalPersonInfo);
|
||||
|
||||
/**
|
||||
* 删除健康咨询-科室人员信息
|
||||
*
|
||||
* @param id 健康咨询-科室人员信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteHospitalPersonInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除健康咨询-科室人员信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteHospitalPersonInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据传入名称查询是否有重复名称
|
||||
*
|
||||
* @param cardNo 身份证号
|
||||
* @return int
|
||||
**/
|
||||
int selectHospitalPersonInfoByCount(String cardNo);
|
||||
|
||||
/**
|
||||
* 根据科室人员id查询科室人员信息
|
||||
*
|
||||
* @param hospitalPersonIdsList 科室人员资质证书信息
|
||||
* @return int
|
||||
**/
|
||||
List<HospitalPersonInfo> selectHospitalPersonByIds(@Param("hospitalPersonIdsList") List<Long> hospitalPersonIdsList);
|
||||
|
||||
/**
|
||||
* 健康咨询 根据科室查询医院人员
|
||||
*
|
||||
* @param departmentId 科室人员信息
|
||||
* @return AjaxResult
|
||||
*/
|
||||
List<HospitalPersonInfo> selectHospitalPerson(Long departmentId);
|
||||
|
||||
/**
|
||||
* 根据科室人员id查询科室人员数量
|
||||
*
|
||||
* @param id 科室人员id
|
||||
* @return int
|
||||
**/
|
||||
int selectHospitalPersonInfoByIdCount(Long id);
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.xinelu.manage.service.hospitaldepartmentinfo;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.manage.dto.hospitaldepartmentinfo.HospitalDepartmentDTO;
|
||||
import com.xinelu.manage.domain.hospitaldepartmentinfo.HospitalDepartmentInfo;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 科室信息管理Service接口
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-02-13
|
||||
*/
|
||||
public interface IHospitalDepartmentInfoService {
|
||||
/**
|
||||
* 查询科室信息管理
|
||||
*
|
||||
* @param id 科室信息管理主键
|
||||
* @return 科室信息管理
|
||||
*/
|
||||
HospitalDepartmentInfo selectHospitalDepartmentInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询科室信息管理列表
|
||||
*
|
||||
* @param hospitalDepartmentInfo 科室信息管理
|
||||
* @return 科室信息管理集合
|
||||
*/
|
||||
List<HospitalDepartmentInfo> selectHospitalDepartmentInfoList(HospitalDepartmentInfo hospitalDepartmentInfo);
|
||||
|
||||
/**
|
||||
* 新增科室信息管理
|
||||
*
|
||||
* @param hospitalDepartment 科室信息管理
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult insertHospitalDepartmentInfo(HospitalDepartmentDTO hospitalDepartment);
|
||||
|
||||
/**
|
||||
* 修改科室信息管理
|
||||
*
|
||||
* @param hospitalDepartmentInfo 科室信息管理
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult updateHospitalDepartmentInfo(HospitalDepartmentInfo hospitalDepartmentInfo);
|
||||
|
||||
/**
|
||||
* 批量删除科室信息管理
|
||||
*
|
||||
* @param ids 需要删除的科室信息管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteHospitalDepartmentInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除科室信息管理信息
|
||||
*
|
||||
* @param id 科室信息管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteHospitalDepartmentInfoById(Long id);
|
||||
}
|
||||
@ -0,0 +1,156 @@
|
||||
package com.xinelu.manage.service.hospitaldepartmentinfo.impl;
|
||||
|
||||
import com.xinelu.common.constant.Constants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
||||
import com.xinelu.common.utils.regex.RegexUtil;
|
||||
import com.xinelu.manage.dto.hospitaldepartmentinfo.HospitalDepartmentDTO;
|
||||
import com.xinelu.manage.domain.hospitaldepartmentinfo.HospitalDepartmentInfo;
|
||||
import com.xinelu.manage.mapper.hospitaldepartmentinfo.HospitalDepartmentInfoMapper;
|
||||
import com.xinelu.manage.service.hospitaldepartmentinfo.IHospitalDepartmentInfoService;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 科室信息管理Service业务层处理
|
||||
*
|
||||
* @author zh
|
||||
* @date 2023-02-13
|
||||
*/
|
||||
@Service
|
||||
public class HospitalDepartmentInfoServiceImpl implements IHospitalDepartmentInfoService {
|
||||
@Resource
|
||||
private HospitalDepartmentInfoMapper hospitalDepartmentInfoMapper;
|
||||
@Resource
|
||||
private GenerateSystemCodeUtil generateSystemCodeUtil;
|
||||
@Resource
|
||||
private RegexUtil regexUtil;
|
||||
|
||||
/**
|
||||
* 查询科室信息管理
|
||||
*
|
||||
* @param id 科室信息管理主键
|
||||
* @return 科室信息管理
|
||||
*/
|
||||
@Override
|
||||
public HospitalDepartmentInfo selectHospitalDepartmentInfoById(Long id) {
|
||||
return hospitalDepartmentInfoMapper.selectHospitalDepartmentInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询科室信息管理列表
|
||||
*
|
||||
* @param hospitalDepartmentInfo 科室信息管理
|
||||
* @return 科室信息管理
|
||||
*/
|
||||
@Override
|
||||
public List<HospitalDepartmentInfo> selectHospitalDepartmentInfoList(HospitalDepartmentInfo hospitalDepartmentInfo) {
|
||||
return hospitalDepartmentInfoMapper.selectHospitalDepartmentInfoList(hospitalDepartmentInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增科室信息管理
|
||||
*
|
||||
* @param hospitalDepartment 科室信息管理信息集合
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult insertHospitalDepartmentInfo(HospitalDepartmentDTO hospitalDepartment) {
|
||||
//校验同一个医院下的科室名称是否重复
|
||||
List<HospitalDepartmentInfo> discountDepartmentList = hospitalDepartment.getHospitalDepartmentInfoList().stream().distinct().collect(Collectors.toList());
|
||||
List<Long> hospitalIdList = discountDepartmentList.stream().filter(item -> Objects.nonNull(item.getHospitalId())).map(HospitalDepartmentInfo::getHospitalId).collect(Collectors.toList());
|
||||
List<HospitalDepartmentInfo> departmentInfoList = hospitalDepartmentInfoMapper.getDepartmentInfoList(hospitalIdList);
|
||||
if (CollectionUtils.isNotEmpty(departmentInfoList)) {
|
||||
List<HospitalDepartmentInfo> intersectionList = new ArrayList<>(CollectionUtils.intersection(departmentInfoList, discountDepartmentList));
|
||||
if (CollectionUtils.isNotEmpty(intersectionList)) {
|
||||
HospitalDepartmentInfo departmentInfo = intersectionList.get(0);
|
||||
return AjaxResult.error("所属医院为:'" + departmentInfo.getHospitalName() + "'的'" + departmentInfo.getDepartmentName() + "'科室名称重复,请重新输入!");
|
||||
}
|
||||
}
|
||||
for (HospitalDepartmentInfo hospitalDepartmentInfo : discountDepartmentList) {
|
||||
//校验联系电话是否正确
|
||||
if (StringUtils.isNotBlank(hospitalDepartmentInfo.getDepartmentPhone())) {
|
||||
boolean phone = regexUtil.regexSeatNumber(hospitalDepartmentInfo.getDepartmentPhone());
|
||||
if (BooleanUtils.isFalse(phone)) {
|
||||
return AjaxResult.error("您输入的科室联系电话" + hospitalDepartmentInfo.getDepartmentPhone() + "不正确,请重新输入!");
|
||||
}
|
||||
}
|
||||
//自动生成科室编号,增加创建人、时间
|
||||
hospitalDepartmentInfo.setCreateTime(LocalDateTime.now());
|
||||
hospitalDepartmentInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
hospitalDepartmentInfo.setDepartmentCode(Constants.DEPARTMENT_CODE + generateSystemCodeUtil.generateSystemCode(Constants.DEPARTMENT_CODE));
|
||||
}
|
||||
int insertCount = hospitalDepartmentInfoMapper.insertHospitalDepartmentList(discountDepartmentList);
|
||||
if (insertCount <= 0) {
|
||||
throw new ServiceException("新增科室信息失败,请联系管理员!");
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改科室信息管理
|
||||
*
|
||||
* @param hospitalDepartmentInfo 科室信息管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateHospitalDepartmentInfo(HospitalDepartmentInfo hospitalDepartmentInfo) {
|
||||
HospitalDepartmentInfo getHospitalDepartment = hospitalDepartmentInfoMapper.selectHospitalDepartmentInfoById(hospitalDepartmentInfo.getId());
|
||||
if (Objects.isNull(getHospitalDepartment)) {
|
||||
return AjaxResult.error("当前科室信息不存在,请联系管理员!");
|
||||
}
|
||||
//校验联系电话是否正确
|
||||
if (StringUtils.isNotBlank(hospitalDepartmentInfo.getDepartmentPhone())) {
|
||||
boolean phone = regexUtil.regexSeatNumber(hospitalDepartmentInfo.getDepartmentPhone());
|
||||
if (BooleanUtils.isFalse(phone)) {
|
||||
throw new ServiceException("您输入的科室联系电话" + hospitalDepartmentInfo.getDepartmentPhone() + "不正确,请重新输入!");
|
||||
}
|
||||
}
|
||||
//校验科室名称是否重复
|
||||
if (!hospitalDepartmentInfo.getDepartmentName().equals(getHospitalDepartment.getDepartmentName())) {
|
||||
int count = hospitalDepartmentInfoMapper.selectHospitalDepartmentCount(hospitalDepartmentInfo.getHospitalId(), hospitalDepartmentInfo.getDepartmentName());
|
||||
if (count > 0) {
|
||||
return AjaxResult.error("您输入的科室名称" + hospitalDepartmentInfo.getDepartmentName() + "重复,请重新输入");
|
||||
}
|
||||
}
|
||||
hospitalDepartmentInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||
hospitalDepartmentInfo.setUpdateTime(LocalDateTime.now());
|
||||
hospitalDepartmentInfoMapper.updateHospitalDepartmentInfo(hospitalDepartmentInfo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除科室信息管理
|
||||
*
|
||||
* @param ids 需要删除的科室信息管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int deleteHospitalDepartmentInfoByIds(Long[] ids) {
|
||||
return hospitalDepartmentInfoMapper.deleteHospitalDepartmentInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除科室信息管理信息
|
||||
*
|
||||
* @param id 科室信息管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHospitalDepartmentInfoById(Long id) {
|
||||
return hospitalDepartmentInfoMapper.deleteHospitalDepartmentInfoById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.xinelu.manage.service.hospitalinfo;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.manage.domain.hospitalinfo.HospitalInfo;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 医院信息管理Service接口
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-02-13
|
||||
*/
|
||||
public interface IHospitalInfoService {
|
||||
/**
|
||||
* 查询医院信息管理
|
||||
*
|
||||
* @param id 医院信息管理主键
|
||||
* @return 医院信息管理
|
||||
*/
|
||||
HospitalInfo selectHospitalInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询医院信息管理列表
|
||||
*
|
||||
* @param hospitalInfo 医院信息管理
|
||||
* @return 医院信息管理集合
|
||||
*/
|
||||
List<HospitalInfo> selectHospitalInfoList(HospitalInfo hospitalInfo);
|
||||
|
||||
/**
|
||||
* 新增医院信息管理
|
||||
*
|
||||
* @param hospitalInfo 医院信息管理
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult insertHospitalInfo(HospitalInfo hospitalInfo);
|
||||
|
||||
/**
|
||||
* 修改医院信息管理
|
||||
*
|
||||
* @param hospitalInfo 医院信息管理
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult updateHospitalInfo(HospitalInfo hospitalInfo);
|
||||
|
||||
/**
|
||||
* 批量删除医院信息管理
|
||||
*
|
||||
* @param ids 需要删除的医院信息管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult deleteHospitalInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除医院信息管理信息
|
||||
*
|
||||
* @param id 医院信息管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteHospitalInfoById(Long id);
|
||||
}
|
||||
@ -0,0 +1,203 @@
|
||||
package com.xinelu.manage.service.hospitalinfo.impl;
|
||||
|
||||
import com.xinelu.common.constant.Constants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
||||
import com.xinelu.common.utils.file.FileUtils;
|
||||
import com.xinelu.common.utils.regex.RegexUtil;
|
||||
import com.xinelu.manage.domain.hospitalinfo.HospitalInfo;
|
||||
import com.xinelu.manage.mapper.hospitalinfo.HospitalInfoMapper;
|
||||
import com.xinelu.manage.service.hospitalinfo.IHospitalInfoService;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 医院信息管理Service业务层处理
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-02-13
|
||||
*/
|
||||
@Service
|
||||
public class HospitalInfoServiceImpl implements IHospitalInfoService {
|
||||
@Resource
|
||||
private HospitalInfoMapper hospitalInfoMapper;
|
||||
@Resource
|
||||
private GenerateSystemCodeUtil generateSystemCodeUtil;
|
||||
@Resource
|
||||
private RegexUtil regexUtil;
|
||||
//@Resource
|
||||
//private INurseStationItemService nurseStationItemService;
|
||||
|
||||
/**
|
||||
* 查询医院信息管理
|
||||
*
|
||||
* @param id 医院信息管理主键
|
||||
* @return 医院信息管理
|
||||
*/
|
||||
@Override
|
||||
public HospitalInfo selectHospitalInfoById(Long id) {
|
||||
return hospitalInfoMapper.selectHospitalInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询医院信息管理列表
|
||||
*
|
||||
* @param hospitalInfo 医院信息管理
|
||||
* @return 医院信息管理
|
||||
*/
|
||||
@Override
|
||||
public List<HospitalInfo> selectHospitalInfoList(HospitalInfo hospitalInfo) {
|
||||
return hospitalInfoMapper.selectHospitalInfoList(hospitalInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增医院信息管理
|
||||
*
|
||||
* @param hospitalInfo 医院信息管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult insertHospitalInfo(HospitalInfo hospitalInfo) {
|
||||
//校验联系电话是否正确
|
||||
if (StringUtils.isNotBlank(hospitalInfo.getPhone())) {
|
||||
boolean phone = regexUtil.regexSeatNumber(hospitalInfo.getPhone());
|
||||
if (BooleanUtils.isFalse(phone)) {
|
||||
return AjaxResult.error("您输入的联系电话" + hospitalInfo.getPhone() + "不正确,请重新输入!");
|
||||
}
|
||||
}
|
||||
//校验名称是否重复
|
||||
int nameCount = hospitalInfoMapper.selectHospitalNameCount(hospitalInfo.getHospitalName());
|
||||
if (nameCount > 0) {
|
||||
return AjaxResult.error("您输入的医院名称" + hospitalInfo.getHospitalName() + "重复,请重新添加!");
|
||||
}
|
||||
hospitalInfo.setHospitalCode(Constants.HOSPITAL_CODE + generateSystemCodeUtil.generateSystemCode(Constants.HOSPITAL_CODE));
|
||||
hospitalInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
hospitalInfo.setCreateTime(LocalDateTime.now());
|
||||
return AjaxResult.success(hospitalInfoMapper.insertHospitalInfo(hospitalInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改医院信息管理
|
||||
*
|
||||
* @param hospitalInfo 医院信息管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateHospitalInfo(HospitalInfo hospitalInfo) {
|
||||
HospitalInfo getHospitalInfo = hospitalInfoMapper.selectHospitalInfoById(hospitalInfo.getId());
|
||||
if (Objects.isNull(getHospitalInfo)) {
|
||||
return AjaxResult.error("当前医院信息不存在,无法修改,请联系管理员!");
|
||||
}
|
||||
//校验联系电话是否正确
|
||||
if (StringUtils.isNotBlank(hospitalInfo.getPhone())) {
|
||||
boolean phone = regexUtil.regexSeatNumber(hospitalInfo.getPhone());
|
||||
if (BooleanUtils.isFalse(phone)) {
|
||||
return AjaxResult.error("您输入的联系电话" + hospitalInfo.getPhone() + "不正确,请重新输入!");
|
||||
}
|
||||
}
|
||||
//校验名称是否重复
|
||||
if (!hospitalInfo.getHospitalName().equals(getHospitalInfo.getHospitalName())) {
|
||||
int nameCount = hospitalInfoMapper.selectHospitalNameCount(hospitalInfo.getHospitalName());
|
||||
if (nameCount > 0) {
|
||||
return AjaxResult.error("您输入的医院名称" + hospitalInfo.getHospitalName() + "重复,请重新添加!");
|
||||
}
|
||||
}
|
||||
hospitalInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||
hospitalInfo.setUpdateTime(LocalDateTime.now());
|
||||
//修改医院信息
|
||||
hospitalInfoMapper.updateHospitalInfo(hospitalInfo);
|
||||
//修改富文本图片
|
||||
this.deleteHospitalPictureUrl(hospitalInfo, getHospitalInfo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除医院信息管理
|
||||
*
|
||||
* @param ids 需要删除的医院信息管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult deleteHospitalInfoByIds(Long[] ids) {
|
||||
//查询医院信息
|
||||
List<HospitalInfo> hospitalInfoList = hospitalInfoMapper.selectHospitalList(ids);
|
||||
if (CollectionUtils.isEmpty(hospitalInfoList)) {
|
||||
return AjaxResult.error("医院信息不存在,无法删除!");
|
||||
}
|
||||
//删除医院信息
|
||||
int count = hospitalInfoMapper.deleteHospitalInfoByIds(ids);
|
||||
if (count <= 0) {
|
||||
throw new ServiceException("删除医院信息失败,请联系管理员!");
|
||||
}
|
||||
//筛选医院简介
|
||||
List<String> hospitalIntroduceList = hospitalInfoList.stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getHospitalIntroduce())).map(HospitalInfo::getHospitalIntroduce).collect(Collectors.toList());
|
||||
//遍历获取简介图片地址
|
||||
for (String hospitalIntroduce : hospitalIntroduceList) {
|
||||
List<String> pictureUrlList = FileUtils.getImgSrc(hospitalIntroduce);
|
||||
for (String pictureUrl : pictureUrlList) {
|
||||
if (StringUtils.isBlank(pictureUrl)) {
|
||||
continue;
|
||||
}
|
||||
//修改路径
|
||||
String substring = pictureUrl.substring(pictureUrl.indexOf("/profile"));
|
||||
//删除医院简介富文本图片
|
||||
//@TODO
|
||||
//nurseStationItemService.deletePictureUrl(substring);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除医院信息管理信息
|
||||
*
|
||||
* @param id 医院信息管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHospitalInfoById(Long id) {
|
||||
return hospitalInfoMapper.deleteHospitalInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除医院富文本图片
|
||||
*
|
||||
* @param hospitalInfo 修改后
|
||||
* @param getHospital 修改先
|
||||
**/
|
||||
public void deleteHospitalPictureUrl(HospitalInfo hospitalInfo, HospitalInfo getHospital) {
|
||||
if (StringUtils.isNotBlank(hospitalInfo.getHospitalIntroduce()) && StringUtils.isNotBlank(getHospital.getHospitalIntroduce())
|
||||
&& !hospitalInfo.getHospitalIntroduce().equals(getHospital.getHospitalIntroduce())) {
|
||||
//修改先
|
||||
List<String> getHospitalImgSrc = FileUtils.getImgSrc(getHospital.getHospitalIntroduce());
|
||||
//修改后
|
||||
List<String> hospitalImgSrc = FileUtils.getImgSrc(hospitalInfo.getHospitalIntroduce());
|
||||
//差集不同的
|
||||
List<String> subtractNurseStationImgSrc = new ArrayList<>(CollectionUtils.subtract(getHospitalImgSrc, hospitalImgSrc));
|
||||
//删除商品富文本图片
|
||||
for (String pictureUrl : subtractNurseStationImgSrc) {
|
||||
if (StringUtils.isBlank(pictureUrl)) {
|
||||
continue;
|
||||
}
|
||||
//修改路径
|
||||
String substring = pictureUrl.substring(pictureUrl.indexOf("/profile"));
|
||||
//删除富文本图片
|
||||
// @TODO
|
||||
//nurseStationItemService.deletePictureUrl(substring);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,54 @@
|
||||
package com.xinelu.manage.service.hospitalpersoncertificate;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.manage.dto.hospitalpersoncertificate.HospitalPersonCertificateDTO;
|
||||
import com.xinelu.manage.vo.hospitalpersoncertificate.HospitalPersonCertificateVO;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 健康咨询-科室人员资质证书信息Service接口
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-02-23
|
||||
*/
|
||||
public interface IHospitalPersonCertificateService {
|
||||
/**
|
||||
* 查询健康咨询-科室人员资质证书信息
|
||||
*
|
||||
* @param id 健康咨询-科室人员资质证书信息主键
|
||||
* @return 健康咨询-科室人员资质证书信息
|
||||
*/
|
||||
HospitalPersonCertificateVO selectHospitalPersonCertificateById(Long id);
|
||||
|
||||
/**
|
||||
* 查询健康咨询-科室人员资质证书信息列表
|
||||
*
|
||||
* @param hospitalPersonCertificate 健康咨询-科室人员资质证书信息
|
||||
* @return 健康咨询-科室人员资质证书信息集合
|
||||
*/
|
||||
List<HospitalPersonCertificateVO> selectHospitalPersonCertificateList(HospitalPersonCertificateDTO hospitalPersonCertificate);
|
||||
|
||||
/**
|
||||
* 新增健康咨询-科室人员资质证书信息
|
||||
*
|
||||
* @param hospitalPersonCertificate 健康咨询-科室人员资质证书信息
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult insertHospitalPersonCertificate(HospitalPersonCertificateDTO hospitalPersonCertificate);
|
||||
|
||||
/**
|
||||
* 修改健康咨询-科室人员资质证书信息
|
||||
*
|
||||
* @param hospitalPersonCertificate 健康咨询-科室人员资质证书信息
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult updateHospitalPersonCertificate(HospitalPersonCertificateDTO hospitalPersonCertificate);
|
||||
|
||||
/**
|
||||
* 批量删除健康咨询-科室人员资质证书信息
|
||||
*
|
||||
* @param ids 需要删除的健康咨询-科室人员资质证书信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteHospitalPersonCertificateByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,137 @@
|
||||
package com.xinelu.manage.service.hospitalpersoncertificate.impl;
|
||||
|
||||
import com.xinelu.common.constant.Constants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.bean.BeanUtils;
|
||||
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
||||
import com.xinelu.manage.dto.hospitalpersoncertificate.CertificateUrlDTO;
|
||||
import com.xinelu.manage.dto.hospitalpersoncertificate.HospitalPersonCertificateDTO;
|
||||
import com.xinelu.manage.domain.hospitalpersoncertificate.HospitalPersonCertificate;
|
||||
import com.xinelu.manage.mapper.hospitalpersoncertificate.HospitalPersonCertificateMapper;
|
||||
import com.xinelu.manage.service.hospitalpersoncertificate.IHospitalPersonCertificateService;
|
||||
import com.xinelu.manage.vo.hospitalpersoncertificate.HospitalPersonCertificateVO;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 健康咨询-科室人员资质证书信息Service业务层处理
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-02-23
|
||||
*/
|
||||
@Service
|
||||
public class HospitalPersonCertificateServiceImpl implements IHospitalPersonCertificateService {
|
||||
@Resource
|
||||
private HospitalPersonCertificateMapper hospitalPersonCertificateMapper;
|
||||
@Resource
|
||||
private GenerateSystemCodeUtil generateSystemCodeUtil;
|
||||
|
||||
/**
|
||||
* 查询健康咨询-科室人员资质证书信息
|
||||
*
|
||||
* @param id 健康咨询-科室人员资质证书信息主键
|
||||
* @return 健康咨询-科室人员资质证书信息
|
||||
*/
|
||||
@Override
|
||||
public HospitalPersonCertificateVO selectHospitalPersonCertificateById(Long id) {
|
||||
HospitalPersonCertificateVO hospitalPersonCertificateVO = new HospitalPersonCertificateVO();
|
||||
List<HospitalPersonCertificateVO> hospitalPersonCertificateVOList = hospitalPersonCertificateMapper.selectHospitalPersonCertificateById(id);
|
||||
BeanUtils.copyProperties(hospitalPersonCertificateVOList.get(0), hospitalPersonCertificateVO);
|
||||
List<CertificateUrlDTO> certificateUrlDTO = new ArrayList<>();
|
||||
hospitalPersonCertificateVOList.forEach(hospital -> {
|
||||
CertificateUrlDTO certificateUrl = new CertificateUrlDTO();
|
||||
certificateUrl.setCertificateUrl(hospital.getCertificateUrl());
|
||||
certificateUrlDTO.add(certificateUrl);
|
||||
hospitalPersonCertificateVO.setCertificateUrlList(certificateUrlDTO);
|
||||
});
|
||||
return hospitalPersonCertificateVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询健康咨询-科室人员资质证书信息列表
|
||||
*
|
||||
* @param hospitalPersonCertificate 健康咨询-科室人员资质证书信息
|
||||
* @return 健康咨询-科室人员资质证书信息
|
||||
*/
|
||||
@Override
|
||||
public List<HospitalPersonCertificateVO> selectHospitalPersonCertificateList(HospitalPersonCertificateDTO hospitalPersonCertificate) {
|
||||
return hospitalPersonCertificateMapper.selectHospitalPersonCertificateList(hospitalPersonCertificate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增健康咨询-科室人员资质证书信息
|
||||
*
|
||||
* @param hospitalPersonCertificate 健康咨询-科室人员资质证书信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult insertHospitalPersonCertificate(HospitalPersonCertificateDTO hospitalPersonCertificate) {
|
||||
if (Objects.isNull(hospitalPersonCertificate)) {
|
||||
return AjaxResult.error("请添加科室人员资质证书信息!");
|
||||
}
|
||||
List<HospitalPersonCertificate> hospitalPersonCertificateList = new ArrayList<>();
|
||||
for (CertificateUrlDTO object : hospitalPersonCertificate.getCertificateUrlList()) {
|
||||
HospitalPersonCertificate hospitalPerson = new HospitalPersonCertificate();
|
||||
BeanUtils.copyProperties(hospitalPersonCertificate, hospitalPerson);
|
||||
hospitalPerson.setCertificateUrl(object.getCertificateUrl());
|
||||
hospitalPerson.setCreateTime(LocalDateTime.now());
|
||||
hospitalPerson.setCreateBy(SecurityUtils.getUsername());
|
||||
hospitalPerson.setCertificateCode(Constants.CERTIFICATE_CODE + generateSystemCodeUtil.generateSystemCode(Constants.CERTIFICATE_CODE));
|
||||
hospitalPersonCertificateList.add(hospitalPerson);
|
||||
}
|
||||
int hospitalPersonCertificates = hospitalPersonCertificateMapper.insertHospitalPersonCertificateList(hospitalPersonCertificateList);
|
||||
if (hospitalPersonCertificates <= 0) {
|
||||
throw new ServiceException("新增科室人员资质证书信息失败,请联系管理员!");
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改健康咨询-科室人员资质证书信息
|
||||
*
|
||||
* @param hospitalPersonCertificate 健康咨询-科室人员资质证书信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateHospitalPersonCertificate(HospitalPersonCertificateDTO hospitalPersonCertificate) {
|
||||
int deleteHospitalPersonCertificateById = hospitalPersonCertificateMapper.deleteHospitalPersonCertificateById(hospitalPersonCertificate.getHospitalPersonId());
|
||||
if (deleteHospitalPersonCertificateById < 0) {
|
||||
return AjaxResult.error("修改信息失败,请联系管理员!");
|
||||
}
|
||||
List<HospitalPersonCertificate> hospitalPersonCertificateList = new ArrayList<>();
|
||||
for (CertificateUrlDTO object : hospitalPersonCertificate.getCertificateUrlList()) {
|
||||
HospitalPersonCertificate hospitalPerson = new HospitalPersonCertificate();
|
||||
BeanUtils.copyProperties(hospitalPersonCertificate, hospitalPerson);
|
||||
hospitalPerson.setCertificateUrl(object.getCertificateUrl());
|
||||
hospitalPerson.setCreateTime(LocalDateTime.now());
|
||||
hospitalPerson.setCreateBy(SecurityUtils.getUsername());
|
||||
hospitalPerson.setCertificateCode(Constants.CERTIFICATE_CODE + generateSystemCodeUtil.generateSystemCode(Constants.CERTIFICATE_CODE));
|
||||
hospitalPersonCertificateList.add(hospitalPerson);
|
||||
}
|
||||
int hospitalPersonCertificates = hospitalPersonCertificateMapper.insertHospitalPersonCertificateList(hospitalPersonCertificateList);
|
||||
if (hospitalPersonCertificates <= 0) {
|
||||
throw new ServiceException("新增科室人员资质证书信息失败,请联系管理员!");
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除健康咨询-科室人员资质证书信息
|
||||
*
|
||||
* @param ids 需要删除的健康咨询-科室人员资质证书信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHospitalPersonCertificateByIds(Long[] ids) {
|
||||
return hospitalPersonCertificateMapper.deleteHospitalPersonCertificateByIds(ids);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package com.xinelu.manage.service.hospitalpersoninfo;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDTO;
|
||||
import com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 健康咨询-科室人员信息Service接口
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-02-14
|
||||
*/
|
||||
public interface IHospitalPersonInfoService {
|
||||
/**
|
||||
* 查询健康咨询-科室人员信息
|
||||
*
|
||||
* @param id 健康咨询-科室人员信息主键
|
||||
* @return 健康咨询-科室人员信息
|
||||
*/
|
||||
HospitalPersonInfoVO selectHospitalPersonInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询健康咨询-科室人员信息列表
|
||||
*
|
||||
* @param hospitalPersonInfo 健康咨询-科室人员信息
|
||||
* @return 健康咨询-科室人员信息集合
|
||||
*/
|
||||
List<HospitalPersonInfoVO> selectHospitalPersonInfoList(HospitalPersonInfoVO hospitalPersonInfo);
|
||||
|
||||
/**
|
||||
* 新增健康咨询-科室人员信息
|
||||
*
|
||||
* @param hospitalPersonInfo 健康咨询-科室人员信息
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult insertHospitalPersonInfo(HospitalPersonInfoDTO hospitalPersonInfo);
|
||||
|
||||
/**
|
||||
* 修改健康咨询-科室人员信息
|
||||
*
|
||||
* @param hospitalPersonInfo 健康咨询-科室人员信息
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult updateHospitalPersonInfo(HospitalPersonInfoDTO hospitalPersonInfo);
|
||||
|
||||
/**
|
||||
* 批量删除健康咨询-科室人员信息
|
||||
*
|
||||
* @param ids 需要删除的健康咨询-科室人员信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult deleteHospitalPersonInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除健康咨询-科室人员信息信息
|
||||
*
|
||||
* @param id 健康咨询-科室人员信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteHospitalPersonInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 删除图片地址
|
||||
*
|
||||
* @param pictureUrl 图片地址
|
||||
**/
|
||||
void deletePictureUrl(String pictureUrl);
|
||||
}
|
||||
@ -0,0 +1,301 @@
|
||||
package com.xinelu.manage.service.hospitalpersoninfo.impl;
|
||||
|
||||
import com.xinelu.common.config.XinELuConfig;
|
||||
import com.xinelu.common.constant.Constants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
||||
import com.xinelu.common.utils.regex.RegexUtil;
|
||||
import com.xinelu.manage.domain.hospitalpersoncertificate.HospitalPersonCertificate;
|
||||
import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo;
|
||||
import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDTO;
|
||||
import com.xinelu.manage.mapper.hospitalpersoncertificate.HospitalPersonCertificateMapper;
|
||||
import com.xinelu.manage.mapper.hospitalpersoninfo.HospitalPersonInfoMapper;
|
||||
import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService;
|
||||
import com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO;
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 健康咨询-科室人员信息Service业务层处理
|
||||
*
|
||||
* @author xinyilu
|
||||
* @date 2023-02-14
|
||||
*/
|
||||
@Service
|
||||
public class HospitalPersonInfoServiceImpl implements IHospitalPersonInfoService {
|
||||
@Resource
|
||||
private HospitalPersonInfoMapper hospitalPersonInfoMapper;
|
||||
@Resource
|
||||
private GenerateSystemCodeUtil generateSystemCodeUtil;
|
||||
@Resource
|
||||
private RegexUtil regexUtil;
|
||||
@Resource
|
||||
private HospitalPersonCertificateMapper hospitalPersonCertificateMapper;
|
||||
|
||||
/**
|
||||
* 查询健康咨询-科室人员信息
|
||||
*
|
||||
* @param id 健康咨询-科室人员信息主键
|
||||
* @return 健康咨询-科室人员信息
|
||||
*/
|
||||
@Override
|
||||
public HospitalPersonInfoVO selectHospitalPersonInfoById(Long id) {
|
||||
return hospitalPersonInfoMapper.selectHospitalPersonInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询健康咨询-科室人员信息列表
|
||||
*
|
||||
* @param hospitalPersonInfo 健康咨询-科室人员信息
|
||||
* @return 健康咨询-科室人员信息
|
||||
*/
|
||||
@Override
|
||||
public List<HospitalPersonInfoVO> selectHospitalPersonInfoList(HospitalPersonInfoVO hospitalPersonInfo) {
|
||||
return hospitalPersonInfoMapper.selectHospitalPersonInfoList(hospitalPersonInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增健康咨询-科室人员信息
|
||||
*
|
||||
* @param hospitalPersonInfo 健康咨询-科室人员信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult insertHospitalPersonInfo(HospitalPersonInfoDTO hospitalPersonInfo) {
|
||||
//校验联系电话是否正确
|
||||
if (Objects.nonNull(hospitalPersonInfo) && StringUtils.isNotBlank(hospitalPersonInfo.getPersonPhone())) {
|
||||
boolean phone = regexUtil.regexPhone(hospitalPersonInfo.getPersonPhone());
|
||||
if (BooleanUtils.isFalse(phone)) {
|
||||
return AjaxResult.error("您输入的联系电话" + hospitalPersonInfo.getPersonPhone() + "不正确,请重新输入!");
|
||||
}
|
||||
}
|
||||
//校验身份证号是否正确
|
||||
if (Objects.nonNull(hospitalPersonInfo) && StringUtils.isNotBlank(hospitalPersonInfo.getCardNo())) {
|
||||
boolean phone = regexUtil.regexCardNo(hospitalPersonInfo.getCardNo());
|
||||
if (BooleanUtils.isFalse(phone)) {
|
||||
return AjaxResult.error("您输入的身份证号" + hospitalPersonInfo.getCardNo() + "不正确,请重新输入!");
|
||||
}
|
||||
//校验身份证号是否重复
|
||||
int cardNoByCount = hospitalPersonInfoMapper.selectHospitalPersonInfoByCount(hospitalPersonInfo.getCardNo());
|
||||
if (cardNoByCount > 0) {
|
||||
return AjaxResult.error("您输入的身份证号" + hospitalPersonInfo.getCardNo() + "重复,请重新添加!");
|
||||
}
|
||||
}
|
||||
if (Objects.nonNull(hospitalPersonInfo.getConsultingFee()) && hospitalPersonInfo.getConsultingFee().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return AjaxResult.error("咨询费用不能为0或者负数,请重新输入");
|
||||
}
|
||||
//创建人 创建时间 科室人员编码
|
||||
hospitalPersonInfo.setPersonCode(Constants.PERSON_CODE + generateSystemCodeUtil.generateSystemCode(Constants.PERSON_CODE));
|
||||
hospitalPersonInfo.setCreateTime(LocalDateTime.now());
|
||||
hospitalPersonInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
int insertHospitalPersonInfo = hospitalPersonInfoMapper.insertHospitalPersonInfo(hospitalPersonInfo);
|
||||
if (insertHospitalPersonInfo <= 0) {
|
||||
throw new ServiceException("新增科室人员信息失败,请联系管理员!");
|
||||
}
|
||||
if (Objects.nonNull(hospitalPersonInfo.getHospitalPersonCertificateList())) {
|
||||
//新增科室人员资质证书表
|
||||
for (HospitalPersonCertificate hospitalPersonCertificate : hospitalPersonInfo.getHospitalPersonCertificateList()) {
|
||||
hospitalPersonCertificate.setHospitalPersonId(hospitalPersonInfo.getId());
|
||||
hospitalPersonCertificate.setCreateTime(LocalDateTime.now());
|
||||
hospitalPersonCertificate.setCreateBy(SecurityUtils.getUsername());
|
||||
hospitalPersonCertificate.setCertificateCode(Constants.CERTIFICATE_CODE + generateSystemCodeUtil.generateSystemCode(Constants.CERTIFICATE_CODE));
|
||||
}
|
||||
int hospitalPersonCertificates = hospitalPersonCertificateMapper.insertHospitalPersonCertificateList(hospitalPersonInfo.getHospitalPersonCertificateList());
|
||||
if (hospitalPersonCertificates <= 0) {
|
||||
throw new ServiceException("新增科室人员资质证书信息失败,请联系管理员!");
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改健康咨询-科室人员信息
|
||||
*
|
||||
* @param hospitalPersonInfo 健康咨询-科室人员信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult updateHospitalPersonInfo(HospitalPersonInfoDTO hospitalPersonInfo) {
|
||||
//根据id查询当前人员是否存在
|
||||
HospitalPersonInfo personInfo = hospitalPersonInfoMapper.selectHospitalPersonInfoById(hospitalPersonInfo.getId());
|
||||
if (Objects.isNull(personInfo)) {
|
||||
return AjaxResult.error("当前科室人员信息不存在!");
|
||||
}
|
||||
AjaxResult ajaxResult = verificationHospital(hospitalPersonInfo, personInfo);
|
||||
if (Objects.nonNull(ajaxResult)) {
|
||||
return ajaxResult;
|
||||
}
|
||||
if (Objects.nonNull(hospitalPersonInfo.getConsultingFee()) && hospitalPersonInfo.getConsultingFee().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return AjaxResult.error("咨询费用不能为0或者负数,请重新输入");
|
||||
}
|
||||
//修改人 修改时间
|
||||
hospitalPersonInfo.setUpdateTime(LocalDateTime.now());
|
||||
hospitalPersonInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||
hospitalPersonInfoMapper.updateHospitalPersonInfo(hospitalPersonInfo);
|
||||
//根据科室人员id去查询对应的资质证书 使用流来获取所有的证书路径
|
||||
List<HospitalPersonCertificate> hospitalPersonCertificateList = hospitalPersonCertificateMapper.selectHospitalPersonCertificateByIds(Collections.singletonList(hospitalPersonInfo.getId()));
|
||||
//数据库中的
|
||||
List<String> hospitalPersonCertificateUrlList = Lists.newArrayList();
|
||||
//根据科室人员id删除科室人员资质证书信息表
|
||||
if (CollectionUtils.isNotEmpty(hospitalPersonCertificateList)) {
|
||||
hospitalPersonCertificateUrlList = hospitalPersonCertificateList.stream().filter(Objects::nonNull)
|
||||
.filter(hospitalUrl -> (StringUtils.isNotBlank(hospitalUrl.getCertificateUrl())))
|
||||
.map(HospitalPersonCertificate::getCertificateUrl).collect(Collectors.toList());
|
||||
Long[] longs = hospitalPersonCertificateList.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getId())).collect(Collectors.toList()).stream().map(HospitalPersonCertificate::getId).toArray(Long[]::new);
|
||||
int deleteCount = hospitalPersonCertificateMapper.deleteHospitalPersonCertificateByIds(longs);
|
||||
if (deleteCount <= 0) {
|
||||
throw new ServiceException("修改科室人员信息失败,请联系管理员!");
|
||||
}
|
||||
}
|
||||
//前端传的
|
||||
List<String> hospitalPersonInfoCertificateUrlList = hospitalPersonInfo.getHospitalPersonCertificateList().stream().filter(Objects::nonNull)
|
||||
.filter(hospitalUrl -> (StringUtils.isNotBlank(hospitalUrl.getCertificateUrl())))
|
||||
.map(HospitalPersonCertificate::getCertificateUrl).collect(Collectors.toList());
|
||||
//数据库中的地址与前端传的地址做差集
|
||||
List<String> hospitalPersonCertificateUrlSubtract = new ArrayList<>(CollectionUtils.subtract(hospitalPersonCertificateUrlList, hospitalPersonInfoCertificateUrlList));
|
||||
//新增科室人员资质证书表
|
||||
for (HospitalPersonCertificate hospitalPersonCertificate : hospitalPersonInfo.getHospitalPersonCertificateList()) {
|
||||
hospitalPersonCertificate.setHospitalPersonId(hospitalPersonInfo.getId());
|
||||
hospitalPersonCertificate.setUpdateTime(LocalDateTime.now());
|
||||
hospitalPersonCertificate.setUpdateBy(SecurityUtils.getUsername());
|
||||
hospitalPersonCertificate.setCertificateCode(Constants.CERTIFICATE_CODE + generateSystemCodeUtil.generateSystemCode(Constants.CERTIFICATE_CODE));
|
||||
}
|
||||
int hospitalPersonCertificates = hospitalPersonCertificateMapper.insertHospitalPersonCertificateList(hospitalPersonInfo.getHospitalPersonCertificateList());
|
||||
if (hospitalPersonCertificates <= 0) {
|
||||
throw new ServiceException("修改科室人员资质证书信息失败,请联系管理员!");
|
||||
}
|
||||
//删除人员的头像
|
||||
if (StringUtils.isNotBlank(personInfo.getPersonPictureUrl()) && StringUtils.isNotBlank(hospitalPersonInfo.getPersonPictureUrl()) && !personInfo.getPersonPictureUrl().equals(hospitalPersonInfo.getPersonPictureUrl())) {
|
||||
this.deletePictureUrl(personInfo.getPersonPictureUrl());
|
||||
}
|
||||
//删除科室人员的资质证书
|
||||
if (CollectionUtils.isNotEmpty(hospitalPersonCertificateUrlSubtract)) {
|
||||
hospitalPersonCertificateUrlSubtract.forEach(this::deletePictureUrl);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除健康咨询-科室人员信息
|
||||
*
|
||||
* @param ids 需要删除的健康咨询-科室人员信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult deleteHospitalPersonInfoByIds(Long[] ids) {
|
||||
//根据科室人员id去查询对应的个人信息 使用流来获取所有的富文本
|
||||
List<HospitalPersonInfo> hospitalPersonInfos = hospitalPersonInfoMapper.selectHospitalPersonByIds(Arrays.asList(ids));
|
||||
if (CollectionUtils.isEmpty(hospitalPersonInfos)) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
//根据科室人员id删除人员信息表
|
||||
hospitalPersonInfoMapper.deleteHospitalPersonInfoByIds(ids);
|
||||
//根据科室人员id去查询对应的资质证书 使用流来获取所有的证书路径
|
||||
List<HospitalPersonCertificate> hospitalPersonCertificateList = hospitalPersonCertificateMapper.selectHospitalPersonCertificateByIds(Arrays.asList(ids));
|
||||
//删除人员资质证书表信息
|
||||
if (CollectionUtils.isNotEmpty(hospitalPersonCertificateList)) {
|
||||
hospitalPersonCertificateMapper.deletePersonCertificateByPersonIds(ids);
|
||||
}
|
||||
//使用流获取人员的头像地址
|
||||
List<String> personPictureUrlList = hospitalPersonInfos.stream().filter(Objects::nonNull)
|
||||
.filter(hospital -> (Objects.nonNull(hospital.getPersonPictureUrl())))
|
||||
.map(HospitalPersonInfo::getPersonPictureUrl).collect(Collectors.toList());
|
||||
//删除人员的头像
|
||||
if (CollectionUtils.isNotEmpty(personPictureUrlList)) {
|
||||
personPictureUrlList.forEach(this::deletePictureUrl);
|
||||
}
|
||||
//删除科室人员的资质证书
|
||||
List<String> hospitalPersonCertificateUrlList = hospitalPersonCertificateList.stream().filter(Objects::nonNull)
|
||||
.filter(hospitalUrl -> (StringUtils.isNotBlank(hospitalUrl.getCertificateUrl())))
|
||||
.map(HospitalPersonCertificate::getCertificateUrl).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(hospitalPersonCertificateUrlList)) {
|
||||
hospitalPersonCertificateUrlList.forEach(this::deletePictureUrl);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除健康咨询-科室人员信息信息
|
||||
*
|
||||
* @param id 健康咨询-科室人员信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHospitalPersonInfoById(Long id) {
|
||||
return hospitalPersonInfoMapper.deleteHospitalPersonInfoById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改数据校验电话与身份证号
|
||||
*
|
||||
* @param hospitalPersonInfo 前端传过来的
|
||||
* @param personInfo 数据库中查的
|
||||
* @return com.xinelu.common.core.domain.AjaxResult
|
||||
**/
|
||||
public AjaxResult verificationHospital(HospitalPersonInfoDTO hospitalPersonInfo, HospitalPersonInfo personInfo) {
|
||||
//校验联系电话是否正确
|
||||
if (Objects.nonNull(hospitalPersonInfo) && StringUtils.isNotBlank(hospitalPersonInfo.getPersonPhone())) {
|
||||
boolean phone = regexUtil.regexPhone(hospitalPersonInfo.getPersonPhone());
|
||||
if (BooleanUtils.isFalse(phone)) {
|
||||
return AjaxResult.error("您输入的联系电话" + hospitalPersonInfo.getPersonPhone() + "不正确,请重新输入!");
|
||||
}
|
||||
}
|
||||
//校验身份证号是否正确
|
||||
if (Objects.nonNull(hospitalPersonInfo) && StringUtils.isNotBlank(hospitalPersonInfo.getCardNo())) {
|
||||
boolean phone = regexUtil.regexCardNo(hospitalPersonInfo.getCardNo());
|
||||
if (BooleanUtils.isFalse(phone)) {
|
||||
return AjaxResult.error("您输入的身份证号" + hospitalPersonInfo.getCardNo() + "不正确,请重新输入!");
|
||||
}
|
||||
}
|
||||
//校验身份证号是否重复
|
||||
if (Objects.nonNull(hospitalPersonInfo) && StringUtils.isNotBlank(hospitalPersonInfo.getCardNo()) &&
|
||||
StringUtils.isNotBlank(personInfo.getCardNo()) &&
|
||||
!personInfo.getCardNo().equals(hospitalPersonInfo.getCardNo())) {
|
||||
int cardNoByCount = hospitalPersonInfoMapper.selectHospitalPersonInfoByCount(hospitalPersonInfo.getCardNo());
|
||||
if (cardNoByCount > 0) {
|
||||
return AjaxResult.error("您输入的身份证号" + hospitalPersonInfo.getCardNo() + "重复,请重新添加!");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除图片地址
|
||||
*
|
||||
* @param pictureUrl 图片地址
|
||||
**/
|
||||
@Override
|
||||
public void deletePictureUrl(String pictureUrl) {
|
||||
if (StringUtils.isBlank(pictureUrl)) {
|
||||
return;
|
||||
}
|
||||
String picture = XinELuConfig.getProfile() + pictureUrl.replaceAll("/profile", "");
|
||||
File checkReportNameFile = new File(picture);
|
||||
if (checkReportNameFile.exists()) {
|
||||
boolean delete = checkReportNameFile.delete();
|
||||
if (BooleanUtils.isFalse(delete)) {
|
||||
throw new ServiceException("图片地址删除失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.xinelu.manage.vo.hospitalpersoncertificate;
|
||||
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.custominterface.Update;
|
||||
import com.xinelu.manage.dto.hospitalpersoncertificate.CertificateUrlDTO;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author ljh
|
||||
* @version 1.0
|
||||
* Create by 2023/2/24 15:18
|
||||
*/
|
||||
@Data
|
||||
public class HospitalPersonCertificateVO implements Serializable {
|
||||
private static final long serialVersionUID = -4426314380828069789L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 科室人员表id
|
||||
*/
|
||||
@NotNull(message = "科室人员表id不能为空", groups = { Insert.class, Update.class})
|
||||
private Long hospitalPersonId;
|
||||
|
||||
/**
|
||||
* 证书名称
|
||||
*/
|
||||
@NotBlank(message = "科室人员表id不能为空", groups = {Insert.class, Update.class})
|
||||
private String certificateName;
|
||||
|
||||
/**
|
||||
* 证书编号
|
||||
*/
|
||||
private String certificateCode;
|
||||
|
||||
/**
|
||||
* 证书图片存放路径
|
||||
*/
|
||||
private String certificateUrl;
|
||||
|
||||
/**
|
||||
* 证书显示顺序
|
||||
*/
|
||||
@NotNull(message = "证书显示顺序不能为空", groups = {Insert.class, Update.class})
|
||||
private Integer certificateSort;
|
||||
|
||||
/**
|
||||
* 人员名称
|
||||
*/
|
||||
private String personName;
|
||||
|
||||
/**
|
||||
* 证书图片存放路径集合
|
||||
*/
|
||||
private List<CertificateUrlDTO> certificateUrlList;
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package com.xinelu.manage.vo.hospitalpersoninfo;
|
||||
|
||||
import com.xinelu.manage.domain.hospitalpersoncertificate.HospitalPersonCertificate;
|
||||
import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author ljh
|
||||
* @version 1.0
|
||||
* Create by 2023/2/16 9:56
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class HospitalPersonInfoVO extends HospitalPersonInfo implements Serializable {
|
||||
private static final long serialVersionUID = -5861138784324572184L;
|
||||
|
||||
/**
|
||||
* 医院名称
|
||||
*/
|
||||
private String hospitalName;
|
||||
|
||||
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
* 健康咨询-科室人员证书信息对象集合
|
||||
**/
|
||||
private List<HospitalPersonCertificate> hospitalPersonCertificateList;
|
||||
|
||||
}
|
||||
@ -0,0 +1,262 @@
|
||||
<?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.xinelu.manage.mapper.hospitaldepartmentinfo.HospitalDepartmentInfoMapper">
|
||||
|
||||
<resultMap type="com.xinelu.manage.domain.hospitaldepartmentinfo.HospitalDepartmentInfo" id="HospitalDepartmentInfoResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="parentId" column="parent_id"/>
|
||||
<result property="hospitalId" column="hospital_id"/>
|
||||
<result property="hospitalName" column="hospital_name"/>
|
||||
<result property="departmentCode" column="department_code"/>
|
||||
<result property="departmentName" column="department_name"/>
|
||||
<result property="departmentPhone" column="department_phone"/>
|
||||
<result property="departmentPerson" column="department_person"/>
|
||||
<result property="departmentAddress" column="department_address"/>
|
||||
<result property="departmentLevel" column="department_level"/>
|
||||
<result property="departmentSort" column="department_sort"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHospitalDepartmentInfoVo">
|
||||
select id,
|
||||
parent_id,
|
||||
hospital_id,
|
||||
hospital_name,
|
||||
department_code,
|
||||
department_name,
|
||||
department_phone,
|
||||
department_person,
|
||||
department_address,
|
||||
department_level,
|
||||
department_sort,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from hospital_department_info
|
||||
</sql>
|
||||
|
||||
<select id="selectHospitalDepartmentInfoList" parameterType="com.xinelu.manage.domain.hospitaldepartmentinfo.HospitalDepartmentInfo"
|
||||
resultMap="HospitalDepartmentInfoResult">
|
||||
<include refid="selectHospitalDepartmentInfoVo"/>
|
||||
<where>
|
||||
<if test="parentId != null ">
|
||||
and parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="hospitalId != null ">
|
||||
and hospital_id = #{hospitalId}
|
||||
</if>
|
||||
<if test="hospitalName != null and hospitalName != ''">
|
||||
and hospital_name like concat('%', #{hospitalName}, '%')
|
||||
</if>
|
||||
<if test="departmentCode != null and departmentCode != ''">
|
||||
and department_code = #{departmentCode}
|
||||
</if>
|
||||
<if test="departmentName != null and departmentName != ''">
|
||||
and department_name like concat('%', #{departmentName}, '%')
|
||||
</if>
|
||||
<if test="departmentPhone != null and departmentPhone != ''">
|
||||
and department_phone = #{departmentPhone}
|
||||
</if>
|
||||
<if test="departmentPerson != null and departmentPerson != ''">
|
||||
and department_person = #{departmentPerson}
|
||||
</if>
|
||||
<if test="departmentAddress != null and departmentAddress != ''">
|
||||
and department_address = #{departmentAddress}
|
||||
</if>
|
||||
<if test="departmentLevel != null ">
|
||||
and department_level = #{departmentLevel}
|
||||
</if>
|
||||
<if test="departmentSort != null ">
|
||||
and department_sort = #{departmentSort}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
<select id="selectHospitalDepartmentInfoById" parameterType="Long"
|
||||
resultMap="HospitalDepartmentInfoResult">
|
||||
<include refid="selectHospitalDepartmentInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertHospitalDepartmentInfo" parameterType="com.xinelu.manage.domain.hospitaldepartmentinfo.HospitalDepartmentInfo" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into hospital_department_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="parentId != null">parent_id,
|
||||
</if>
|
||||
<if test="hospitalId != null">hospital_id,
|
||||
</if>
|
||||
<if test="hospitalName != null">hospital_name,
|
||||
</if>
|
||||
<if test="departmentCode != null">department_code,
|
||||
</if>
|
||||
<if test="departmentName != null">department_name,
|
||||
</if>
|
||||
<if test="departmentPhone != null">department_phone,
|
||||
</if>
|
||||
<if test="departmentPerson != null">department_person,
|
||||
</if>
|
||||
<if test="departmentAddress != null">department_address,
|
||||
</if>
|
||||
<if test="departmentLevel != null">department_level,
|
||||
</if>
|
||||
<if test="departmentSort != null">department_sort,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="updateBy != null">update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="parentId != null">#{parentId},
|
||||
</if>
|
||||
<if test="hospitalId != null">#{hospitalId},
|
||||
</if>
|
||||
<if test="hospitalName != null">#{hospitalName},
|
||||
</if>
|
||||
<if test="departmentCode != null">#{departmentCode},
|
||||
</if>
|
||||
<if test="departmentName != null">#{departmentName},
|
||||
</if>
|
||||
<if test="departmentPhone != null">#{departmentPhone},
|
||||
</if>
|
||||
<if test="departmentPerson != null">#{departmentPerson},
|
||||
</if>
|
||||
<if test="departmentAddress != null">#{departmentAddress},
|
||||
</if>
|
||||
<if test="departmentLevel != null">#{departmentLevel},
|
||||
</if>
|
||||
<if test="departmentSort != null">#{departmentSort},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHospitalDepartmentInfo" parameterType="com.xinelu.manage.domain.hospitaldepartmentinfo.HospitalDepartmentInfo">
|
||||
update hospital_department_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="parentId != null">parent_id =
|
||||
#{parentId},
|
||||
</if>
|
||||
<if test="hospitalId != null">hospital_id =
|
||||
#{hospitalId},
|
||||
</if>
|
||||
<if test="hospitalName != null">hospital_name =
|
||||
#{hospitalName},
|
||||
</if>
|
||||
<if test="departmentCode != null">department_code =
|
||||
#{departmentCode},
|
||||
</if>
|
||||
<if test="departmentName != null">department_name =
|
||||
#{departmentName},
|
||||
</if>
|
||||
<if test="departmentPhone != null">department_phone =
|
||||
#{departmentPhone},
|
||||
</if>
|
||||
<if test="departmentPerson != null">department_person =
|
||||
#{departmentPerson},
|
||||
</if>
|
||||
<if test="departmentAddress != null">department_address =
|
||||
#{departmentAddress},
|
||||
</if>
|
||||
<if test="departmentLevel != null">department_level =
|
||||
#{departmentLevel},
|
||||
</if>
|
||||
<if test="departmentSort != null">department_sort =
|
||||
#{departmentSort},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHospitalDepartmentInfoById" parameterType="Long">
|
||||
delete
|
||||
from hospital_department_info
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHospitalDepartmentInfoByIds" parameterType="String">
|
||||
delete from hospital_department_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="insertHospitalDepartmentList">
|
||||
insert into hospital_department_info(
|
||||
parent_id,
|
||||
hospital_id,
|
||||
hospital_name,
|
||||
department_code,
|
||||
department_name,
|
||||
department_phone,
|
||||
department_person,
|
||||
department_address,
|
||||
department_level,
|
||||
department_sort,
|
||||
create_by,
|
||||
create_time
|
||||
)values
|
||||
<foreach item="hospitalDepartmentInfoList" index="index" collection="list" separator=",">
|
||||
(
|
||||
#{hospitalDepartmentInfoList.parentId},
|
||||
#{hospitalDepartmentInfoList.hospitalId},
|
||||
#{hospitalDepartmentInfoList.hospitalName},
|
||||
#{hospitalDepartmentInfoList.departmentCode},
|
||||
#{hospitalDepartmentInfoList.departmentName},
|
||||
#{hospitalDepartmentInfoList.departmentPhone},
|
||||
#{hospitalDepartmentInfoList.departmentPerson},
|
||||
#{hospitalDepartmentInfoList.departmentAddress},
|
||||
#{hospitalDepartmentInfoList.departmentLevel},
|
||||
#{hospitalDepartmentInfoList.departmentSort},
|
||||
#{hospitalDepartmentInfoList.createBy},
|
||||
#{hospitalDepartmentInfoList.createTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectHospitalDepartmentCount" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from hospital_department_info
|
||||
where hospital_id = #{hospitalId}
|
||||
and department_name = #{departmentName}
|
||||
</select>
|
||||
|
||||
<select id="getDepartmentInfoList" resultType="com.xinelu.manage.domain.hospitaldepartmentinfo.HospitalDepartmentInfo">
|
||||
select id, hospital_id, hospital_name, department_code, department_name from hospital_department_info
|
||||
where hospital_id in
|
||||
<foreach item="hospitalId" collection="hospitalIdList" open="(" separator="," close=")">
|
||||
#{hospitalId}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,179 @@
|
||||
<?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.xinelu.manage.mapper.hospitalinfo.HospitalInfoMapper">
|
||||
|
||||
<resultMap type="com.xinelu.manage.domain.hospitalinfo.HospitalInfo" id="HospitalInfoResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="hospitalName" column="hospital_name"/>
|
||||
<result property="hospitalCode" column="hospital_code"/>
|
||||
<result property="hospitalAddress" column="hospital_address"/>
|
||||
<result property="phone" column="phone"/>
|
||||
<result property="hospitalIntroduce" column="hospital_introduce"/>
|
||||
<result property="hospitalSort" column="hospital_sort"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHospitalInfoVo">
|
||||
select id,
|
||||
hospital_name,
|
||||
hospital_code,
|
||||
hospital_address,
|
||||
phone,
|
||||
hospital_introduce,
|
||||
hospital_sort,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from hospital_info
|
||||
</sql>
|
||||
|
||||
<select id="selectHospitalInfoList" parameterType="com.xinelu.manage.domain.hospitalinfo.HospitalInfo" resultMap="HospitalInfoResult">
|
||||
<include refid="selectHospitalInfoVo"/>
|
||||
<where>
|
||||
<if test="hospitalName != null and hospitalName != ''">
|
||||
and hospital_name like concat('%', #{hospitalName}, '%')
|
||||
</if>
|
||||
<if test="hospitalCode != null and hospitalCode != ''">
|
||||
and hospital_code = #{hospitalCode}
|
||||
</if>
|
||||
<if test="hospitalAddress != null and hospitalAddress != ''">
|
||||
and hospital_address = #{hospitalAddress}
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
and phone = #{phone}
|
||||
</if>
|
||||
<if test="hospitalIntroduce != null and hospitalIntroduce != ''">
|
||||
and hospital_introduce = #{hospitalIntroduce}
|
||||
</if>
|
||||
<if test="hospitalSort != null ">
|
||||
and hospital_sort = #{hospitalSort}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
<select id="selectHospitalInfoById" parameterType="Long"
|
||||
resultMap="HospitalInfoResult">
|
||||
<include refid="selectHospitalInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertHospitalInfo" parameterType="com.xinelu.manage.domain.hospitalinfo.HospitalInfo" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into hospital_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="hospitalName != null">hospital_name,
|
||||
</if>
|
||||
<if test="hospitalCode != null">hospital_code,
|
||||
</if>
|
||||
<if test="hospitalAddress != null">hospital_address,
|
||||
</if>
|
||||
<if test="phone != null">phone,
|
||||
</if>
|
||||
<if test="hospitalIntroduce != null">hospital_introduce,
|
||||
</if>
|
||||
<if test="hospitalSort != null">hospital_sort,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="updateBy != null">update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="hospitalName != null">#{hospitalName},
|
||||
</if>
|
||||
<if test="hospitalCode != null">#{hospitalCode},
|
||||
</if>
|
||||
<if test="hospitalAddress != null">#{hospitalAddress},
|
||||
</if>
|
||||
<if test="phone != null">#{phone},
|
||||
</if>
|
||||
<if test="hospitalIntroduce != null">#{hospitalIntroduce},
|
||||
</if>
|
||||
<if test="hospitalSort != null">#{hospitalSort},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHospitalInfo" parameterType="com.xinelu.manage.domain.hospitalinfo.HospitalInfo">
|
||||
update hospital_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="hospitalName != null">hospital_name =
|
||||
#{hospitalName},
|
||||
</if>
|
||||
<if test="hospitalCode != null">hospital_code =
|
||||
#{hospitalCode},
|
||||
</if>
|
||||
<if test="hospitalAddress != null">hospital_address =
|
||||
#{hospitalAddress},
|
||||
</if>
|
||||
<if test="phone != null">phone =
|
||||
#{phone},
|
||||
</if>
|
||||
<if test="hospitalIntroduce != null">hospital_introduce =
|
||||
#{hospitalIntroduce},
|
||||
</if>
|
||||
<if test="hospitalSort != null">hospital_sort =
|
||||
#{hospitalSort},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHospitalInfoById" parameterType="Long">
|
||||
delete
|
||||
from hospital_info
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHospitalInfoByIds" parameterType="String">
|
||||
delete from hospital_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectHospitalNameCount" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from hospital_info
|
||||
where hospital_name = #{hospitalName}
|
||||
</select>
|
||||
|
||||
<select id="selectHospitalList" resultType="com.xinelu.manage.domain.hospitalinfo.HospitalInfo">
|
||||
<include refid="selectHospitalInfoVo"/>
|
||||
where id in
|
||||
<foreach item="ids" collection="array" open="(" separator="," close=")">
|
||||
#{ids}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,243 @@
|
||||
<?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.xinelu.manage.mapper.hospitalpersoncertificate.HospitalPersonCertificateMapper">
|
||||
|
||||
<resultMap type="com.xinelu.manage.domain.hospitalpersoncertificate.HospitalPersonCertificate" id="HospitalPersonCertificateResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="hospitalPersonId" column="hospital_person_id"/>
|
||||
<result property="certificateName" column="certificate_name"/>
|
||||
<result property="certificateCode" column="certificate_code"/>
|
||||
<result property="certificateUrl" column="certificate_url"/>
|
||||
<result property="certificateSort" column="certificate_sort"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHospitalPersonCertificateVo">
|
||||
select id,
|
||||
hospital_person_id,
|
||||
certificate_name,
|
||||
certificate_code,
|
||||
certificate_url,
|
||||
certificate_sort,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from hospital_person_certificate
|
||||
</sql>
|
||||
|
||||
<select id="selectHospitalPersonCertificateList"
|
||||
parameterType="com.xinelu.manage.dto.hospitalpersoncertificate.HospitalPersonCertificateDTO"
|
||||
resultType="com.xinelu.manage.vo.hospitalpersoncertificate.HospitalPersonCertificateVO">
|
||||
SELECT
|
||||
hpc.id,
|
||||
hpi.person_name,
|
||||
hpc.hospital_person_id,
|
||||
hpc.certificate_name,
|
||||
hpc.certificate_code,
|
||||
hpc.certificate_url,
|
||||
hpc.certificate_sort,
|
||||
hpc.create_by,
|
||||
hpc.create_time,
|
||||
hpc.update_by,
|
||||
hpc.update_time
|
||||
FROM
|
||||
hospital_person_certificate hpc
|
||||
LEFT JOIN hospital_person_info hpi ON hpi.id = hpc.hospital_person_id
|
||||
<where>
|
||||
<if test="hospitalPersonId != null ">
|
||||
and hpc.hospital_person_id = #{hospitalPersonId}
|
||||
</if>
|
||||
<if test="certificateName != null and certificateName != ''">
|
||||
and hpc.certificate_name like concat('%', #{certificateName}, '%')
|
||||
</if>
|
||||
<if test="certificateCode != null and certificateCode != ''">
|
||||
and hpc.certificate_code = #{certificateCode}
|
||||
</if>
|
||||
<if test="certificateUrl != null and certificateUrl != ''">
|
||||
and hpc.certificate_url = #{certificateUrl}
|
||||
</if>
|
||||
<if test="certificateSort != null ">
|
||||
and hpc.certificate_sort = #{certificateSort}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
hpc.hospital_person_id
|
||||
ORDER BY
|
||||
hpc.id
|
||||
</select>
|
||||
|
||||
<select id="selectHospitalPersonCertificateById" parameterType="Long"
|
||||
resultType="com.xinelu.manage.vo.hospitalpersoncertificate.HospitalPersonCertificateVO">
|
||||
SELECT hpc.id,
|
||||
hpi.person_name,
|
||||
hpc.hospital_person_id,
|
||||
hpc.certificate_name,
|
||||
hpc.certificate_code,
|
||||
hpc.certificate_url,
|
||||
hpc.certificate_sort,
|
||||
hpc.create_by,
|
||||
hpc.create_time,
|
||||
hpc.update_by,
|
||||
hpc.update_time
|
||||
FROM hospital_person_certificate hpc
|
||||
LEFT JOIN hospital_person_info hpi ON hpi.id = hpc.hospital_person_id
|
||||
where hpi.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertHospitalPersonCertificate" parameterType="com.xinelu.manage.domain.hospitalpersoncertificate.HospitalPersonCertificate" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into hospital_person_certificate
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="hospitalPersonId != null">hospital_person_id,
|
||||
</if>
|
||||
<if test="certificateName != null">certificate_name,
|
||||
</if>
|
||||
<if test="certificateCode != null">certificate_code,
|
||||
</if>
|
||||
<if test="certificateUrl != null">certificate_url,
|
||||
</if>
|
||||
<if test="certificateSort != null">certificate_sort,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="updateBy != null">update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="hospitalPersonId != null">#{hospitalPersonId},
|
||||
</if>
|
||||
<if test="certificateName != null">#{certificateName},
|
||||
</if>
|
||||
<if test="certificateCode != null">#{certificateCode},
|
||||
</if>
|
||||
<if test="certificateUrl != null">#{certificateUrl},
|
||||
</if>
|
||||
<if test="certificateSort != null">#{certificateSort},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHospitalPersonCertificate" parameterType="com.xinelu.manage.domain.hospitalpersoncertificate.HospitalPersonCertificate">
|
||||
update hospital_person_certificate
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="hospitalPersonId != null">hospital_person_id =
|
||||
#{hospitalPersonId},
|
||||
</if>
|
||||
<if test="certificateName != null">certificate_name =
|
||||
#{certificateName},
|
||||
</if>
|
||||
<if test="certificateCode != null">certificate_code =
|
||||
#{certificateCode},
|
||||
</if>
|
||||
<if test="certificateUrl != null">certificate_url =
|
||||
#{certificateUrl},
|
||||
</if>
|
||||
<if test="certificateSort != null">certificate_sort =
|
||||
#{certificateSort},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHospitalPersonCertificateById" parameterType="Long">
|
||||
delete
|
||||
from hospital_person_certificate
|
||||
where hospital_person_id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHospitalPersonCertificateByIds">
|
||||
delete from hospital_person_certificate where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="insertHospitalPersonCertificateList" parameterType="java.util.List">
|
||||
insert into hospital_person_certificate(
|
||||
hospital_person_id,
|
||||
certificate_name,
|
||||
certificate_code,
|
||||
certificate_url,
|
||||
certificate_sort,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
) values
|
||||
<foreach item="HospitalPersonCertificate" index="index" collection="list" separator=",">
|
||||
(
|
||||
#{HospitalPersonCertificate.hospitalPersonId},
|
||||
#{HospitalPersonCertificate.certificateName},
|
||||
#{HospitalPersonCertificate.certificateCode},
|
||||
#{HospitalPersonCertificate.certificateUrl},
|
||||
#{HospitalPersonCertificate.certificateSort},
|
||||
#{HospitalPersonCertificate.createBy},
|
||||
#{HospitalPersonCertificate.createTime},
|
||||
#{HospitalPersonCertificate.updateBy},
|
||||
#{HospitalPersonCertificate.updateTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="selectHospitalPersonCertificateByIds" parameterType="Long"
|
||||
resultType="com.xinelu.manage.domain.hospitalpersoncertificate.HospitalPersonCertificate">
|
||||
select id,
|
||||
hospital_person_id,
|
||||
certificate_name,
|
||||
certificate_code,
|
||||
certificate_url,
|
||||
certificate_sort,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from hospital_person_certificate
|
||||
<where>
|
||||
<if test="hospitalPersonIdsList != null and hospitalPersonIdsList.size()>0 ">
|
||||
and hospital_person_id in
|
||||
<foreach item="hospitalPersonIds" collection="hospitalPersonIdsList" open="(" separator=","
|
||||
close=")">
|
||||
#{hospitalPersonIds}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<delete id="deletePersonCertificateByPersonIds">
|
||||
delete from hospital_person_certificate where hospital_person_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,379 @@
|
||||
<?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.xinelu.manage.mapper.hospitalpersoninfo.HospitalPersonInfoMapper">
|
||||
|
||||
<resultMap type="com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo" id="HospitalPersonInfoResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="hospitalId" column="hospital_id"/>
|
||||
<result property="departmentId" column="department_id"/>
|
||||
<result property="personCode" column="person_code"/>
|
||||
<result property="personName" column="person_name"/>
|
||||
<result property="personPhone" column="person_phone"/>
|
||||
<result property="personAddress" column="person_address"/>
|
||||
<result property="cardNo" column="card_no"/>
|
||||
<result property="academicTitle" column="academic_title"/>
|
||||
<result property="consultingFee" column="consulting_fee"/>
|
||||
<result property="personIntroduce" column="person_introduce"/>
|
||||
<result property="personSort" column="person_sort"/>
|
||||
<result property="personPictureUrl" column="person_picture_url"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO" id="HospitalPersonByIdVO">
|
||||
<result property="id" column="id"/>
|
||||
<result property="hospitalId" column="hospital_id"/>
|
||||
<result property="departmentId" column="department_id"/>
|
||||
<result property="personCode" column="person_code"/>
|
||||
<result property="personName" column="person_name"/>
|
||||
<result property="personPhone" column="person_phone"/>
|
||||
<result property="personAddress" column="person_address"/>
|
||||
<result property="cardNo" column="card_no"/>
|
||||
<result property="academicTitle" column="academic_title"/>
|
||||
<result property="consultingFee" column="consulting_fee"/>
|
||||
<result property="personIntroduce" column="person_introduce"/>
|
||||
<result property="personSort" column="person_sort"/>
|
||||
<result property="personPictureUrl" column="person_picture_url"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="hospitalName" column="hospital_name"/>
|
||||
<result property="departmentName" column="department_name"/>
|
||||
<collection property="hospitalPersonCertificateList" javaType="java.util.List"
|
||||
resultMap="HospitalPersonInfoById"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.xinelu.manage.domain.hospitalpersoncertificate.HospitalPersonCertificate" id="HospitalPersonInfoById">
|
||||
<result property="hospitalPersonId" column="hospital_person_id"/>
|
||||
<result property="certificateName" column="certificate_name"/>
|
||||
<result property="certificateCode" column="certificate_code"/>
|
||||
<result property="certificateUrl" column="certificate_url"/>
|
||||
<result property="certificateSort" column="certificate_sort"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectHospitalPersonInfoVo">
|
||||
select id,
|
||||
hospital_id,
|
||||
department_id,
|
||||
person_code,
|
||||
person_name,
|
||||
person_phone,
|
||||
person_address,
|
||||
card_no,
|
||||
academic_title,
|
||||
consulting_fee,
|
||||
person_introduce,
|
||||
person_sort,
|
||||
person_picture_url,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from hospital_person_info
|
||||
</sql>
|
||||
|
||||
<select id="selectHospitalPersonInfoList"
|
||||
parameterType="com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO"
|
||||
resultType="com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO">
|
||||
SELECT
|
||||
hpi.id,
|
||||
hpi.hospital_id,
|
||||
hpi.department_id,
|
||||
hdi.hospital_name,
|
||||
hdi.department_name,
|
||||
hpi.person_code,
|
||||
hpi.person_name,
|
||||
hpi.person_phone,
|
||||
hpi.person_address,
|
||||
hpi.card_no,
|
||||
hpi.academic_title,
|
||||
hpi.consulting_fee,
|
||||
hpi.person_introduce,
|
||||
hpi.person_sort,
|
||||
hpi.person_picture_url,
|
||||
hpi.create_by,
|
||||
hpi.create_time,
|
||||
hpi.update_by,
|
||||
hpi.update_time
|
||||
FROM
|
||||
hospital_person_info hpi
|
||||
LEFT JOIN hospital_department_info hdi ON hpi.department_id = hdi.id
|
||||
<where>
|
||||
<if test="hospitalId != null ">
|
||||
and hpi.hospital_id = #{hospitalId}
|
||||
</if>
|
||||
<if test="departmentId != null ">
|
||||
and hpi.department_id = #{departmentId}
|
||||
</if>
|
||||
<if test="personCode != null and personCode != ''">
|
||||
and hpi.person_code = #{personCode}
|
||||
</if>
|
||||
<if test="personName != null and personName != ''">
|
||||
and hpi.person_name like concat('%', #{personName}, '%')
|
||||
</if>
|
||||
<if test="personPhone != null and personPhone != ''">
|
||||
and hpi.person_phone = #{personPhone}
|
||||
</if>
|
||||
<if test="personAddress != null and personAddress != ''">
|
||||
and hpi.person_address = #{personAddress}
|
||||
</if>
|
||||
<if test="cardNo != null and cardNo != ''">
|
||||
and hpi.card_no = #{cardNo}
|
||||
</if>
|
||||
<if test="academicTitle != null and academicTitle != ''">
|
||||
and hpi.academic_title = #{academicTitle}
|
||||
</if>
|
||||
<if test="consultingFee != null ">
|
||||
and hpi.consulting_fee = #{consultingFee}
|
||||
</if>
|
||||
<if test="personIntroduce != null and personIntroduce != ''">
|
||||
and hpi.person_introduce = #{personIntroduce}
|
||||
</if>
|
||||
<if test="personSort != null ">
|
||||
and hpi.person_sort = #{personSort}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
<select id="selectHospitalPersonInfoById" parameterType="Long"
|
||||
resultMap="HospitalPersonByIdVO">
|
||||
SELECT hpi.id,
|
||||
hpi.hospital_id,
|
||||
hpi.department_id,
|
||||
hdi.hospital_name,
|
||||
hdi.department_name,
|
||||
hpi.person_code,
|
||||
hpi.person_name,
|
||||
hpi.person_phone,
|
||||
hpi.person_address,
|
||||
hpi.card_no,
|
||||
hpi.academic_title,
|
||||
hpi.consulting_fee,
|
||||
hpi.person_introduce,
|
||||
hpi.person_sort,
|
||||
hpi.person_picture_url,
|
||||
hpi.create_by,
|
||||
hpi.create_time,
|
||||
hpi.update_by,
|
||||
hpi.update_time,
|
||||
hpc.hospital_person_id,
|
||||
hpc.certificate_name,
|
||||
hpc.certificate_code,
|
||||
hpc.certificate_url,
|
||||
hpc.certificate_sort
|
||||
FROM hospital_person_info hpi
|
||||
LEFT JOIN hospital_department_info hdi ON hpi.department_id = hdi.id
|
||||
LEFT JOIN hospital_person_certificate hpc ON hpi.id = hpc.hospital_person_id
|
||||
where hpi.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertHospitalPersonInfo" parameterType="com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into hospital_person_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="hospitalId != null">hospital_id,
|
||||
</if>
|
||||
<if test="departmentId != null">department_id,
|
||||
</if>
|
||||
<if test="personCode != null">person_code,
|
||||
</if>
|
||||
<if test="personName != null">person_name,
|
||||
</if>
|
||||
person_phone,
|
||||
<if test="personAddress != null">person_address,
|
||||
</if>
|
||||
card_no,
|
||||
<if test="academicTitle != null">academic_title,
|
||||
</if>
|
||||
<if test="consultingFee != null">consulting_fee,
|
||||
</if>
|
||||
<if test="personIntroduce != null">person_introduce,
|
||||
</if>
|
||||
<if test="personSort != null">person_sort,
|
||||
</if>
|
||||
<if test="personPictureUrl != null">person_picture_url,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="updateBy != null">update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="hospitalId != null">#{hospitalId},
|
||||
</if>
|
||||
<if test="departmentId != null">#{departmentId},
|
||||
</if>
|
||||
<if test="personCode != null">#{personCode},
|
||||
</if>
|
||||
<if test="personName != null">#{personName},
|
||||
</if>
|
||||
#{personPhone},
|
||||
<if test="personAddress != null">#{personAddress},
|
||||
</if>
|
||||
#{cardNo},
|
||||
<if test="academicTitle != null">#{academicTitle},
|
||||
</if>
|
||||
<if test="consultingFee != null">#{consultingFee},
|
||||
</if>
|
||||
<if test="personIntroduce != null">#{personIntroduce},
|
||||
</if>
|
||||
<if test="personSort != null">#{personSort},
|
||||
</if>
|
||||
<if test="personPictureUrl != null">#{personPictureUrl},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHospitalPersonInfo" parameterType="com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo">
|
||||
update hospital_person_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="hospitalId != null">hospital_id =
|
||||
#{hospitalId},
|
||||
</if>
|
||||
<if test="departmentId != null">department_id =
|
||||
#{departmentId},
|
||||
</if>
|
||||
<if test="personCode != null">person_code =
|
||||
#{personCode},
|
||||
</if>
|
||||
<if test="personName != null">person_name =
|
||||
#{personName},
|
||||
</if>
|
||||
person_phone = #{personPhone},
|
||||
<if test="personAddress != null">person_address =
|
||||
#{personAddress},
|
||||
</if>
|
||||
card_no = #{cardNo},
|
||||
<if test="academicTitle != null">academic_title =
|
||||
#{academicTitle},
|
||||
</if>
|
||||
<if test="consultingFee != null">consulting_fee =
|
||||
#{consultingFee},
|
||||
</if>
|
||||
<if test="personIntroduce != null">person_introduce =
|
||||
#{personIntroduce},
|
||||
</if>
|
||||
<if test="personSort != null">person_sort =
|
||||
#{personSort},
|
||||
</if>
|
||||
<if test="personPictureUrl != null">person_picture_url =
|
||||
#{personPictureUrl},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHospitalPersonInfoById" parameterType="Long">
|
||||
delete
|
||||
from hospital_person_info
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHospitalPersonInfoByIds" parameterType="String">
|
||||
delete from hospital_person_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectHospitalPersonInfoByCount" resultType="java.lang.Integer">
|
||||
select
|
||||
count(1)
|
||||
from hospital_person_info
|
||||
<where>
|
||||
<if test="personPhone != null and personPhone != ''">
|
||||
and person_phone = #{personPhone}
|
||||
</if>
|
||||
<if test="cardNo != null and cardNo != ''">
|
||||
and card_no = #{cardNo}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHospitalPersonByIds" parameterType="Long"
|
||||
resultType="com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo">
|
||||
select id,
|
||||
hospital_id,
|
||||
department_id,
|
||||
person_code,
|
||||
person_name,
|
||||
person_phone,
|
||||
person_address,
|
||||
card_no,
|
||||
academic_title,
|
||||
consulting_fee,
|
||||
person_introduce,
|
||||
person_sort,
|
||||
person_picture_url,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from hospital_person_info
|
||||
<where>
|
||||
<if test="hospitalPersonIdsList != null and hospitalPersonIdsList.size()>0 ">
|
||||
and id in
|
||||
<foreach item="hospitalPersonIds" collection="hospitalPersonIdsList" open="(" separator=","
|
||||
close=")">
|
||||
#{hospitalPersonIds}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHospitalPerson"
|
||||
resultType="com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo">
|
||||
select id,
|
||||
department_id,
|
||||
person_name,
|
||||
person_picture_url,
|
||||
academic_title,
|
||||
consulting_fee,
|
||||
person_introduce
|
||||
from hospital_person_info
|
||||
where department_id = #{departmentId}
|
||||
order by person_sort asc
|
||||
</select>
|
||||
|
||||
<select id="selectHospitalPersonInfoByIdCount" resultType="int">
|
||||
select
|
||||
count(1)
|
||||
from hospital_person_info
|
||||
<where>
|
||||
<if test="id != null ">
|
||||
and id = #{id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user