护理耗材代码移植
This commit is contained in:
parent
0606df37cb
commit
6467f549e7
@ -0,0 +1,151 @@
|
|||||||
|
package com.xinelu.manage.controller.nursestationconsumable;
|
||||||
|
|
||||||
|
import com.xinelu.common.annotation.Log;
|
||||||
|
import com.xinelu.common.constant.Constants;
|
||||||
|
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.nursestationconsumable.NurseStationConsumable;
|
||||||
|
import com.xinelu.manage.dto.nursestationconsumable.NurseStationConsumableDTO;
|
||||||
|
import com.xinelu.manage.dto.nursestationconsumable.NurseStationConsumableImportlDTO;
|
||||||
|
import com.xinelu.manage.service.nursestationconsumable.INurseStationConsumableService;
|
||||||
|
import com.xinelu.manage.vo.nursestationconsumable.NurseStationConsumableVO;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站耗材信息Controller
|
||||||
|
*
|
||||||
|
* @author 纪寒
|
||||||
|
* @date 2022-09-05
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/stationConsumable")
|
||||||
|
public class NurseStationConsumableController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private INurseStationConsumableService nurseStationConsumableService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理站耗材信息列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:stationConsumable:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(NurseStationConsumable nurseStationConsumable) {
|
||||||
|
startPage();
|
||||||
|
List<NurseStationConsumableVO> list = nurseStationConsumableService.selectNurseStationConsumableList(nurseStationConsumable);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出护理站耗材信息列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:stationConsumable:export')")
|
||||||
|
@Log(title = "护理站耗材信息", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, NurseStationConsumable nurseStationConsumable) {
|
||||||
|
List<NurseStationConsumableVO> list = nurseStationConsumableService.selectNurseStationConsumableList(nurseStationConsumable);
|
||||||
|
ExcelUtil<NurseStationConsumableVO> util = new ExcelUtil<>(NurseStationConsumableVO.class);
|
||||||
|
util.exportExcel(response, list, "护理站耗材信息数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入护理站耗材信息列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:stationConsumable:importStationConsumable')")
|
||||||
|
@Log(title = "导入护理站耗材信息", businessType = BusinessType.IMPORT)
|
||||||
|
@PostMapping("/importData")
|
||||||
|
public AjaxResult importData(MultipartFile file) throws Exception {
|
||||||
|
//判断excel里面是否有数据/文件格式
|
||||||
|
if (Objects.isNull(file) || StringUtils.isBlank(file.getOriginalFilename())) {
|
||||||
|
return AjaxResult.error("请选择所需要上传的护理耗材文件信息!");
|
||||||
|
}
|
||||||
|
// 获取文件名
|
||||||
|
String orgName = file.getOriginalFilename();
|
||||||
|
if (!orgName.endsWith(Constants.XLSX) && !orgName.endsWith(Constants.XLS)) {
|
||||||
|
return AjaxResult.error("导入文件格式不正确,请导入xlsx或xls格式的文件!");
|
||||||
|
}
|
||||||
|
ExcelUtil<NurseStationConsumableImportlDTO> util = new ExcelUtil<>(NurseStationConsumableImportlDTO.class);
|
||||||
|
List<NurseStationConsumableImportlDTO> list = util.importExcel(file.getInputStream());
|
||||||
|
return nurseStationConsumableService.importData(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取护理站耗材信息详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:stationConsumable:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
|
return AjaxResult.success(nurseStationConsumableService.selectNurseStationConsumableById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增护理站耗材信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:stationConsumable:add')")
|
||||||
|
@Log(title = "护理站耗材信息", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/add")
|
||||||
|
public AjaxResult add(@Validated(Insert.class) @RequestBody NurseStationConsumableDTO nurseStationConsumableDTO) throws Exception {
|
||||||
|
//校验耗材包价格是为负数
|
||||||
|
if (CollectionUtils.isEmpty(nurseStationConsumableDTO.getNurseStationConsumables())) {
|
||||||
|
return AjaxResult.error("请添加护理站耗材信息!");
|
||||||
|
}
|
||||||
|
NurseStationConsumable nurseStationConsumable = nurseStationConsumableDTO.getNurseStationConsumables().stream().filter(item -> Objects.nonNull(item.getConsumablePrice()) && item.getConsumablePrice().compareTo(BigDecimal.ZERO) < 0).findFirst().orElse(null);
|
||||||
|
if (Objects.nonNull(nurseStationConsumable)) {
|
||||||
|
return AjaxResult.error("耗材包价格不能为负数,请重新输入!");
|
||||||
|
}
|
||||||
|
return nurseStationConsumableService.insertNurseStationConsumable(nurseStationConsumableDTO.getNurseStationConsumables());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改护理站耗材信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:stationConsumable:edit')")
|
||||||
|
@Log(title = "护理站耗材信息", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
public AjaxResult edit(@Validated(Update.class) @RequestBody NurseStationConsumable nurseStationConsumable) {
|
||||||
|
//校验护理站耗材价格
|
||||||
|
if (Objects.nonNull(nurseStationConsumable.getConsumablePrice()) && nurseStationConsumable.getConsumablePrice().compareTo(BigDecimal.ZERO) < 0) {
|
||||||
|
return AjaxResult.error("耗材包价格不能为负数,请重新输入!");
|
||||||
|
}
|
||||||
|
return toAjax(nurseStationConsumableService.updateNurseStationConsumable(nurseStationConsumable));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除护理站耗材信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:stationConsumable:remove')")
|
||||||
|
@Log(title = "护理站耗材信息", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
|
return toAjax(nurseStationConsumableService.deleteNurseStationConsumableByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据服务站id查询护理站耗材信息列表(无分页)
|
||||||
|
*
|
||||||
|
* @param stationId 护理站id
|
||||||
|
* @return 护理站列表信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:stationConsumable:list')")
|
||||||
|
@GetMapping("/getListByStationId")
|
||||||
|
public AjaxResult getListByStationId(@RequestParam("stationId") Long stationId) {
|
||||||
|
NurseStationConsumable nurseStationConsumable = new NurseStationConsumable();
|
||||||
|
nurseStationConsumable.setNurseStationId(stationId);
|
||||||
|
List<NurseStationConsumableVO> list = nurseStationConsumableService.selectNurseStationConsumableList(nurseStationConsumable);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,110 @@
|
|||||||
|
package com.xinelu.manage.domain.nursestationconsumable;
|
||||||
|
|
||||||
|
import com.xinelu.common.annotation.Excel;
|
||||||
|
import com.xinelu.common.core.domain.BaseDomain;
|
||||||
|
import com.xinelu.common.custominterface.Insert;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import net.sf.jsqlparser.statement.update.Update;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站耗材信息对象 nurse_station_consumable
|
||||||
|
*
|
||||||
|
* @author xinyilu
|
||||||
|
* @date 2022-09-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel(value = "护理站耗材信息对象", description = "nurse_station_consumable")
|
||||||
|
public class NurseStationConsumable extends BaseDomain implements Serializable {
|
||||||
|
private static final long serialVersionUID = -279751860921592017L;
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "护理站id不能为空", groups = {Insert.class, Update.class})
|
||||||
|
private Long nurseStationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "创建人id")
|
||||||
|
@Excel(name = "创建人id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 耗材包编号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "耗材包编号")
|
||||||
|
@Excel(name = "耗材包编号")
|
||||||
|
private String consumableCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务项目耗材包详情
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "服务项目耗材包详情")
|
||||||
|
@Excel(name = "服务项目耗材包详情")
|
||||||
|
@NotNull(message = "服务项目耗材包详情不能为空", groups = {Insert.class, Update.class})
|
||||||
|
@Length(max = 100, message = "服务项目耗材包详情不能超过100个字符", groups = {Insert.class, Update.class})
|
||||||
|
private String consumableDetail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 耗材包单位
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "耗材包单位")
|
||||||
|
@Excel(name = "耗材包单位")
|
||||||
|
@NotNull(message = "耗材包单位不能为空", groups = {Insert.class, Update.class})
|
||||||
|
@Length(max = 10, message = "耗材包单位不能超过10个字符", groups = {Insert.class, Update.class})
|
||||||
|
private String consumableUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 耗材包价格
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "耗材包价格")
|
||||||
|
@Excel(name = "耗材包价格")
|
||||||
|
@NotNull(message = "耗材包价格不能为空", groups = {Insert.class, Update.class})
|
||||||
|
private BigDecimal consumablePrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "排序")
|
||||||
|
@Excel(name = "排序")
|
||||||
|
@NotNull(message = "排序不能为空", groups = {Insert.class, Update.class})
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("userId", getUserId())
|
||||||
|
.append("consumableCode", getConsumableCode())
|
||||||
|
.append("consumableDetail", getConsumableDetail())
|
||||||
|
.append("consumableUnit", getConsumableUnit())
|
||||||
|
.append("consumablePrice", getConsumablePrice())
|
||||||
|
.append("sort", getSort())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package com.xinelu.manage.dto.nursestationconsumable;
|
||||||
|
|
||||||
|
import com.xinelu.manage.domain.nursestationconsumable.NurseStationConsumable;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wanghao
|
||||||
|
* @create 2022/9/13 0013
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class NurseStationConsumableDTO implements Serializable {
|
||||||
|
private static final long serialVersionUID = -7850626319073510902L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站耗材信息集合
|
||||||
|
*/
|
||||||
|
@Valid
|
||||||
|
private List<NurseStationConsumable> nurseStationConsumables;
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
package com.xinelu.manage.dto.nursestationconsumable;
|
||||||
|
|
||||||
|
import com.xinelu.common.annotation.Excel;
|
||||||
|
import com.xinelu.common.core.domain.BaseDomain;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wanghao
|
||||||
|
* @create 2022/9/14 0014
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class NurseStationConsumableImportlDTO extends BaseDomain implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1901885669841912320L;
|
||||||
|
@Excel(name = "护理站名称")
|
||||||
|
private String nurseStationName;
|
||||||
|
|
||||||
|
@Excel(name = "耗材名称")
|
||||||
|
private String consumableDetail;
|
||||||
|
|
||||||
|
@Excel(name = "计量单位")
|
||||||
|
private String consumableUnit;
|
||||||
|
|
||||||
|
@Excel(name = "单价")
|
||||||
|
private BigDecimal consumablePrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站code
|
||||||
|
*/
|
||||||
|
private String consumableCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站id
|
||||||
|
*/
|
||||||
|
private Long nurseStationId;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!super.equals(o)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
NurseStationConsumableImportlDTO that = (NurseStationConsumableImportlDTO) o;
|
||||||
|
return Objects.equals(nurseStationName, that.nurseStationName) && Objects.equals(consumableDetail, that.consumableDetail);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(super.hashCode(), nurseStationName, consumableDetail);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,73 @@
|
|||||||
|
package com.xinelu.manage.mapper.nursestationconsumable;
|
||||||
|
|
||||||
|
|
||||||
|
import com.xinelu.manage.domain.nursestationconsumable.NurseStationConsumable;
|
||||||
|
import com.xinelu.manage.dto.nursestationconsumable.NurseStationConsumableImportlDTO;
|
||||||
|
import com.xinelu.manage.vo.nursestationconsumable.NurseStationConsumableVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站耗材信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author 纪寒
|
||||||
|
* @date 2022-09-05
|
||||||
|
*/
|
||||||
|
public interface NurseStationConsumableMapper {
|
||||||
|
/**
|
||||||
|
* 查询护理站耗材信息
|
||||||
|
*
|
||||||
|
* @param id 护理站耗材信息主键
|
||||||
|
* @return 护理站耗材信息
|
||||||
|
*/
|
||||||
|
NurseStationConsumableVO selectNurseStationConsumableById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理站耗材信息列表
|
||||||
|
*
|
||||||
|
* @param nurseStationConsumable 护理站耗材信息
|
||||||
|
* @return 护理站耗材信息集合
|
||||||
|
*/
|
||||||
|
List<NurseStationConsumableVO> selectNurseStationConsumableList(NurseStationConsumable nurseStationConsumable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询耗材信息
|
||||||
|
*
|
||||||
|
* @param nurseStationNameList 护理站名称集合
|
||||||
|
* @return 耗材信息集合
|
||||||
|
*/
|
||||||
|
List<NurseStationConsumableImportlDTO> selectConsumableInfoList(@Param("nurseStationNameList") List<String> nurseStationNameList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增护理站耗材信息
|
||||||
|
*
|
||||||
|
* @param nurseStationConsumable 护理站耗材信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertNurseStationConsumable(List<NurseStationConsumable> nurseStationConsumable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改护理站耗材信息
|
||||||
|
*
|
||||||
|
* @param nurseStationConsumable 护理站耗材信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateNurseStationConsumable(NurseStationConsumable nurseStationConsumable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除护理站耗材信息
|
||||||
|
*
|
||||||
|
* @param id 护理站耗材信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteNurseStationConsumableById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除护理站耗材信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteNurseStationConsumableByIds(Long[] ids);
|
||||||
|
}
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
package com.xinelu.manage.service.nursestationconsumable;
|
||||||
|
|
||||||
|
|
||||||
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
|
import com.xinelu.manage.domain.nursestationconsumable.NurseStationConsumable;
|
||||||
|
import com.xinelu.manage.dto.nursestationconsumable.NurseStationConsumableImportlDTO;
|
||||||
|
import com.xinelu.manage.vo.nursestationconsumable.NurseStationConsumableVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站耗材信息Service接口
|
||||||
|
*
|
||||||
|
* @author 纪寒
|
||||||
|
* @date 2022-09-05
|
||||||
|
*/
|
||||||
|
public interface INurseStationConsumableService {
|
||||||
|
/**
|
||||||
|
* 查询护理站耗材信息
|
||||||
|
*
|
||||||
|
* @param id 护理站耗材信息主键
|
||||||
|
* @return 护理站耗材信息
|
||||||
|
*/
|
||||||
|
NurseStationConsumableVO selectNurseStationConsumableById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理站耗材信息列表
|
||||||
|
*
|
||||||
|
* @param nurseStationConsumable 护理站耗材信息
|
||||||
|
* @return 护理站耗材信息集合
|
||||||
|
*/
|
||||||
|
List<NurseStationConsumableVO> selectNurseStationConsumableList(NurseStationConsumable nurseStationConsumable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增护理站耗材信息
|
||||||
|
*
|
||||||
|
* @param nurseStationConsumable 护理站耗材信息
|
||||||
|
* @return 结果
|
||||||
|
* @throws Exception 异常处理
|
||||||
|
*/
|
||||||
|
AjaxResult insertNurseStationConsumable(List<NurseStationConsumable> nurseStationConsumable) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入护理站耗材信息列表
|
||||||
|
*
|
||||||
|
* @param nurseStationConsumableImport 护理站耗材信息列表
|
||||||
|
* @return AjaxResult
|
||||||
|
* @throws Exception 异常处理
|
||||||
|
*/
|
||||||
|
AjaxResult importData(List<NurseStationConsumableImportlDTO> nurseStationConsumableImport) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改护理站耗材信息
|
||||||
|
*
|
||||||
|
* @param nurseStationConsumable 护理站耗材信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateNurseStationConsumable(NurseStationConsumable nurseStationConsumable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除护理站耗材信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的护理站耗材信息主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteNurseStationConsumableByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除护理站耗材信息信息
|
||||||
|
*
|
||||||
|
* @param id 护理站耗材信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteNurseStationConsumableById(Long id);
|
||||||
|
}
|
||||||
@ -0,0 +1,180 @@
|
|||||||
|
package com.xinelu.manage.service.nursestationconsumable.impl;
|
||||||
|
|
||||||
|
import com.xinelu.manage.domain.nursestation.NurseStation;
|
||||||
|
import com.xinelu.manage.domain.nursestationconsumable.NurseStationConsumable;
|
||||||
|
import com.xinelu.manage.dto.nursestationconsumable.NurseStationConsumableImportlDTO;
|
||||||
|
import com.xinelu.manage.mapper.nursestation.NurseStationMapper;
|
||||||
|
import com.xinelu.manage.mapper.nursestationconsumable.NurseStationConsumableMapper;
|
||||||
|
import com.xinelu.manage.service.nursestationconsumable.INurseStationConsumableService;
|
||||||
|
import com.xinelu.manage.vo.nursestationconsumable.NurseStationConsumableVO;
|
||||||
|
import com.xinelu.common.constant.Constants;
|
||||||
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
|
import com.xinelu.common.core.domain.model.LoginUser;
|
||||||
|
import com.xinelu.common.utils.SecurityUtils;
|
||||||
|
import com.xinelu.common.utils.bean.BeanUtils;
|
||||||
|
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站耗材信息Service业务层处理
|
||||||
|
*
|
||||||
|
* @author 纪寒
|
||||||
|
* @date 2022-09-05
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class NurseStationConsumableServiceImpl implements INurseStationConsumableService {
|
||||||
|
@Resource
|
||||||
|
private NurseStationConsumableMapper nurseStationConsumableMapper;
|
||||||
|
@Resource
|
||||||
|
private GenerateSystemCodeUtil generateSystemCodeUtil;
|
||||||
|
@Resource
|
||||||
|
private NurseStationMapper nurseStationMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理站耗材信息
|
||||||
|
*
|
||||||
|
* @param id 护理站耗材信息主键
|
||||||
|
* @return 护理站耗材信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public NurseStationConsumableVO selectNurseStationConsumableById(Long id) {
|
||||||
|
return nurseStationConsumableMapper.selectNurseStationConsumableById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理站耗材信息列表
|
||||||
|
*
|
||||||
|
* @param nurseStationConsumable 护理站耗材信息
|
||||||
|
* @return 护理站耗材信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<NurseStationConsumableVO> selectNurseStationConsumableList(NurseStationConsumable nurseStationConsumable) {
|
||||||
|
return nurseStationConsumableMapper.selectNurseStationConsumableList(nurseStationConsumable);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增护理站耗材信息
|
||||||
|
*
|
||||||
|
* @param nurseStationConsumable 护理站耗材信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public AjaxResult insertNurseStationConsumable(List<NurseStationConsumable> nurseStationConsumable) throws Exception {
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
for (NurseStationConsumable stationConsumable : nurseStationConsumable) {
|
||||||
|
stationConsumable.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
stationConsumable.setCreateTime(LocalDateTime.now());
|
||||||
|
stationConsumable.setUserId(loginUser.getUserId());
|
||||||
|
stationConsumable.setConsumableCode(Constants.STATION_CONSUMABLE + generateSystemCodeUtil.generateSystemCode(Constants.STATION_CONSUMABLE));
|
||||||
|
}
|
||||||
|
int i = nurseStationConsumableMapper.insertNurseStationConsumable(nurseStationConsumable);
|
||||||
|
if (i <= 0) {
|
||||||
|
throw new Exception("新增护理站耗材信息失败, 请联系管理员!");
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入护理站耗材信息列表
|
||||||
|
*
|
||||||
|
* @param list 输入参数
|
||||||
|
* @return 导入数据
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public AjaxResult importData(List<NurseStationConsumableImportlDTO> list) throws Exception {
|
||||||
|
//获取当前用户
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
AjaxResult.error("请添加护理站耗材导入数据!");
|
||||||
|
}
|
||||||
|
//获取护理站的名称
|
||||||
|
List<String> stationNameList = list.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getNurseStationName())).map(NurseStationConsumableImportlDTO::getNurseStationName).distinct().collect(Collectors.toList());
|
||||||
|
//获取所有的耗材信息
|
||||||
|
List<NurseStationConsumableImportlDTO> nurseStationItemVo = nurseStationConsumableMapper.selectConsumableInfoList(stationNameList);
|
||||||
|
//求出差集,进行新增
|
||||||
|
Collection<NurseStationConsumableImportlDTO> subtractList = CollectionUtils.subtract(list, nurseStationItemVo);
|
||||||
|
//求出并集,重复数据
|
||||||
|
Collection<NurseStationConsumableImportlDTO> intersectionList = CollectionUtils.intersection(list, nurseStationItemVo);
|
||||||
|
//如果差集为null直接返回
|
||||||
|
if (CollectionUtils.isEmpty(subtractList)) {
|
||||||
|
Map<String, Collection<NurseStationConsumableImportlDTO>> map = new HashMap<>();
|
||||||
|
map.put("successList", subtractList);
|
||||||
|
map.put("failList", intersectionList);
|
||||||
|
return AjaxResult.success(map);
|
||||||
|
}
|
||||||
|
//获取到所有的护理站信息
|
||||||
|
List<NurseStation> nurseStations = nurseStationMapper.selectNurseStationListByNames(stationNameList);
|
||||||
|
Map<String, Long> nurseStationLabelMap = nurseStations.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getNurseStationName())).collect(Collectors.toMap(NurseStation::getNurseStationName, NurseStation::getId));
|
||||||
|
//设置护理站id
|
||||||
|
list.forEach(item -> item.setNurseStationId(nurseStationLabelMap.getOrDefault(item.getNurseStationName(), 0L)));
|
||||||
|
//集合
|
||||||
|
List<NurseStationConsumable> nurseStationConsumables = new ArrayList<>();
|
||||||
|
//添加创建时间/护理站编号/判断如果没有护理站信息,添加0L
|
||||||
|
subtractList.forEach(item -> {
|
||||||
|
//设置编号
|
||||||
|
item.setConsumableCode(Constants.STATION_CONSUMABLE + generateSystemCodeUtil.generateSystemCode(Constants.STATION_CONSUMABLE));
|
||||||
|
item.setCreateTime(LocalDateTime.now());
|
||||||
|
item.setUserId(loginUser.getUserId());
|
||||||
|
//如果查找不到护理站id 就存0L
|
||||||
|
if (item.getNurseStationId() == null) {
|
||||||
|
item.setNurseStationId(0L);
|
||||||
|
}
|
||||||
|
NurseStationConsumable nurseStationConsumable = new NurseStationConsumable();
|
||||||
|
BeanUtils.copyProperties(item, nurseStationConsumable);
|
||||||
|
nurseStationConsumables.add(nurseStationConsumable);
|
||||||
|
});
|
||||||
|
int i = nurseStationConsumableMapper.insertNurseStationConsumable(nurseStationConsumables);
|
||||||
|
if (i <= 0) {
|
||||||
|
throw new Exception("护理站耗材信息导入失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
Map<String, Collection<NurseStationConsumableImportlDTO>> map = new HashMap<>();
|
||||||
|
map.put("successList", subtractList);
|
||||||
|
map.put("failList", intersectionList);
|
||||||
|
return AjaxResult.success(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改护理站耗材信息
|
||||||
|
*
|
||||||
|
* @param nurseStationConsumable 护理站耗材信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateNurseStationConsumable(NurseStationConsumable nurseStationConsumable) {
|
||||||
|
nurseStationConsumable.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
nurseStationConsumable.setUpdateTime(LocalDateTime.now());
|
||||||
|
return nurseStationConsumableMapper.updateNurseStationConsumable(nurseStationConsumable);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除护理站耗材信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的护理站耗材信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteNurseStationConsumableByIds(Long[] ids) {
|
||||||
|
return nurseStationConsumableMapper.deleteNurseStationConsumableByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除护理站耗材信息信息
|
||||||
|
*
|
||||||
|
* @param id 护理站耗材信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteNurseStationConsumableById(Long id) {
|
||||||
|
return nurseStationConsumableMapper.deleteNurseStationConsumableById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.xinelu.manage.vo.nursestationconsumable;
|
||||||
|
|
||||||
|
import com.xinelu.common.annotation.Excel;
|
||||||
|
import com.xinelu.manage.domain.nursestationconsumable.NurseStationConsumable;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wanghao
|
||||||
|
* @create 2022/9/14 0014
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class NurseStationConsumableVO extends NurseStationConsumable {
|
||||||
|
private static final long serialVersionUID = -4554444945316565353L;
|
||||||
|
|
||||||
|
@Excel(name = "护理站名称")
|
||||||
|
private String nurseStationName;
|
||||||
|
}
|
||||||
@ -2,7 +2,7 @@
|
|||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.xinelu.applet.mapper.nursestationclassifyrelation.NurseStationClassifyRelationMapper">
|
<mapper namespace="com.xinelu.manage.mapper.nursestationclassifyrelation.NurseStationClassifyRelationMapper">
|
||||||
|
|
||||||
<resultMap type="NurseStationClassifyRelation" id="NurseStationClassifyRelationResult">
|
<resultMap type="NurseStationClassifyRelation" id="NurseStationClassifyRelationResult">
|
||||||
<result property="id" column="id"/>
|
<result property="id" column="id"/>
|
||||||
@ -0,0 +1,184 @@
|
|||||||
|
<?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.nursestationconsumable.NurseStationConsumableMapper">
|
||||||
|
|
||||||
|
<resultMap type="NurseStationConsumable" id="NurseStationConsumableResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="nurseStationId" column="nurse_station_id"/>
|
||||||
|
<result property="userId" column="user_id"/>
|
||||||
|
<result property="consumableCode" column="consumable_code"/>
|
||||||
|
<result property="consumableDetail" column="consumable_detail"/>
|
||||||
|
<result property="consumableUnit" column="consumable_unit"/>
|
||||||
|
<result property="consumablePrice" column="consumable_price"/>
|
||||||
|
<result property="sort" column="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="selectNurseStationConsumableVo">
|
||||||
|
select id,
|
||||||
|
nurse_station_id,
|
||||||
|
user_id,
|
||||||
|
consumable_code,
|
||||||
|
consumable_detail,
|
||||||
|
consumable_unit,
|
||||||
|
consumable_price,
|
||||||
|
sort,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
update_by,
|
||||||
|
update_time
|
||||||
|
from nurse_station_consumable
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectNurseStationConsumableList" parameterType="NurseStationConsumable"
|
||||||
|
resultType="com.xinelu.manage.vo.nursestationconsumable.NurseStationConsumableVO">
|
||||||
|
select
|
||||||
|
nsc.id,
|
||||||
|
nsc.nurse_station_id,
|
||||||
|
nsc.user_id,
|
||||||
|
nsc.consumable_code,
|
||||||
|
nsc.consumable_detail,
|
||||||
|
nsc.consumable_unit,
|
||||||
|
nsc.consumable_price,
|
||||||
|
nsc.sort,
|
||||||
|
nsc.create_by,
|
||||||
|
nsc.create_time,
|
||||||
|
ns.nurse_station_name
|
||||||
|
FROM nurse_station_consumable nsc
|
||||||
|
LEFT JOIN nurse_station ns on ns.id = nsc.nurse_station_id
|
||||||
|
<where>
|
||||||
|
<if test="nurseStationId != null ">
|
||||||
|
and nsc.nurse_station_id = #{nurseStationId}
|
||||||
|
</if>
|
||||||
|
<if test="userId != null ">
|
||||||
|
and nsc.user_id = #{dto.userId}
|
||||||
|
</if>
|
||||||
|
<if test="consumableCode != null and consumableCode != ''">
|
||||||
|
and nsc.consumable_code like concat('%', #{consumableCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="consumableDetail != null and consumableDetail != ''">
|
||||||
|
and nsc.consumable_detail like concat('%', #{consumableDetail}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="consumableUnit != null and consumableUnit != ''">
|
||||||
|
and nsc.consumable_unit = #{consumableUnit}
|
||||||
|
</if>
|
||||||
|
<if test="consumablePrice != null ">
|
||||||
|
and nsc.consumable_price = #{consumablePrice}
|
||||||
|
</if>
|
||||||
|
<if test="sort != null ">
|
||||||
|
and nsc.sort = #{dto.sort}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY nsc.create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectNurseStationConsumableById" parameterType="Long"
|
||||||
|
resultType="com.xinelu.manage.vo.nursestationconsumable.NurseStationConsumableVO">
|
||||||
|
SELECT nsc.id,
|
||||||
|
nsc.consumable_detail,
|
||||||
|
nsc.consumable_unit,
|
||||||
|
nsc.consumable_price,
|
||||||
|
nsc.sort,
|
||||||
|
ns.id nurseStationId,
|
||||||
|
ns.nurse_station_name
|
||||||
|
FROM nurse_station_consumable nsc
|
||||||
|
LEFT JOIN nurse_station ns on ns.id = nsc.nurse_station_id
|
||||||
|
where nsc.id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertNurseStationConsumable" parameterType="java.util.List">
|
||||||
|
INSERT INTO
|
||||||
|
nurse_station_consumable(nurse_station_id, user_id, consumable_code,
|
||||||
|
consumable_detail,consumable_unit,consumable_price, sort, create_by, create_time, update_by, update_time)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" item="productCategory" index="index"
|
||||||
|
separator=",">
|
||||||
|
(
|
||||||
|
#{productCategory.nurseStationId},
|
||||||
|
#{productCategory.userId},
|
||||||
|
#{productCategory.consumableCode},
|
||||||
|
#{productCategory.consumableDetail},
|
||||||
|
#{productCategory.consumableUnit},
|
||||||
|
#{productCategory.consumablePrice},
|
||||||
|
#{productCategory.sort},
|
||||||
|
#{productCategory.createBy},
|
||||||
|
#{productCategory.createTime},
|
||||||
|
#{productCategory.updateBy},
|
||||||
|
#{productCategory.updateTime}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateNurseStationConsumable" parameterType="NurseStationConsumable">
|
||||||
|
update nurse_station_consumable
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="nurseStationId != null">nurse_station_id =
|
||||||
|
#{nurseStationId},
|
||||||
|
</if>
|
||||||
|
<if test="userId != null">user_id =
|
||||||
|
#{userId},
|
||||||
|
</if>
|
||||||
|
<if test="consumableCode != null">consumable_code =
|
||||||
|
#{consumableCode},
|
||||||
|
</if>
|
||||||
|
<if test="consumableDetail != null">consumable_detail =
|
||||||
|
#{consumableDetail},
|
||||||
|
</if>
|
||||||
|
<if test="consumableUnit != null">consumable_unit =
|
||||||
|
#{consumableUnit},
|
||||||
|
</if>
|
||||||
|
<if test="consumablePrice != null">consumable_price =
|
||||||
|
#{consumablePrice},
|
||||||
|
</if>
|
||||||
|
<if test="sort != null">sort =
|
||||||
|
#{sort},
|
||||||
|
</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="deleteNurseStationConsumableById" parameterType="Long">
|
||||||
|
delete
|
||||||
|
from nurse_station_consumable
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteNurseStationConsumableByIds" parameterType="String">
|
||||||
|
delete from nurse_station_consumable where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
<select id="selectConsumableInfoList" parameterType="String"
|
||||||
|
resultType="com.xinelu.manage.dto.nursestationconsumable.NurseStationConsumableImportlDTO">
|
||||||
|
SELECT ns.nurse_station_name,
|
||||||
|
nsc.consumable_detail
|
||||||
|
FROM nurse_station_consumable nsc
|
||||||
|
LEFT JOIN nurse_station ns ON ns.id = nsc.nurse_station_id
|
||||||
|
<where>
|
||||||
|
<if test="nurseStationNameList != null and nurseStationNameList.size() > 0">
|
||||||
|
and ns.nurse_station_name in
|
||||||
|
<foreach item="nurseStationName" collection="nurseStationNameList" open="(" separator="," close=")">
|
||||||
|
#{nurseStationName}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@ -2,7 +2,7 @@
|
|||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.xinelu.applet.mapper.nursestationlabel.NurseStationLabelMapper">
|
<mapper namespace="com.xinelu.manage.mapper.nursestationlabel.NurseStationLabelMapper">
|
||||||
|
|
||||||
<resultMap type="NurseStationLabel" id="NurseStationLabelResult">
|
<resultMap type="NurseStationLabel" id="NurseStationLabelResult">
|
||||||
<result property="id" column="id"/>
|
<result property="id" column="id"/>
|
||||||
@ -0,0 +1,168 @@
|
|||||||
|
<?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.nursestationpersoncheck.NurseStationPersonCheckMapper">
|
||||||
|
|
||||||
|
<resultMap type="NurseStationPersonCheck" id="NurseStationPersonCheckResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="nurseStationPersonId" column="nurse_station_person_id"/>
|
||||||
|
<result property="certificateName" column="certificate_name"/>
|
||||||
|
<result property="certificateCode" column="certificate_code"/>
|
||||||
|
<result property="certificateUrl" column="certificate_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>
|
||||||
|
|
||||||
|
<sql id="selectNurseStationPersonCheckVo">
|
||||||
|
select id,
|
||||||
|
nurse_station_person_id,
|
||||||
|
certificate_name,
|
||||||
|
certificate_code,
|
||||||
|
certificate_url,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
update_by,
|
||||||
|
update_time
|
||||||
|
from nurse_station_person_check
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectNurseStationPersonCheckList" parameterType="NurseStationPersonCheck"
|
||||||
|
resultMap="NurseStationPersonCheckResult">
|
||||||
|
<include refid="selectNurseStationPersonCheckVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="nurseStationPersonId != null ">
|
||||||
|
and nurse_station_person_id = #{nurseStationPersonId}
|
||||||
|
</if>
|
||||||
|
<if test="certificateName != null and certificateName != ''">
|
||||||
|
and certificate_name like concat('%', #{certificateName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="certificateCode != null and certificateCode != ''">
|
||||||
|
and certificate_code = #{certificateCode}
|
||||||
|
</if>
|
||||||
|
<if test="certificateUrl != null and certificateUrl != ''">
|
||||||
|
and certificate_url = #{certificateUrl}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectNurseStationPersonCheckById" parameterType="Long"
|
||||||
|
resultMap="NurseStationPersonCheckResult">
|
||||||
|
<include refid="selectNurseStationPersonCheckVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertNurseStationPersonCheck" parameterType="NurseStationPersonCheck" useGeneratedKeys="true"
|
||||||
|
keyProperty="id">
|
||||||
|
insert into nurse_station_person_check
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="nurseStationPersonId != null">nurse_station_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="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="nurseStationPersonId != null">#{nurseStationPersonId},
|
||||||
|
</if>
|
||||||
|
<if test="certificateName != null">#{certificateName},
|
||||||
|
</if>
|
||||||
|
<if test="certificateCode != null">#{certificateCode},
|
||||||
|
</if>
|
||||||
|
<if test="certificateUrl != null">#{certificateUrl},
|
||||||
|
</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="updateNurseStationPersonCheck" parameterType="NurseStationPersonCheck">
|
||||||
|
update nurse_station_person_check
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="nurseStationPersonId != null">nurse_station_person_id =
|
||||||
|
#{nurseStationPersonId},
|
||||||
|
</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="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="deleteNurseStationPersonCheckById" parameterType="Long">
|
||||||
|
delete
|
||||||
|
from nurse_station_person_check
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteNurseStationPersonCheckByIds" parameterType="String">
|
||||||
|
delete from nurse_station_person_check where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="insertNurseStationPersonCheckList" parameterType="java.util.List">
|
||||||
|
insert into nurse_station_person_check(
|
||||||
|
nurse_station_person_id,
|
||||||
|
certificate_name,
|
||||||
|
certificate_code,
|
||||||
|
certificate_url,
|
||||||
|
sort,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
update_by,
|
||||||
|
update_time
|
||||||
|
) values
|
||||||
|
<foreach item="NurseStationPersonCheck" index="index" collection="list" separator=",">
|
||||||
|
(
|
||||||
|
#{NurseStationPersonCheck.nurseStationPersonId},
|
||||||
|
#{NurseStationPersonCheck.certificateName},
|
||||||
|
#{NurseStationPersonCheck.certificateCode},
|
||||||
|
#{NurseStationPersonCheck.certificateUrl},
|
||||||
|
#{NurseStationPersonCheck.sort},
|
||||||
|
#{NurseStationPersonCheck.createBy},
|
||||||
|
#{NurseStationPersonCheck.createTime},
|
||||||
|
#{NurseStationPersonCheck.updateBy},
|
||||||
|
#{NurseStationPersonCheck.updateTime}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue
Block a user