Browse Source

为物资管理,打卡记录管理添加excel导入功能

ry
loser 1 year ago
parent
commit
518092d442
  1. 24
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/CheckManageController.java
  2. 71
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/PatientManageController.java
  3. 50
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/supplies/NucleicController.java
  4. 50
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/supplies/VaccineController.java
  5. 35
      ruoyi-admin/src/main/resources/templates/check/checkManage/checkManage.html
  6. 8
      ruoyi-admin/src/main/resources/templates/patient/patientManage/patientManage.html
  7. 27
      ruoyi-admin/src/main/resources/templates/supplies/nucleic/nucleic.html
  8. 27
      ruoyi-admin/src/main/resources/templates/supplies/vaccine/vaccine.html
  9. 226
      ruoyi-common/src/main/java/com/ruoyi/common/core/controller/PatientManageBaseController.java
  10. 9
      ruoyi-system/src/main/java/com/ruoyi/supplies/mapper/NucleicMapper.java
  11. 8
      ruoyi-system/src/main/java/com/ruoyi/supplies/mapper/VaccineMapper.java
  12. 13
      ruoyi-system/src/main/java/com/ruoyi/system/domain/Nucleic.java
  13. 13
      ruoyi-system/src/main/java/com/ruoyi/system/domain/Vaccine.java
  14. 8
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/CheckManageMapper.java
  15. 8
      ruoyi-system/src/main/java/com/ruoyi/system/service/ICheckManageService.java
  16. 9
      ruoyi-system/src/main/java/com/ruoyi/system/service/INucleicService.java
  17. 9
      ruoyi-system/src/main/java/com/ruoyi/system/service/IVaccineService.java
  18. 69
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CheckManageServiceImpl.java
  19. 68
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/NucleicServiceImpl.java
  20. 2
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PatientManageServiceImpl.java
  21. 68
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/VaccineServiceImpl.java
  22. 12
      ruoyi-system/src/main/resources/mapper/CheckManageMapper.xml
  23. 12
      ruoyi-system/src/main/resources/mapper/supplies/NucleicMapper.xml
  24. 11
      ruoyi-system/src/main/resources/mapper/supplies/VaccineMapper.xml

24
ruoyi-admin/src/main/java/com/ruoyi/web/controller/CheckManageController.java

@ -18,6 +18,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/** /**
* 打卡管理Controller * 打卡管理Controller
@ -53,7 +54,28 @@ public class CheckManageController extends BaseController
List<CheckManage> list = checkManageService.selectCheckManageList(checkManage); List<CheckManage> list = checkManageService.selectCheckManageList(checkManage);
return getDataTable(list); return getDataTable(list);
} }
/**
* 导入患者管理列表
*/
@Log(title = "患者管理", businessType = BusinessType.IMPORT)
@RequiresPermissions("check:checkManage:import")
@PostMapping("/importData")
@ResponseBody
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<CheckManage> util = new ExcelUtil<CheckManage>(CheckManage.class);
List<CheckManage> checkList = util.importExcel(file.getInputStream());
String message = checkManageService.importCheck(checkList,updateSupport);
return AjaxResult.success(message);
}
@RequiresPermissions("patient:patientManage:view")
@GetMapping("/importTemplate")
@ResponseBody
public AjaxResult importTemplate()
{
ExcelUtil<CheckManage> util = new ExcelUtil<CheckManage>(CheckManage.class);
return util.importTemplateExcel("打卡人数据");
}
/** /**
* 导出打卡管理列表 * 导出打卡管理列表
*/ */

71
ruoyi-admin/src/main/java/com/ruoyi/web/controller/PatientManageController.java

@ -55,41 +55,6 @@ public class PatientManageController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
* 导入患者管理列表
*/
@Log(title = "患者管理", businessType = BusinessType.IMPORT)
@RequiresPermissions("patient:patientManage:import")
@PostMapping("/importData")
@ResponseBody
public AjaxResult importData(MultipartFile file,boolean updateSupport) throws Exception
{
ExcelUtil<PatientManage> util = new ExcelUtil<PatientManage>(PatientManage.class);
List<PatientManage> patientList = util.importExcel(file.getInputStream());
String message = patientManageService.importPatient(patientList,updateSupport);
return AjaxResult.success(message);
}
@RequiresPermissions("patient:patientManage:view")
@GetMapping("/importTemplate")
@ResponseBody
public AjaxResult importTemplate()
{
ExcelUtil<PatientManage> util = new ExcelUtil<PatientManage>(PatientManage.class);
return util.importTemplateExcel("患者数据");
}
/**
* 导出患者管理列表
*/
@RequiresPermissions("patient:patientManage:export")
@Log(title = "患者管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(PatientManage patientManage)
{
List<PatientManage> list = patientManageService.selectPatientManageList(patientManage);
ExcelUtil<PatientManage> util = new ExcelUtil<PatientManage>(PatientManage.class);
return util.exportExcel(list, "患者管理数据");
}
/** /**
@ -148,4 +113,40 @@ public class PatientManageController extends BaseController
{ {
return toAjax(patientManageService.deletePatientManageByPatientIds(ids)); return toAjax(patientManageService.deletePatientManageByPatientIds(ids));
} }
/**
* 导入患者管理列表
*/
@Log(title = "患者管理", businessType = BusinessType.IMPORT)
@RequiresPermissions("patient:patientManage:import")
@PostMapping("/importData")
@ResponseBody
public AjaxResult importData(MultipartFile file,boolean updateSupport) throws Exception
{
ExcelUtil<PatientManage> util = new ExcelUtil<PatientManage>(PatientManage.class);
List<PatientManage> patientList = util.importExcel(file.getInputStream());
String message = patientManageService.importPatient(patientList,updateSupport);
return AjaxResult.success(message);
}
@RequiresPermissions("patient:patientManage:view")
@GetMapping("/importTemplate")
@ResponseBody
public AjaxResult importTemplate()
{
ExcelUtil<PatientManage> util = new ExcelUtil<PatientManage>(PatientManage.class);
return util.importTemplateExcel("患者数据");
}
/**
* 导出患者管理列表
*/
@RequiresPermissions("patient:patientManage:export")
@Log(title = "患者管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(PatientManage patientManage)
{
List<PatientManage> list = patientManageService.selectPatientManageList(patientManage);
ExcelUtil<PatientManage> util = new ExcelUtil<PatientManage>(PatientManage.class);
return util.exportExcel(list, "患者管理数据");
}
} }

50
ruoyi-admin/src/main/java/com/ruoyi/web/controller/supplies/NucleicController.java

@ -18,6 +18,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/** /**
* 核酸管理Controller * 核酸管理Controller
@ -54,19 +55,7 @@ public class NucleicController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
* 导出核酸管理列表
*/
@RequiresPermissions("supplies:nucleic:export")
@Log(title = "核酸管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(Nucleic nucleic)
{
List<Nucleic> list = nucleicService.selectNucleicList(nucleic);
ExcelUtil<Nucleic> util = new ExcelUtil<Nucleic>(Nucleic.class);
return util.exportExcel(list, "核酸管理数据");
}
/** /**
* 新增核酸管理 * 新增核酸管理
@ -124,4 +113,39 @@ public class NucleicController extends BaseController
{ {
return toAjax(nucleicService.deleteNucleicByNucleicIds(ids)); return toAjax(nucleicService.deleteNucleicByNucleicIds(ids));
} }
/**
* 导入患者管理列表
*/
@Log(title = "患者管理", businessType = BusinessType.IMPORT)
@RequiresPermissions("patient:patientManage:import")
@PostMapping("/importData")
@ResponseBody
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<Nucleic> util = new ExcelUtil<Nucleic>(Nucleic.class);
List<Nucleic> nucleicList = util.importExcel(file.getInputStream());
String message = nucleicService.importNucleic(nucleicList,updateSupport);
return AjaxResult.success(message);
}
@RequiresPermissions("patient:patientManage:view")
@GetMapping("/importTemplate")
@ResponseBody
public AjaxResult importTemplate()
{
ExcelUtil<Nucleic> util = new ExcelUtil<Nucleic>(Nucleic.class);
return util.importTemplateExcel("核酸数据");
}
/**
* 导出核酸管理列表
*/
@RequiresPermissions("supplies:nucleic:export")
@Log(title = "核酸管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(Nucleic nucleic)
{
List<Nucleic> list = nucleicService.selectNucleicList(nucleic);
ExcelUtil<Nucleic> util = new ExcelUtil<Nucleic>(Nucleic.class);
return util.exportExcel(list, "核酸管理数据");
}
} }

50
ruoyi-admin/src/main/java/com/ruoyi/web/controller/supplies/VaccineController.java

@ -18,6 +18,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/** /**
* 疫苗管理Controller * 疫苗管理Controller
@ -54,19 +55,7 @@ public class VaccineController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
* 导出疫苗管理列表
*/
@RequiresPermissions("supplies:vaccine:export")
@Log(title = "疫苗管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(Vaccine vaccine)
{
List<Vaccine> list = vaccineService.selectVaccineList(vaccine);
ExcelUtil<Vaccine> util = new ExcelUtil<Vaccine>(Vaccine.class);
return util.exportExcel(list, "疫苗管理数据");
}
/** /**
* 新增疫苗管理 * 新增疫苗管理
@ -124,4 +113,39 @@ public class VaccineController extends BaseController
{ {
return toAjax(vaccineService.deleteVaccineByVaccineIds(ids)); return toAjax(vaccineService.deleteVaccineByVaccineIds(ids));
} }
/**
* 导入患者管理列表
*/
@Log(title = "患者管理", businessType = BusinessType.IMPORT)
@RequiresPermissions("patient:patientManage:import")
@PostMapping("/importData")
@ResponseBody
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<Vaccine> util = new ExcelUtil<Vaccine>(Vaccine.class);
List<Vaccine> vaccineList = util.importExcel(file.getInputStream());
String message = vaccineService.importVaccine(vaccineList,updateSupport);
return AjaxResult.success(message);
}
@RequiresPermissions("patient:patientManage:view")
@GetMapping("/importTemplate")
@ResponseBody
public AjaxResult importTemplate()
{
ExcelUtil<Vaccine> util = new ExcelUtil<Vaccine>(Vaccine.class);
return util.importTemplateExcel("疫苗数据");
}
/**
* 导出疫苗管理列表
*/
@RequiresPermissions("supplies:vaccine:export")
@Log(title = "疫苗管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(Vaccine vaccine)
{
List<Vaccine> list = vaccineService.selectVaccineList(vaccine);
ExcelUtil<Vaccine> util = new ExcelUtil<Vaccine>(Vaccine.class);
return util.exportExcel(list, "疫苗管理数据");
}
} }

35
ruoyi-admin/src/main/resources/templates/check/checkManage/checkManage.html

@ -23,22 +23,6 @@
<input type="text" name="patientIdCard"/> <input type="text" name="patientIdCard"/>
</li> </li>
<li> <li>
<label>确诊状态:</label>
<input type="text" name="isDiagnosed"/>
</li>
<li>
<label>治愈状态:</label>
<input type="text" name="isCure"/>
</li>
<li>
<label>密接状态:</label>
<input type="text" name="isTouch"/>
</li>
<li>
<label>死亡状态:</label>
<input type="text" name="isDead"/>
</li>
<li>
<label>备注:</label> <label>备注:</label>
<input type="text" name="description"/> <input type="text" name="description"/>
</li> </li>
@ -69,6 +53,9 @@
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="check:checkManage:remove"> <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="check:checkManage:remove">
<i class="fa fa-remove"></i> 删除 <i class="fa fa-remove"></i> 删除
</a> </a>
<a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="patient:patientManage:import">
<i class="fa fa-upload"></i> 导入
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="check:checkManage:export"> <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="check:checkManage:export">
<i class="fa fa-download"></i> 导出 <i class="fa fa-download"></i> 导出
</a> </a>
@ -91,6 +78,8 @@
updateUrl: prefix + "/edit/{id}", updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove", removeUrl: prefix + "/remove",
exportUrl: prefix + "/export", exportUrl: prefix + "/export",
importUrl: prefix + "/importData",
importTemplateUrl: prefix + "/importTemplate",
modalName: "打卡管理", modalName: "打卡管理",
columns: [{ columns: [{
checkbox: true checkbox: true
@ -159,4 +148,18 @@
}); });
</script> </script>
</body> </body>
<script id="importTpl" type="text/template">
<form enctype="multipart/form-data" class="mt20 mb10">
<div class="col-xs-offset-1">
<input type="file" id="file" name="file"/>
<div class="mt10 pt5">
<input type="checkbox" id="updateSupport" name="updateSupport" title="如果登录账户已经存在,更新这条数据。"> 是否更新已经存在的用户数据
&nbsp; <a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
</div>
<font color="red" class="pull-left mt10">
提示:仅允许导入“xls”或“xlsx”格式文件!
</font>
</div>
</form>
</script>
</html> </html>

8
ruoyi-admin/src/main/resources/templates/patient/patientManage/patientManage.html

@ -19,14 +19,14 @@
<input type="text" name="patientAge"/> <input type="text" name="patientAge"/>
</li> </li>
<li> <li>
<label>患者身份证:</label>
<input type="text" name="patientIdCard"/>
</li>
<li>
<label>备注:</label> <label>备注:</label>
<input type="text" name="description"/> <input type="text" name="description"/>
</li> </li>
<li> <li>
<label>患者身份证:</label>
<input type="text" name="patientIdCard"/>
</li>
<li>
<label>最近感染地区:</label> <label>最近感染地区:</label>
<input type="text" name="currentPosition"/> <input type="text" name="currentPosition"/>
</li> </li>

27
ruoyi-admin/src/main/resources/templates/supplies/nucleic/nucleic.html

@ -19,6 +19,10 @@
<input type="text" name="nucleicNumber"/> <input type="text" name="nucleicNumber"/>
</li> </li>
<li> <li>
<label>核酸编号:</label>
<input type="text" name="nucleicIdNumber"/>
</li>
<li>
<label>核酸描述:</label> <label>核酸描述:</label>
<input type="text" name="nucleicDescription"/> <input type="text" name="nucleicDescription"/>
</li> </li>
@ -41,6 +45,9 @@
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="supplies:nucleic:remove"> <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="supplies:nucleic:remove">
<i class="fa fa-remove"></i> 删除 <i class="fa fa-remove"></i> 删除
</a> </a>
<a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="supplies:nucleic:import">
<i class="fa fa-upload"></i> 导入
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="supplies:nucleic:export"> <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="supplies:nucleic:export">
<i class="fa fa-download"></i> 导出 <i class="fa fa-download"></i> 导出
</a> </a>
@ -63,6 +70,8 @@
updateUrl: prefix + "/edit/{id}", updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove", removeUrl: prefix + "/remove",
exportUrl: prefix + "/export", exportUrl: prefix + "/export",
importUrl: prefix + "/importData",
importTemplateUrl: prefix + "/importTemplate",
modalName: "核酸管理", modalName: "核酸管理",
columns: [{ columns: [{
checkbox: true checkbox: true
@ -80,6 +89,10 @@
field: 'nucleicNumber', field: 'nucleicNumber',
title: '核酸数量' title: '核酸数量'
}, },
{
field: 'nucleicIdNumber',
title: '核酸编号'
},
{ {
field: 'nucleicDescription', field: 'nucleicDescription',
title: '核酸描述' title: '核酸描述'
@ -99,4 +112,18 @@
}); });
</script> </script>
</body> </body>
<script id="importTpl" type="text/template">
<form enctype="multipart/form-data" class="mt20 mb10">
<div class="col-xs-offset-1">
<input type="file" id="file" name="file"/>
<div class="mt10 pt5">
<input type="checkbox" id="updateSupport" name="updateSupport" title="如果登录账户已经存在,更新这条数据。"> 是否更新已经存在的用户数据
&nbsp; <a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
</div>
<font color="red" class="pull-left mt10">
提示:仅允许导入“xls”或“xlsx”格式文件!
</font>
</div>
</form>
</script>
</html> </html>

27
ruoyi-admin/src/main/resources/templates/supplies/vaccine/vaccine.html

@ -19,6 +19,10 @@
<input type="text" name="vaccineDescription"/> <input type="text" name="vaccineDescription"/>
</li> </li>
<li> <li>
<label>疫苗编号:</label>
<input type="text" name="vaccineIdNumber"/>
</li>
<li>
<label>疫苗名字:</label> <label>疫苗名字:</label>
<input type="text" name="vaccineName"/> <input type="text" name="vaccineName"/>
</li> </li>
@ -41,6 +45,9 @@
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="supplies:vaccine:remove"> <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="supplies:vaccine:remove">
<i class="fa fa-remove"></i> 删除 <i class="fa fa-remove"></i> 删除
</a> </a>
<a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="supplies:vaccine:import">
<i class="fa fa-upload"></i> 导入
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="supplies:vaccine:export"> <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="supplies:vaccine:export">
<i class="fa fa-download"></i> 导出 <i class="fa fa-download"></i> 导出
</a> </a>
@ -63,6 +70,8 @@
updateUrl: prefix + "/edit/{id}", updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove", removeUrl: prefix + "/remove",
exportUrl: prefix + "/export", exportUrl: prefix + "/export",
importUrl: prefix + "/importData",
importTemplateUrl: prefix + "/importTemplate",
modalName: "疫苗管理", modalName: "疫苗管理",
columns: [{ columns: [{
checkbox: true checkbox: true
@ -76,6 +85,10 @@
field: 'vaccineNumber', field: 'vaccineNumber',
title: '疫苗数量' title: '疫苗数量'
}, },
{
field: 'vaccineIdNumber',
title: '疫苗编号'
},
{ {
field: 'vaccineDescription', field: 'vaccineDescription',
title: '疫苗描述' title: '疫苗描述'
@ -99,4 +112,18 @@
}); });
</script> </script>
</body> </body>
<script id="importTpl" type="text/template">
<form enctype="multipart/form-data" class="mt20 mb10">
<div class="col-xs-offset-1">
<input type="file" id="file" name="file"/>
<div class="mt10 pt5">
<input type="checkbox" id="updateSupport" name="updateSupport" title="如果登录账户已经存在,更新这条数据。"> 是否更新已经存在的用户数据
&nbsp; <a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
</div>
<font color="red" class="pull-left mt10">
提示:仅允许导入“xls”或“xlsx”格式文件!
</font>
</div>
</form>
</script>
</html> </html>

226
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/PatientManageBaseController.java

@ -0,0 +1,226 @@
package com.ruoyi.common.core.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.AjaxResult.Type;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.utils.*;
import com.ruoyi.common.utils.sql.SqlUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.beans.PropertyEditorSupport;
import java.util.Date;
import java.util.List;
/**
* web层通用数据处理
*
*
*/
public class PatientManageBaseController
{
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
/**
* 将前台传递过来的日期格式的字符串自动转化为Date类型
*/
@InitBinder
public void initBinder(WebDataBinder binder)
{
// Date 类型转换
binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
{
@Override
public void setAsText(String text)
{
setValue(DateUtils.parseDate(text));
}
});
}
/**
* 设置请求分页数据
*/
protected void startPage()
{
PageUtils.startPage();
}
/**
* 设置请求排序数据
*/
protected void startOrderBy()
{
PageDomain pageDomain = TableSupport.buildPageRequest();
if (StringUtils.isNotEmpty(pageDomain.getOrderBy()))
{
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
PageHelper.orderBy(orderBy);
}
}
/**
* 清理分页的线程变量
*/
protected void clearPage()
{
PageUtils.clearPage();
}
/**
* 获取request
*/
public HttpServletRequest getRequest()
{
return ServletUtils.getRequest();
}
/**
* 获取response
*/
public HttpServletResponse getResponse()
{
return ServletUtils.getResponse();
}
/**
* 获取session
*/
public HttpSession getSession()
{
return getRequest().getSession();
}
/**
* 响应请求分页数据
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
protected TableDataInfo getDataTable(List<?> list)
{
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(0);
rspData.setRows(list);
rspData.setTotal(new PageInfo(list).getTotal());
return rspData;
}
/**
* 响应返回结果
*
* @param rows 影响行数
* @return 操作结果
*/
protected AjaxResult toAjax(int rows)
{
return rows > 0 ? success() : error();
}
/**
* 响应返回结果
*
* @param result 结果
* @return 操作结果
*/
protected AjaxResult toAjax(boolean result)
{
return result ? success() : error();
}
/**
* 返回成功
*/
public AjaxResult success()
{
return AjaxResult.success();
}
/**
* 返回失败消息
*/
public AjaxResult error()
{
return AjaxResult.error();
}
/**
* 返回成功消息
*/
public AjaxResult success(String message)
{
return AjaxResult.success(message);
}
/**
* 返回成功数据
*/
public static AjaxResult success(Object data)
{
return AjaxResult.success("操作成功", data);
}
/**
* 返回失败消息
*/
public AjaxResult error(String message)
{
return AjaxResult.error(message);
}
/**
* 返回错误码消息
*/
public AjaxResult error(Type type, String message)
{
return new AjaxResult(type, message);
}
/**
* 页面跳转
*/
public String redirect(String url)
{
return StringUtils.format("redirect:{}", url);
}
/**
* 获取用户缓存信息
*/
public SysUser getSysUser()
{
return ShiroUtils.getSysUser();
}
/**
* 设置用户缓存信息
*/
public void setSysUser(SysUser user)
{
ShiroUtils.setSysUser(user);
}
/**
* 获取登录用户id
*/
public Long getUserId()
{
return getSysUser().getUserId();
}
/**
* 获取登录用户名
*/
public String getLoginName()
{
return getSysUser().getLoginName();
}
}

9
ruoyi-system/src/main/java/com/ruoyi/supplies/mapper/NucleicMapper.java

@ -2,6 +2,7 @@ package com.ruoyi.supplies.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.system.domain.Nucleic; import com.ruoyi.system.domain.Nucleic;
import com.ruoyi.system.domain.Vaccine;
/** /**
* 核酸管理Mapper接口 * 核酸管理Mapper接口
@ -58,4 +59,12 @@ public interface NucleicMapper
* @return 结果 * @return 结果
*/ */
public int deleteNucleicByNucleicIds(String[] nucleicIds); public int deleteNucleicByNucleicIds(String[] nucleicIds);
/**
* 通过编号查询核酸
*
* @param nucleicIdNumber 编号
* @return 核酸信息
*/
public Nucleic selectNucleicByNucleicIdNumber(String nucleicIdNumber);
} }

8
ruoyi-system/src/main/java/com/ruoyi/supplies/mapper/VaccineMapper.java

@ -58,4 +58,12 @@ public interface VaccineMapper
* @return 结果 * @return 结果
*/ */
public int deleteVaccineByVaccineIds(String[] vaccineIds); public int deleteVaccineByVaccineIds(String[] vaccineIds);
/**
* 通过编号查询疫苗
*
* @param vaccineIdNumber 编号
* @return 疫苗信息
*/
public Vaccine selectVaccineByVaccineIdNumber(String vaccineIdNumber);
} }

13
ruoyi-system/src/main/java/com/ruoyi/system/domain/Nucleic.java

@ -26,6 +26,10 @@ public class Nucleic extends BaseEntity
@Excel(name = "核酸数量") @Excel(name = "核酸数量")
private String nucleicNumber; private String nucleicNumber;
/** 核酸编号 */
@Excel(name = "核酸编号")
private String nucleicIdNumber;
/** 核酸描述 */ /** 核酸描述 */
@Excel(name = "核酸描述") @Excel(name = "核酸描述")
private String nucleicDescription; private String nucleicDescription;
@ -48,6 +52,14 @@ public class Nucleic extends BaseEntity
{ {
return nucleicName; return nucleicName;
} }
public String getnucleicIdNumber() {
return nucleicIdNumber;
}
public void setnucleicIdNumber(String nucleicIdNumber) {
this.nucleicIdNumber = nucleicIdNumber;
}
public void setnucleicNumber(String nucleicNumber) public void setnucleicNumber(String nucleicNumber)
{ {
this.nucleicNumber = nucleicNumber; this.nucleicNumber = nucleicNumber;
@ -73,6 +85,7 @@ public class Nucleic extends BaseEntity
.append("nucleicId", getnucleicId()) .append("nucleicId", getnucleicId())
.append("nucleicName", getnucleicName()) .append("nucleicName", getnucleicName())
.append("nucleicNumber", getnucleicNumber()) .append("nucleicNumber", getnucleicNumber())
.append("nucleicIdNumber", getnucleicIdNumber())
.append("nucleicDescription", getnucleicDescription()) .append("nucleicDescription", getnucleicDescription())
.toString(); .toString();
} }

13
ruoyi-system/src/main/java/com/ruoyi/system/domain/Vaccine.java

@ -22,6 +22,10 @@ public class Vaccine extends BaseEntity
@Excel(name = "疫苗数量") @Excel(name = "疫苗数量")
private String vaccineNumber; private String vaccineNumber;
/** 疫苗编号 */
@Excel(name = "疫苗编号")
private String vaccineIdNumber;
/** 疫苗描述 */ /** 疫苗描述 */
@Excel(name = "疫苗描述") @Excel(name = "疫苗描述")
private String vaccineDescription; private String vaccineDescription;
@ -67,11 +71,20 @@ public class Vaccine extends BaseEntity
return vaccineName; return vaccineName;
} }
public String getVaccineIdNumber() {
return vaccineIdNumber;
}
public void setVaccineIdNumber(String vaccineIdNumber) {
this.vaccineIdNumber = vaccineIdNumber;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("vaccineId", getVaccineId()) .append("vaccineId", getVaccineId())
.append("vaccineNumber", getVaccineNumber()) .append("vaccineNumber", getVaccineNumber())
.append("vaccineIdNumber", getVaccineIdNumber())
.append("vaccineDescription", getVaccineDescription()) .append("vaccineDescription", getVaccineDescription())
.append("vaccineName", getVaccineName()) .append("vaccineName", getVaccineName())
.toString(); .toString();

8
ruoyi-system/src/main/java/com/ruoyi/system/mapper/CheckManageMapper.java

@ -58,4 +58,12 @@ public interface CheckManageMapper
* @return 结果 * @return 结果
*/ */
public int deleteCheckManageByCheckManageIds(String[] checkManageIds); public int deleteCheckManageByCheckManageIds(String[] checkManageIds);
/**
* 通过身份证查询患者
*
* @param patientIdCard 身份证
* @return 患者信息
*/
public CheckManage selectCheckByPatientIdCard(String patientIdCard);
} }

8
ruoyi-system/src/main/java/com/ruoyi/system/service/ICheckManageService.java

@ -58,4 +58,12 @@ public interface ICheckManageService
* @return 结果 * @return 结果
*/ */
public int deleteCheckManageByCheckManageId(Long checkManageId); public int deleteCheckManageByCheckManageId(Long checkManageId);
/**
* 导入打卡数据
*
* @param checkList 患者数据列表
* @param isUpdateSupport 是否更新支持如果已存在则进行更新数据
* @return 结果
*/
public String importCheck(List<CheckManage> checkList, Boolean isUpdateSupport);
} }

9
ruoyi-system/src/main/java/com/ruoyi/system/service/INucleicService.java

@ -58,4 +58,13 @@ public interface INucleicService
* @return 结果 * @return 结果
*/ */
public int deleteNucleicByNucleicId(Long nucleicId); public int deleteNucleicByNucleicId(Long nucleicId);
/**
* 导入核酸数据
*
* @param nucleicList 患者数据列表
* @param isUpdateSupport 是否更新支持如果已存在则进行更新数据
* @return 结果
*/
public String importNucleic(List<Nucleic> nucleicList, Boolean isUpdateSupport);
} }

9
ruoyi-system/src/main/java/com/ruoyi/system/service/IVaccineService.java

@ -58,4 +58,13 @@ public interface IVaccineService
* @return 结果 * @return 结果
*/ */
public int deleteVaccineByVaccineId(Long vaccineId); public int deleteVaccineByVaccineId(Long vaccineId);
/**
* 导入疫苗数据
*
* @param vaccineList 患者数据列表
* @param isUpdateSupport 是否更新支持如果已存在则进行更新数据
* @return 结果
*/
public String importVaccine(List<Vaccine> vaccineList, Boolean isUpdateSupport);
} }

69
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CheckManageServiceImpl.java

@ -1,6 +1,12 @@
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bean.BeanValidators;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CheckManageMapper; import com.ruoyi.system.mapper.CheckManageMapper;
@ -8,6 +14,8 @@ import com.ruoyi.system.domain.CheckManage;
import com.ruoyi.system.service.ICheckManageService; import com.ruoyi.system.service.ICheckManageService;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import javax.validation.Validator;
/** /**
* 打卡管理Service业务层处理 * 打卡管理Service业务层处理
* *
@ -17,9 +25,11 @@ import com.ruoyi.common.core.text.Convert;
@Service @Service
public class CheckManageServiceImpl implements ICheckManageService public class CheckManageServiceImpl implements ICheckManageService
{ {
private static final Logger log = LoggerFactory.getLogger(PatientManageServiceImpl.class);
@Autowired @Autowired
private CheckManageMapper checkManageMapper; private CheckManageMapper checkManageMapper;
@Autowired
protected Validator validator;
/** /**
* 查询打卡管理 * 查询打卡管理
* *
@ -91,4 +101,61 @@ public class CheckManageServiceImpl implements ICheckManageService
{ {
return checkManageMapper.deleteCheckManageByCheckManageId(checkManageId); return checkManageMapper.deleteCheckManageByCheckManageId(checkManageId);
} }
@Override
public String importCheck(List<CheckManage> checkList, Boolean isUpdateSupport) {
if (StringUtils.isNull(checkList) || checkList.size() == 0)
{
throw new ServiceException("导入打卡数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
for (CheckManage checkManage : checkList)
{
try
{
// 验证是否存在这个患者
CheckManage p = checkManageMapper.selectCheckByPatientIdCard(checkManage.getPatientIdCard());
if (StringUtils.isNull(p))
{
BeanValidators.validateWithException(validator, checkManage);
this.insertCheckManage(checkManage);
successNum++;
successMsg.append("<br/>" + successNum + "、身份证: " + checkManage.getPatientIdCard() + " 导入成功");
}
else if (isUpdateSupport)
{
BeanValidators.validateWithException(validator, checkManage);
checkManage.setCheckManageId(p.getCheckManageId());
this.updateCheckManage(checkManage);
successNum++;
successMsg.append("<br/>" + successNum + "、身份证: " + checkManage.getPatientIdCard() + " 的打卡信息更新成功");
}
else
{
failureNum++;
failureMsg.append("<br/>" + failureNum + "、身份证 " + checkManage.getPatientIdCard() + " 已存在");
}
}
catch (Exception e)
{
failureNum++;
String msg = "<br/>" + failureNum + "、身份证 " + checkManage.getPatientIdCard() + " 导入失败:";
failureMsg.append(msg + e.getMessage());
log.error(msg, e);
}
}
if (failureNum > 0)
{
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
throw new ServiceException(failureMsg.toString());
}
else
{
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
}
} }

68
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/NucleicServiceImpl.java

@ -1,6 +1,12 @@
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bean.BeanValidators;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.supplies.mapper.NucleicMapper; import com.ruoyi.supplies.mapper.NucleicMapper;
@ -8,6 +14,8 @@ import com.ruoyi.system.domain.Nucleic;
import com.ruoyi.system.service.INucleicService; import com.ruoyi.system.service.INucleicService;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import javax.validation.Validator;
/** /**
* 核酸管理Service业务层处理 * 核酸管理Service业务层处理
* *
@ -17,6 +25,9 @@ import com.ruoyi.common.core.text.Convert;
@Service @Service
public class NucleicServiceImpl implements INucleicService public class NucleicServiceImpl implements INucleicService
{ {
private static final Logger log = LoggerFactory.getLogger(PatientManageServiceImpl.class);
@Autowired
protected Validator validator;
@Autowired @Autowired
private NucleicMapper nucleicMapper; private NucleicMapper nucleicMapper;
@ -91,4 +102,61 @@ public class NucleicServiceImpl implements INucleicService
{ {
return nucleicMapper.deleteNucleicByNucleicId(nucleicId); return nucleicMapper.deleteNucleicByNucleicId(nucleicId);
} }
@Override
public String importNucleic(List<Nucleic> nucleicList, Boolean isUpdateSupport) {
if (StringUtils.isNull(nucleicList) || nucleicList.size() == 0)
{
throw new ServiceException("导入患者数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
for (Nucleic nucleic : nucleicList)
{
try
{
// 验证是否存在这个疫苗
Nucleic p = nucleicMapper.selectNucleicByNucleicIdNumber(nucleic.getnucleicIdNumber());
if (StringUtils.isNull(p))
{
BeanValidators.validateWithException(validator, nucleic);
this.insertNucleic(nucleic);
successNum++;
successMsg.append("<br/>" + successNum + "、身份证: " + nucleic.getnucleicIdNumber() + " 导入成功");
}
else if (isUpdateSupport)
{
BeanValidators.validateWithException(validator, nucleic);
nucleic.setnucleicId(p.getnucleicId());
this.updateNucleic(nucleic);
successNum++;
successMsg.append("<br/>" + successNum + "、核酸编号: " + nucleic.getnucleicIdNumber() + " 的信息更新成功");
}
else
{
failureNum++;
failureMsg.append("<br/>" + failureNum + "、核酸编号: " + nucleic.getnucleicIdNumber() + " 已存在");
}
}
catch (Exception e)
{
failureNum++;
String msg = "<br/>" + failureNum + "、核酸编号 " + nucleic.getnucleicIdNumber() + " 导入失败:";
failureMsg.append(msg + e.getMessage());
log.error(msg, e);
}
}
if (failureNum > 0)
{
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
throw new ServiceException(failureMsg.toString());
}
else
{
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
}
} }

2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PatientManageServiceImpl.java

@ -165,7 +165,7 @@ public class PatientManageServiceImpl implements IPatientManageService
catch (Exception e) catch (Exception e)
{ {
failureNum++; failureNum++;
String msg = "<br/>" + failureNum + "、账号 " + patientManage.getPatientIdCard() + " 导入失败:"; String msg = "<br/>" + failureNum + "、身份证 " + patientManage.getPatientIdCard() + " 导入失败:";
failureMsg.append(msg + e.getMessage()); failureMsg.append(msg + e.getMessage());
log.error(msg, e); log.error(msg, e);
} }

68
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/VaccineServiceImpl.java

@ -1,6 +1,12 @@
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bean.BeanValidators;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.supplies.mapper.VaccineMapper; import com.ruoyi.supplies.mapper.VaccineMapper;
@ -8,6 +14,8 @@ import com.ruoyi.system.domain.Vaccine;
import com.ruoyi.system.service.IVaccineService; import com.ruoyi.system.service.IVaccineService;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import javax.validation.Validator;
/** /**
* 疫苗管理Service业务层处理 * 疫苗管理Service业务层处理
* *
@ -17,6 +25,9 @@ import com.ruoyi.common.core.text.Convert;
@Service @Service
public class VaccineServiceImpl implements IVaccineService public class VaccineServiceImpl implements IVaccineService
{ {
private static final Logger log = LoggerFactory.getLogger(PatientManageServiceImpl.class);
@Autowired
protected Validator validator;
@Autowired @Autowired
private VaccineMapper vaccineMapper; private VaccineMapper vaccineMapper;
@ -91,4 +102,61 @@ public class VaccineServiceImpl implements IVaccineService
{ {
return vaccineMapper.deleteVaccineByVaccineId(vaccineId); return vaccineMapper.deleteVaccineByVaccineId(vaccineId);
} }
@Override
public String importVaccine(List<Vaccine> vaccineList, Boolean isUpdateSupport) {
if (StringUtils.isNull(vaccineList) || vaccineList.size() == 0)
{
throw new ServiceException("导入患者数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
for (Vaccine vaccine : vaccineList)
{
try
{
// 验证是否存在这个疫苗
Vaccine p = vaccineMapper.selectVaccineByVaccineIdNumber(vaccine.getVaccineIdNumber());
if (StringUtils.isNull(p))
{
BeanValidators.validateWithException(validator, vaccine);
this.insertVaccine(vaccine);
successNum++;
successMsg.append("<br/>" + successNum + "、身份证: " + vaccine.getVaccineIdNumber() + " 导入成功");
}
else if (isUpdateSupport)
{
BeanValidators.validateWithException(validator, vaccine);
vaccine.setVaccineId(p.getVaccineId());
this.updateVaccine(vaccine);
successNum++;
successMsg.append("<br/>" + successNum + "、核酸编号: " + vaccine.getVaccineIdNumber() + " 的信息更新成功");
}
else
{
failureNum++;
failureMsg.append("<br/>" + failureNum + "、核酸编号: " + vaccine.getVaccineIdNumber() + " 已存在");
}
}
catch (Exception e)
{
failureNum++;
String msg = "<br/>" + failureNum + "、核酸编号 " + vaccine.getVaccineIdNumber() + " 导入失败:";
failureMsg.append(msg + e.getMessage());
log.error(msg, e);
}
}
if (failureNum > 0)
{
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
throw new ServiceException(failureMsg.toString());
}
else
{
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
}
} }

12
ruoyi-system/src/main/resources/mapper/CheckManageMapper.xml

@ -7,7 +7,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="CheckManage" id="CheckManageResult"> <resultMap type="CheckManage" id="CheckManageResult">
<result property="checkManageId" column="check_manage_id" /> <result property="checkManageId" column="check_manage_id" />
<result property="checkName" column="check_name" /> <result property="checkName" column="check_name" />
<result property="checkAge" column="check_age" />
<result property="checkSex" column="check_sex" /> <result property="checkSex" column="check_sex" />
<result property="patientIdCard" column="patient_id_card" /> <result property="patientIdCard" column="patient_id_card" />
<result property="isDiagnosed" column="is_diagnosed" /> <result property="isDiagnosed" column="is_diagnosed" />
@ -20,14 +19,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectCheckManageVo"> <sql id="selectCheckManageVo">
select check_manage_id, check_name, check_age, check_sex, patient_id_card, is_diagnosed, is_cure, is_touch, is_dead, description, check_postition, temperature from check_manage select check_manage_id, check_name, check_sex, patient_id_card, is_diagnosed, is_cure, is_touch, is_dead, description, check_postition, temperature from check_manage
</sql> </sql>
<select id="selectCheckManageList" parameterType="CheckManage" resultMap="CheckManageResult"> <select id="selectCheckManageList" parameterType="CheckManage" resultMap="CheckManageResult">
<include refid="selectCheckManageVo"/> <include refid="selectCheckManageVo"/>
<where> <where>
<if test="checkName != null and checkName != ''"> and check_name like concat('%', #{checkName}, '%')</if> <if test="checkName != null and checkName != ''"> and check_name like concat('%', #{checkName}, '%')</if>
<if test="checkAge != null and checkAge != ''"> and check_age = #{checkAge}</if>
<if test="checkSex != null "> and check_sex = #{checkSex}</if> <if test="checkSex != null "> and check_sex = #{checkSex}</if>
<if test="patientIdCard != null and patientIdCard != ''"> and patient_id_card = #{patientIdCard}</if> <if test="patientIdCard != null and patientIdCard != ''"> and patient_id_card = #{patientIdCard}</if>
<if test="isDiagnosed != null "> and is_diagnosed = #{isDiagnosed}</if> <if test="isDiagnosed != null "> and is_diagnosed = #{isDiagnosed}</if>
@ -49,7 +47,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into check_manage insert into check_manage
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="checkName != null">check_name,</if> <if test="checkName != null">check_name,</if>
<if test="checkAge != null">check_age,</if>
<if test="checkSex != null">check_sex,</if> <if test="checkSex != null">check_sex,</if>
<if test="patientIdCard != null">patient_id_card,</if> <if test="patientIdCard != null">patient_id_card,</if>
<if test="isDiagnosed != null">is_diagnosed,</if> <if test="isDiagnosed != null">is_diagnosed,</if>
@ -62,7 +59,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="checkName != null">#{checkName},</if> <if test="checkName != null">#{checkName},</if>
<if test="checkAge != null">#{checkAge},</if>
<if test="checkSex != null">#{checkSex},</if> <if test="checkSex != null">#{checkSex},</if>
<if test="patientIdCard != null">#{patientIdCard},</if> <if test="patientIdCard != null">#{patientIdCard},</if>
<if test="isDiagnosed != null">#{isDiagnosed},</if> <if test="isDiagnosed != null">#{isDiagnosed},</if>
@ -79,7 +75,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update check_manage update check_manage
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="checkName != null">check_name = #{checkName},</if> <if test="checkName != null">check_name = #{checkName},</if>
<if test="checkAge != null">check_age = #{checkAge},</if>
<if test="checkSex != null">check_sex = #{checkSex},</if> <if test="checkSex != null">check_sex = #{checkSex},</if>
<if test="patientIdCard != null">patient_id_card = #{patientIdCard},</if> <if test="patientIdCard != null">patient_id_card = #{patientIdCard},</if>
<if test="isDiagnosed != null">is_diagnosed = #{isDiagnosed},</if> <if test="isDiagnosed != null">is_diagnosed = #{isDiagnosed},</if>
@ -103,5 +98,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{checkManageId} #{checkManageId}
</foreach> </foreach>
</delete> </delete>
<select id="selectCheckByPatientIdCard" parameterType="String" resultMap="CheckManageResult">
<include refid="selectCheckManageVo"/>
where patient_id_card = #{patientIdCard}
</select>
</mapper> </mapper>

12
ruoyi-system/src/main/resources/mapper/supplies/NucleicMapper.xml

@ -8,11 +8,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="nucleicId" column="nucleic_id" /> <result property="nucleicId" column="nucleic_id" />
<result property="nucleicName" column="nucleic_name" /> <result property="nucleicName" column="nucleic_name" />
<result property="nucleicNumber" column="nucleic_number" /> <result property="nucleicNumber" column="nucleic_number" />
<result property="nucleicIdNumber" column="nucleic_id_number" />
<result property="nucleicDescription" column="nucleic_description" /> <result property="nucleicDescription" column="nucleic_description" />
</resultMap> </resultMap>
<sql id="selectNucleicVo"> <sql id="selectNucleicVo">
select nucleic_id, nucleic_name, nucleic_number, nucleic_description from nucleic select nucleic_id, nucleic_name, nucleic_number,nucleic_id_number, nucleic_description from nucleic
</sql> </sql>
<select id="selectNucleicList" parameterType="Nucleic" resultMap="NucleicResult"> <select id="selectNucleicList" parameterType="Nucleic" resultMap="NucleicResult">
@ -20,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
<if test="nucleicName != null and nucleicName != ''"> and nucleic_name like concat('%', #{nucleicName}, '%')</if> <if test="nucleicName != null and nucleicName != ''"> and nucleic_name like concat('%', #{nucleicName}, '%')</if>
<if test="nucleicNumber != null and nucleicNumber != ''"> and nucleic_number = #{nucleicNumber}</if> <if test="nucleicNumber != null and nucleicNumber != ''"> and nucleic_number = #{nucleicNumber}</if>
<if test="nucleicIdNumber != null and nucleicIdNumber != ''"> and nucleic_id_number = #{nucleicIdNumber}</if>
<if test="nucleicDescription != null and nucleicDescription != ''"> and nucleic_description = #{nucleicDescription}</if> <if test="nucleicDescription != null and nucleicDescription != ''"> and nucleic_description = #{nucleicDescription}</if>
</where> </where>
</select> </select>
@ -34,11 +36,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="nucleicName != null">nucleic_name,</if> <if test="nucleicName != null">nucleic_name,</if>
<if test="nucleicNumber != null">nucleic_number,</if> <if test="nucleicNumber != null">nucleic_number,</if>
<if test="nucleicIdNumber != null">nucleic_id_number,</if>
<if test="nucleicDescription != null">nucleic_description,</if> <if test="nucleicDescription != null">nucleic_description,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="nucleicName != null">#{nucleicName},</if> <if test="nucleicName != null">#{nucleicName},</if>
<if test="nucleicNumber != null">#{nucleicNumber},</if> <if test="nucleicNumber != null">#{nucleicNumber},</if>
<if test="nucleicIdNumber != null">#{nucleicIdNumber},</if>
<if test="nucleicDescription != null">#{nucleicDescription},</if> <if test="nucleicDescription != null">#{nucleicDescription},</if>
</trim> </trim>
</insert> </insert>
@ -48,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="nucleicName != null">nucleic_name = #{nucleicName},</if> <if test="nucleicName != null">nucleic_name = #{nucleicName},</if>
<if test="nucleicNumber != null">nucleic_number = #{nucleicNumber},</if> <if test="nucleicNumber != null">nucleic_number = #{nucleicNumber},</if>
<if test="nucleicIdNumber != null ">nucleic_id_number = #{nucleicIdNumber}</if>
<if test="nucleicDescription != null">nucleic_description = #{nucleicDescription},</if> <if test="nucleicDescription != null">nucleic_description = #{nucleicDescription},</if>
</trim> </trim>
where nucleic_id = #{nucleicId} where nucleic_id = #{nucleicId}
@ -63,5 +68,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{nucleicId} #{nucleicId}
</foreach> </foreach>
</delete> </delete>
<select id="selectNucleicByNucleicIdNumber" parameterType="String" resultMap="NucleicResult">
<include refid="selectNucleicVo"/>
where nucleic_id_number = #{nucleicIdNumber}
</select>
</mapper> </mapper>

11
ruoyi-system/src/main/resources/mapper/supplies/VaccineMapper.xml

@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="Vaccine" id="VaccineResult"> <resultMap type="Vaccine" id="VaccineResult">
<result property="vaccineId" column="vaccine_id" /> <result property="vaccineId" column="vaccine_id" />
<result property="vaccineNumber" column="vaccine_number" /> <result property="vaccineNumber" column="vaccine_number" />
<result property="vaccineIdNumber" column="vaccine_id_number" />
<result property="vaccineDescription" column="vaccine_description" /> <result property="vaccineDescription" column="vaccine_description" />
<result property="vaccineName" column="vaccine_name" /> <result property="vaccineName" column="vaccine_name" />
</resultMap> </resultMap>
@ -19,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectVaccineVo"/> <include refid="selectVaccineVo"/>
<where> <where>
<if test="vaccineNumber != null and vaccineNumber != ''"> and vaccine_number = #{vaccineNumber}</if> <if test="vaccineNumber != null and vaccineNumber != ''"> and vaccine_number = #{vaccineNumber}</if>
<if test="vaccineIdNumber != null and vaccineIdNumber != ''"> and vaccine_id_number = #{vaccineIdNumber}</if>
<if test="vaccineDescription != null and vaccineDescription != ''"> and vaccine_description = #{vaccineDescription}</if> <if test="vaccineDescription != null and vaccineDescription != ''"> and vaccine_description = #{vaccineDescription}</if>
<if test="vaccineName != null and vaccineName != ''"> and vaccine_name like concat('%', #{vaccineName}, '%')</if> <if test="vaccineName != null and vaccineName != ''"> and vaccine_name like concat('%', #{vaccineName}, '%')</if>
</where> </where>
@ -33,11 +35,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into vaccine insert into vaccine
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="vaccineNumber != null">vaccine_number,</if> <if test="vaccineNumber != null">vaccine_number,</if>
<if test="vaccineIdNumber != null">vaccine_id_number,</if>
<if test="vaccineDescription != null">vaccine_description,</if> <if test="vaccineDescription != null">vaccine_description,</if>
<if test="vaccineName != null">vaccine_name,</if> <if test="vaccineName != null">vaccine_name,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="vaccineNumber != null">#{vaccineNumber},</if> <if test="vaccineNumber != null">#{vaccineNumber},</if>
<if test="vaccineIdNumber != null">#{vaccineIdNumber},</if>
<if test="vaccineDescription != null">#{vaccineDescription},</if> <if test="vaccineDescription != null">#{vaccineDescription},</if>
<if test="vaccineName != null">#{vaccineName},</if> <if test="vaccineName != null">#{vaccineName},</if>
</trim> </trim>
@ -47,6 +51,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update vaccine update vaccine
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="vaccineNumber != null">vaccine_number = #{vaccineNumber},</if> <if test="vaccineNumber != null">vaccine_number = #{vaccineNumber},</if>
<if test="vaccineIdNumber != null ">vaccine_id_number = #{vaccineIdNumber}</if>
<if test="vaccineDescription != null">vaccine_description = #{vaccineDescription},</if> <if test="vaccineDescription != null">vaccine_description = #{vaccineDescription},</if>
<if test="vaccineName != null">vaccine_name = #{vaccineName},</if> <if test="vaccineName != null">vaccine_name = #{vaccineName},</if>
</trim> </trim>
@ -63,5 +69,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{vaccineId} #{vaccineId}
</foreach> </foreach>
</delete> </delete>
<select id="selectVaccineByVaccineIdNumber" parameterType="String" resultMap="VaccineResult">
<include refid="selectVaccineVo"/>
where vaccine_id_number = #{vaccineIdNumber}
</select>
</mapper> </mapper>
Loading…
Cancel
Save