From 3acec3660921f22b58bdaa85d61a2fcfba8e6c98 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 21 六月 2023 10:11:31 +0800
Subject: [PATCH] 问卷列表
---
smartor/src/main/resources/mapper/smartor/SvyLibTitleMapper.xml | 121 ++++++-----
smartor/src/main/java/com/smartor/mapper/SvyLibTitleMapper.java | 3
smartor/src/main/java/com/smartor/service/ISvyLibTitleService.java | 23 +-
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyCategoryController.java | 3
smartor/src/main/java/com/smartor/service/impl/SvyLibTitleServiceImpl.java | 61 +++--
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibTitleController.java | 56 ++--
smartor/src/main/java/com/smartor/domain/SvyLibTitleReq.java | 45 ++++
smartor/src/main/java/com/smartor/domain/SvyLibTitle.java | 284 ++++++++-------------------
8 files changed, 283 insertions(+), 313 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyCategoryController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyCategoryController.java
index f9b4d93..ccb0e4e 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyCategoryController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyCategoryController.java
@@ -70,6 +70,7 @@
*/
@PreAuthorize("@ss.hasPermi('smartor:svycategory:add')")
@Log(title = "闂嵎鍒嗙被", businessType = BusinessType.INSERT)
+ @ApiOperation("鏂板闂嵎鍒嗙被")
@PostMapping
public AjaxResult add(@RequestBody SvyCategory svyCategory) {
return toAjax(svyCategoryService.insertSvyCategory(svyCategory));
@@ -80,6 +81,7 @@
*/
@PreAuthorize("@ss.hasPermi('smartor:svycategory:edit')")
@Log(title = "闂嵎鍒嗙被", businessType = BusinessType.UPDATE)
+ @ApiOperation("淇敼闂嵎鍒嗙被")
@PutMapping
public AjaxResult edit(@RequestBody SvyCategory svyCategory) {
return toAjax(svyCategoryService.updateSvyCategory(svyCategory));
@@ -90,6 +92,7 @@
*/
@PreAuthorize("@ss.hasPermi('smartor:svycategory:remove')")
@Log(title = "闂嵎鍒嗙被", businessType = BusinessType.DELETE)
+ @ApiOperation("鍒犻櫎闂嵎鍒嗙被")
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(svyCategoryService.deleteSvyCategoryByIds(ids));
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibTitleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibTitleController.java
index 92a1846..f66b29b 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibTitleController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibTitleController.java
@@ -2,6 +2,10 @@
import java.util.List;
import javax.servlet.http.HttpServletResponse;
+
+import com.smartor.domain.SvyLibTitleReq;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -23,49 +27,48 @@
/**
* 闂嵎Controller
- *
+ *
* @author ruoyi
* @date 2023-03-02
*/
+@Api(description = "闂嵎")
@RestController
@RequestMapping("/smartor/svytitle")
-public class SvyLibTitleController extends BaseController
-{
+public class SvyLibTitleController extends BaseController {
@Autowired
private ISvyLibTitleService svyLibTitleService;
/**
* 鏌ヨ闂嵎鍒楄〃
*/
+ @ApiOperation("鏌ヨ闂嵎鍒楄〃")
@PreAuthorize("@ss.hasPermi('smartor:svytitle:list')")
- @GetMapping("/list")
- public TableDataInfo list(SvyLibTitle svyLibTitle)
- {
+ @GetMapping("/selectSvyLibTitlelist")
+ public TableDataInfo selectSvyLibTitlelist(SvyLibTitleReq svyLibTitleReq) {
startPage();
- List<SvyLibTitle> list = svyLibTitleService.selectSvyLibTitleList(svyLibTitle);
+ List<SvyLibTitle> list = svyLibTitleService.selectSvyLibTitleList(svyLibTitleReq);
return getDataTable(list);
}
- /**
- * 瀵煎嚭闂嵎鍒楄〃
- */
- @PreAuthorize("@ss.hasPermi('smartor:svytitle:export')")
- @Log(title = "闂嵎", businessType = BusinessType.EXPORT)
- @PostMapping("/export")
- public void export(HttpServletResponse response, SvyLibTitle svyLibTitle)
- {
- List<SvyLibTitle> list = svyLibTitleService.selectSvyLibTitleList(svyLibTitle);
- ExcelUtil<SvyLibTitle> util = new ExcelUtil<SvyLibTitle>(SvyLibTitle.class);
- util.exportExcel(response, list, "闂嵎鏁版嵁");
- }
+// /**
+// * 瀵煎嚭闂嵎鍒楄〃
+// */
+// @PreAuthorize("@ss.hasPermi('smartor:svytitle:export')")
+// @Log(title = "闂嵎", businessType = BusinessType.EXPORT)
+// @PostMapping("/export")
+// public void export(HttpServletResponse response, SvyLibTitle svyLibTitle)
+// {
+// List<SvyLibTitle> list = svyLibTitleService.selectSvyLibTitleList(svyLibTitle);
+// ExcelUtil<SvyLibTitle> util = new ExcelUtil<SvyLibTitle>(SvyLibTitle.class);
+// util.exportExcel(response, list, "闂嵎鏁版嵁");
+// }
/**
* 鑾峰彇闂嵎璇︾粏淇℃伅
*/
@PreAuthorize("@ss.hasPermi('smartor:svytitle:query')")
@GetMapping(value = "/{svyid}")
- public AjaxResult getInfo(@PathVariable("svyid") Long svyid)
- {
+ public AjaxResult getInfo(@PathVariable("svyid") Long svyid) {
return success(svyLibTitleService.selectSvyLibTitleBySvyid(svyid));
}
@@ -75,8 +78,7 @@
@PreAuthorize("@ss.hasPermi('smartor:svytitle:add')")
@Log(title = "闂嵎", businessType = BusinessType.INSERT)
@PostMapping
- public AjaxResult add(@RequestBody SvyLibTitle svyLibTitle)
- {
+ public AjaxResult add(@RequestBody SvyLibTitle svyLibTitle) {
return toAjax(svyLibTitleService.insertSvyLibTitle(svyLibTitle));
}
@@ -86,8 +88,7 @@
@PreAuthorize("@ss.hasPermi('smartor:svytitle:edit')")
@Log(title = "闂嵎", businessType = BusinessType.UPDATE)
@PutMapping
- public AjaxResult edit(@RequestBody SvyLibTitle svyLibTitle)
- {
+ public AjaxResult edit(@RequestBody SvyLibTitle svyLibTitle) {
return toAjax(svyLibTitleService.updateSvyLibTitle(svyLibTitle));
}
@@ -96,9 +97,8 @@
*/
@PreAuthorize("@ss.hasPermi('smartor:svytitle:remove')")
@Log(title = "闂嵎", businessType = BusinessType.DELETE)
- @DeleteMapping("/{svyids}")
- public AjaxResult remove(@PathVariable Long[] svyids)
- {
+ @DeleteMapping("/{svyids}")
+ public AjaxResult remove(@PathVariable Long[] svyids) {
return toAjax(svyLibTitleService.deleteSvyLibTitleBySvyids(svyids));
}
}
diff --git a/smartor/src/main/java/com/smartor/domain/SvyLibTitle.java b/smartor/src/main/java/com/smartor/domain/SvyLibTitle.java
index e7de39c..c42f285 100644
--- a/smartor/src/main/java/com/smartor/domain/SvyLibTitle.java
+++ b/smartor/src/main/java/com/smartor/domain/SvyLibTitle.java
@@ -2,7 +2,11 @@
import java.math.BigDecimal;
import java.util.Date;
+
import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@@ -10,259 +14,143 @@
/**
* 闂嵎瀵硅薄 svy_lib_title
- *
+ *
* @author ruoyi
* @date 2023-03-02
*/
-public class SvyLibTitle extends BaseEntity
-{
+@Data
+@ApiModel(value = "MinioResponseDTO", description = "鏍囩鍒嗙被瀵硅薄")
+public class SvyLibTitle extends BaseEntity {
private static final long serialVersionUID = 1L;
- /** 鑷ID */
+ /**
+ * 鑷ID
+ */
+ @ApiModelProperty(value = "鑷ID")
private Long svyid;
- /** 闂嵎鍒嗙被ID */
+ /**
+ * 闂嵎鍒嗙被ID
+ */
+ @ApiModelProperty(value = "闂嵎鍒嗙被ID")
@Excel(name = " 闂嵎鍒嗙被ID ")
private Long categoryid;
- /** 闂嵎浠g爜 */
+ /**
+ * 闂嵎浠g爜
+ */
+ @ApiModelProperty(value = "闂嵎浠g爜")
@Excel(name = " 闂嵎浠g爜 ")
private String svycode;
- /** 闂嵎鍚嶇О */
+ /**
+ * 闂嵎鍚嶇О
+ */
+ @ApiModelProperty(value = "闂嵎鍚嶇О")
@Excel(name = " 闂嵎鍚嶇О ")
private String svyname;
- /** 鎻忚堪 */
+ /**
+ * 鎻忚堪
+ */
+ @ApiModelProperty(value = "鎻忚堪")
@Excel(name = " 鎻忚堪 ")
private String description;
- /** 闂嵎浠嬬粛 */
+ /**
+ * 闂嵎浠嬬粛
+ */
+ @ApiModelProperty(value = "闂嵎浠嬬粛")
@Excel(name = " 闂嵎浠嬬粛 ")
private String introduce;
- /** 闂嵎鎻愮ず */
+ /**
+ * 闂嵎鎻愮ず
+ */
+ @ApiModelProperty(value = "闂嵎鎻愮ず")
@Excel(name = " 闂嵎鎻愮ず ")
private String submitprompt;
- /** 妯℃澘ID */
+ /**
+ * 妯℃澘ID
+ */
+ @ApiModelProperty(value = "妯℃澘ID")
@Excel(name = " 妯℃澘ID ")
private Long templateid;
- /** 鐗堟湰 */
+ /**
+ * 鐗堟湰
+ */
+ @ApiModelProperty(value = "鐗堟湰")
@Excel(name = " 鐗堟湰 ")
private BigDecimal version;
- /** 涓績搴撲唬鐮� */
+ /**
+ * 涓績搴撲唬鐮�
+ */
+ @ApiModelProperty(value = "涓績搴撲唬鐮�")
@Excel(name = " 涓績搴撲唬鐮� ")
private String centerlibrarycode;
- /** 涓績搴揑D */
+ /**
+ * 涓績搴揑D
+ */
+ @ApiModelProperty(value = "涓績搴揑D")
@Excel(name = " 涓績搴揑D ")
private Long centerlibraryid;
- /** 鏄惁鏈湴 */
+ /**
+ * 鏄惁鏈湴
+ */
+ @ApiModelProperty(value = "鏄惁鏈湴")
@Excel(name = " 鏄惁鏈湴 ")
private Long islocal;
- /** 鏄惁鍚敤 */
+ /**
+ * 鏄惁鍚敤
+ */
+ @ApiModelProperty(value = "鏄惁鍚敤")
@Excel(name = " 鏄惁鍚敤 ")
private Long isenable;
- /** 鏈烘瀯ID */
+ /**
+ * 鏈烘瀯ID
+ */
+ @ApiModelProperty(value = "鏈烘瀯ID")
@Excel(name = " 鏈烘瀯ID ")
private String orgid;
- /** 鍒犻櫎鏍囪 */
+ /**
+ * 鍒犻櫎鏍囪
+ */
+ @ApiModelProperty(value = "鍒犻櫎鏍囪")
private String delFlag;
- /** 涓婁紶鏍囪 */
+ /**
+ * 涓婁紶鏍囪
+ */
+ @ApiModelProperty(value = "涓婁紶鏍囪")
@Excel(name = " 涓婁紶鏍囪 ")
private Long isupload;
- /** 涓婁紶鏃堕棿 */
+
+ /**
+ * 涓婁紶鏃堕棿
+ */
+ @ApiModelProperty(value = "涓婁紶鏃堕棿")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = " 涓婁紶鏃堕棿 ", width = 30, dateFormat = "yyyy-MM-dd")
private Date uploadTime;
- public void setSvyid(Long svyid)
- {
+ /**
+ * 鐤剧梾鍚嶇О
+ */
+ @ApiModelProperty(value = "鐤剧梾鍚嶇О")
+ private String icdname;
+
+
+ public SvyLibTitle(Long svyid, String icdname) {
this.svyid = svyid;
- }
-
- public Long getSvyid()
- {
- return svyid;
- }
- public void setCategoryid(Long categoryid)
- {
- this.categoryid = categoryid;
- }
-
- public Long getCategoryid()
- {
- return categoryid;
- }
- public void setSvycode(String svycode)
- {
- this.svycode = svycode;
- }
-
- public String getSvycode()
- {
- return svycode;
- }
- public void setSvyname(String svyname)
- {
- this.svyname = svyname;
- }
-
- public String getSvyname()
- {
- return svyname;
- }
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- public String getDescription()
- {
- return description;
- }
- public void setIntroduce(String introduce)
- {
- this.introduce = introduce;
- }
-
- public String getIntroduce()
- {
- return introduce;
- }
- public void setSubmitprompt(String submitprompt)
- {
- this.submitprompt = submitprompt;
- }
-
- public String getSubmitprompt()
- {
- return submitprompt;
- }
- public void setTemplateid(Long templateid)
- {
- this.templateid = templateid;
- }
-
- public Long getTemplateid()
- {
- return templateid;
- }
- public void setVersion(BigDecimal version)
- {
- this.version = version;
- }
-
- public BigDecimal getVersion()
- {
- return version;
- }
- public void setCenterlibrarycode(String centerlibrarycode)
- {
- this.centerlibrarycode = centerlibrarycode;
- }
-
- public String getCenterlibrarycode()
- {
- return centerlibrarycode;
- }
- public void setCenterlibraryid(Long centerlibraryid)
- {
- this.centerlibraryid = centerlibraryid;
- }
-
- public Long getCenterlibraryid()
- {
- return centerlibraryid;
- }
- public void setIslocal(Long islocal)
- {
- this.islocal = islocal;
- }
-
- public Long getIslocal()
- {
- return islocal;
- }
- public void setIsenable(Long isenable)
- {
- this.isenable = isenable;
- }
-
- public Long getIsenable()
- {
- return isenable;
- }
- public void setOrgid(String orgid)
- {
- this.orgid = orgid;
- }
-
- public String getOrgid()
- {
- return orgid;
- }
- public void setDelFlag(String delFlag)
- {
- this.delFlag = delFlag;
- }
-
- public String getDelFlag()
- {
- return delFlag;
- }
- public void setIsupload(Long isupload)
- {
- this.isupload = isupload;
- }
-
- public Long getIsupload()
- {
- return isupload;
- }
- public void setUploadTime(Date uploadTime)
- {
- this.uploadTime = uploadTime;
- }
-
- public Date getUploadTime()
- {
- return uploadTime;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
- .append("svyid", getSvyid())
- .append("categoryid", getCategoryid())
- .append("svycode", getSvycode())
- .append("svyname", getSvyname())
- .append("description", getDescription())
- .append("introduce", getIntroduce())
- .append("submitprompt", getSubmitprompt())
- .append("templateid", getTemplateid())
- .append("version", getVersion())
- .append("centerlibrarycode", getCenterlibrarycode())
- .append("centerlibraryid", getCenterlibraryid())
- .append("islocal", getIslocal())
- .append("isenable", getIsenable())
- .append("orgid", getOrgid())
- .append("delFlag", getDelFlag())
- .append("createBy", getCreateBy())
- .append("createTime", getCreateTime())
- .append("updateBy", getUpdateBy())
- .append("updateTime", getUpdateTime())
- .append("isupload", getIsupload())
- .append("uploadTime", getUploadTime())
- .toString();
+ this.icdname = icdname;
}
}
diff --git a/smartor/src/main/java/com/smartor/domain/SvyLibTitleReq.java b/smartor/src/main/java/com/smartor/domain/SvyLibTitleReq.java
new file mode 100644
index 0000000..4bbe6ed
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/domain/SvyLibTitleReq.java
@@ -0,0 +1,45 @@
+package com.smartor.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 闂嵎璇锋眰 svy_lib_title
+ *
+ * @author ruoyi
+ * @date 2023-03-02
+ */
+@Data
+@ApiModel(value = "SvyLibTitleReq", description = "闂嵎璇锋眰")
+public class SvyLibTitleReq {
+
+ /**
+ * 闂嵎鍒嗙被ID
+ */
+ @ApiModelProperty(value = "闂嵎鍒嗙被ID")
+ private Long categoryid;
+
+
+ /**
+ * 闂嵎鍚嶇О
+ */
+ @ApiModelProperty(value = "闂嵎鍚嶇О")
+ private String svyname;
+
+ /**
+ * 閫傜敤鐤剧梾
+ */
+ @ApiModelProperty(value = "閫傜敤鐤剧梾")
+ private String description;
+
+
+}
diff --git a/smartor/src/main/java/com/smartor/mapper/SvyLibTitleMapper.java b/smartor/src/main/java/com/smartor/mapper/SvyLibTitleMapper.java
index bc0f712..a8f60d7 100644
--- a/smartor/src/main/java/com/smartor/mapper/SvyLibTitleMapper.java
+++ b/smartor/src/main/java/com/smartor/mapper/SvyLibTitleMapper.java
@@ -2,6 +2,7 @@
import java.util.List;
import com.smartor.domain.SvyLibTitle;
+import com.smartor.domain.SvyLibTitleReq;
/**
* 闂嵎Mapper鎺ュ彛
@@ -25,7 +26,7 @@
* @param svyLibTitle 闂嵎
* @return 闂嵎闆嗗悎
*/
- public List<SvyLibTitle> selectSvyLibTitleList(SvyLibTitle svyLibTitle);
+ public List<SvyLibTitle> selectSvyLibTitleList(SvyLibTitleReq svyLibTitleReq);
/**
* 鏂板闂嵎
diff --git a/smartor/src/main/java/com/smartor/service/ISvyLibTitleService.java b/smartor/src/main/java/com/smartor/service/ISvyLibTitleService.java
index c57af4e..0323f15 100644
--- a/smartor/src/main/java/com/smartor/service/ISvyLibTitleService.java
+++ b/smartor/src/main/java/com/smartor/service/ISvyLibTitleService.java
@@ -1,19 +1,20 @@
package com.smartor.service;
import java.util.List;
+
import com.smartor.domain.SvyLibTitle;
+import com.smartor.domain.SvyLibTitleReq;
/**
* 闂嵎Service鎺ュ彛
- *
+ *
* @author ruoyi
* @date 2023-03-02
*/
-public interface ISvyLibTitleService
-{
+public interface ISvyLibTitleService {
/**
* 鏌ヨ闂嵎
- *
+ *
* @param svyid 闂嵎涓婚敭
* @return 闂嵎
*/
@@ -21,15 +22,15 @@
/**
* 鏌ヨ闂嵎鍒楄〃
- *
- * @param svyLibTitle 闂嵎
+ *
+ * @param svyLibTitleReq 闂嵎
* @return 闂嵎闆嗗悎
*/
- public List<SvyLibTitle> selectSvyLibTitleList(SvyLibTitle svyLibTitle);
+ public List<SvyLibTitle> selectSvyLibTitleList(SvyLibTitleReq svyLibTitleReq);
/**
* 鏂板闂嵎
- *
+ *
* @param svyLibTitle 闂嵎
* @return 缁撴灉
*/
@@ -37,7 +38,7 @@
/**
* 淇敼闂嵎
- *
+ *
* @param svyLibTitle 闂嵎
* @return 缁撴灉
*/
@@ -45,7 +46,7 @@
/**
* 鎵归噺鍒犻櫎闂嵎
- *
+ *
* @param svyids 闇�瑕佸垹闄ょ殑闂嵎涓婚敭闆嗗悎
* @return 缁撴灉
*/
@@ -53,7 +54,7 @@
/**
* 鍒犻櫎闂嵎淇℃伅
- *
+ *
* @param svyid 闂嵎涓婚敭
* @return 缁撴灉
*/
diff --git a/smartor/src/main/java/com/smartor/service/impl/SvyLibTitleServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/SvyLibTitleServiceImpl.java
index 76b5c12..9466aff 100644
--- a/smartor/src/main/java/com/smartor/service/impl/SvyLibTitleServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/SvyLibTitleServiceImpl.java
@@ -1,7 +1,13 @@
package com.smartor.service.impl;
import java.util.List;
+import java.util.stream.Collectors;
+
import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.DtoConversionUtils;
+import com.smartor.domain.SvyLibTitleReq;
+import org.apache.commons.lang3.ObjectUtils;
+import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smartor.mapper.SvyLibTitleMapper;
@@ -10,87 +16,96 @@
/**
* 闂嵎Service涓氬姟灞傚鐞�
- *
+ *
* @author ruoyi
* @date 2023-03-02
*/
@Service
-public class SvyLibTitleServiceImpl implements ISvyLibTitleService
-{
+public class SvyLibTitleServiceImpl implements ISvyLibTitleService {
@Autowired
private SvyLibTitleMapper svyLibTitleMapper;
/**
* 鏌ヨ闂嵎
- *
+ *
* @param svyid 闂嵎涓婚敭
* @return 闂嵎
*/
@Override
- public SvyLibTitle selectSvyLibTitleBySvyid(Long svyid)
- {
+ public SvyLibTitle selectSvyLibTitleBySvyid(Long svyid) {
return svyLibTitleMapper.selectSvyLibTitleBySvyid(svyid);
}
/**
* 鏌ヨ闂嵎鍒楄〃
- *
- * @param svyLibTitle 闂嵎
+ *
+ * @param svyLibTitleReq 闂嵎
* @return 闂嵎
*/
@Override
- public List<SvyLibTitle> selectSvyLibTitleList(SvyLibTitle svyLibTitle)
- {
- return svyLibTitleMapper.selectSvyLibTitleList(svyLibTitle);
+ public List<SvyLibTitle> selectSvyLibTitleList(SvyLibTitleReq svyLibTitleReq) {
+ List<SvyLibTitle> svyLibTitles = svyLibTitleMapper.selectSvyLibTitleList(svyLibTitleReq);
+ //鍏堝皢鐩稿悓鐨刬d鐨刬cdname,鏁寸悊鍒颁竴鍧�
+ List<SvyLibTitle> libTitles = svyLibTitles.stream().collect(Collectors.groupingBy(SvyLibTitle::getSvyid, Collectors.mapping(SvyLibTitle::getIcdname, Collectors.joining(", ")))).entrySet().stream().map(entry -> new SvyLibTitle(entry.getKey(), entry.getValue())).collect(Collectors.toList());
+ //涓存椂鍙橀噺锛岀敤鏉ヤ繚瀛樼柧鐥呭悕绉�
+ String icdname = null;
+ for (int i = 0; i < libTitles.size(); i++) {
+ for (int j = 0; j < svyLibTitles.size(); j++) {
+ if (ObjectUtils.isNotEmpty(libTitles.get(i).getSvyid()) && libTitles.get(i).getSvyid() == svyLibTitles.get(j).getSvyid()) {
+ icdname = libTitles.get(i).getIcdname();
+ // 灏嗗師鏁版嵁鎷疯礉鍒版暣鐞嗙殑濂界殑瀵硅薄涓�
+ BeanUtils.copyProperties(svyLibTitles.get(j), libTitles.get(i));
+ //鍐嶅皢鏁寸悊濂界殑鈥滅柧鐥呭悕绉扳�濇浛鎹�
+ libTitles.get(i).setIcdname(icdname);
+ }
+ }
+ }
+ return libTitles;
}
/**
* 鏂板闂嵎
- *
+ *
* @param svyLibTitle 闂嵎
* @return 缁撴灉
*/
@Override
- public int insertSvyLibTitle(SvyLibTitle svyLibTitle)
- {
+ public int insertSvyLibTitle(SvyLibTitle svyLibTitle) {
svyLibTitle.setCreateTime(DateUtils.getNowDate());
return svyLibTitleMapper.insertSvyLibTitle(svyLibTitle);
}
/**
* 淇敼闂嵎
- *
+ *
* @param svyLibTitle 闂嵎
* @return 缁撴灉
*/
@Override
- public int updateSvyLibTitle(SvyLibTitle svyLibTitle)
- {
+ public int updateSvyLibTitle(SvyLibTitle svyLibTitle) {
svyLibTitle.setUpdateTime(DateUtils.getNowDate());
return svyLibTitleMapper.updateSvyLibTitle(svyLibTitle);
}
/**
* 鎵归噺鍒犻櫎闂嵎
- *
+ *
* @param svyids 闇�瑕佸垹闄ょ殑闂嵎涓婚敭
* @return 缁撴灉
*/
@Override
- public int deleteSvyLibTitleBySvyids(Long[] svyids)
- {
+ public int deleteSvyLibTitleBySvyids(Long[] svyids) {
return svyLibTitleMapper.deleteSvyLibTitleBySvyids(svyids);
}
/**
* 鍒犻櫎闂嵎淇℃伅
- *
+ *
* @param svyid 闂嵎涓婚敭
* @return 缁撴灉
*/
@Override
- public int deleteSvyLibTitleBySvyid(Long svyid)
- {
+ public int deleteSvyLibTitleBySvyid(Long svyid) {
return svyLibTitleMapper.deleteSvyLibTitleBySvyid(svyid);
}
}
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTitleMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTitleMapper.xml
index 3a8af1a..ca6e3e4 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTitleMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTitleMapper.xml
@@ -1,64 +1,79 @@
<?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">
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.smartor.mapper.SvyLibTitleMapper">
-
- <resultMap type="SvyLibTitle" id="SvyLibTitleResult">
- <result property="svyid" column="svyid" />
- <result property="categoryid" column="categoryid" />
- <result property="svycode" column="svycode" />
- <result property="svyname" column="svyname" />
- <result property="description" column="description" />
- <result property="introduce" column="introduce" />
- <result property="submitprompt" column="submitprompt" />
- <result property="templateid" column="templateid" />
- <result property="version" column="version" />
- <result property="centerlibrarycode" column="centerlibrarycode" />
- <result property="centerlibraryid" column="centerlibraryid" />
- <result property="islocal" column="islocal" />
- <result property="isenable" column="isenable" />
- <result property="orgid" column="orgid" />
- <result property="delFlag" column="del_flag" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="isupload" column="isupload" />
- <result property="uploadTime" column="upload_time" />
+
+ <resultMap type="com.smartor.domain.SvyLibTitle" id="SvyLibTitleResult">
+ <result property="svyid" column="svyid"/>
+ <result property="categoryid" column="categoryid"/>
+ <result property="svycode" column="svycode"/>
+ <result property="svyname" column="svyname"/>
+ <result property="description" column="description"/>
+ <result property="introduce" column="introduce"/>
+ <result property="submitprompt" column="submitprompt"/>
+ <result property="templateid" column="templateid"/>
+ <result property="version" column="version"/>
+ <result property="centerlibrarycode" column="centerlibrarycode"/>
+ <result property="centerlibraryid" column="centerlibraryid"/>
+ <result property="islocal" column="islocal"/>
+ <result property="isenable" column="isenable"/>
+ <result property="orgid" column="orgid"/>
+ <result property="delFlag" column="del_flag"/>
+ <result property="createBy" column="create_by"/>
+ <result property="createTime" column="create_time"/>
+ <result property="updateBy" column="update_by"/>
+ <result property="updateTime" column="update_time"/>
+ <result property="isupload" column="isupload"/>
+ <result property="uploadTime" column="upload_time"/>
</resultMap>
<sql id="selectSvyLibTitleVo">
- select svyid, categoryid, svycode, svyname, description, introduce, submitprompt, templateid, version, centerlibrarycode, centerlibraryid, islocal, isenable, orgid, del_flag, create_by, create_time, update_by, update_time, isupload, upload_time from svy_lib_title
+ select svyid,
+ categoryid,
+ svycode,
+ svyname,
+ description,
+ introduce,
+ submitprompt,
+ templateid,
+ version,
+ centerlibrarycode,
+ centerlibraryid,
+ islocal,
+ isenable,
+ orgid,
+ del_flag,
+ create_by,
+ create_time,
+ update_by,
+ update_time,
+ isupload,
+ upload_time
+ from svy_lib_title
</sql>
- <select id="selectSvyLibTitleList" parameterType="SvyLibTitle" resultMap="SvyLibTitleResult">
- <include refid="selectSvyLibTitleVo"/>
- <where>
- <if test="categoryid != null "> and categoryid = #{categoryid}</if>
- <if test="svycode != null and svycode != ''"> and svycode = #{svycode}</if>
- <if test="svyname != null and svyname != ''"> and svyname like concat('%', #{svyname}, '%')</if>
- <if test="description != null and description != ''"> and description = #{description}</if>
- <if test="introduce != null and introduce != ''"> and introduce = #{introduce}</if>
- <if test="submitprompt != null and submitprompt != ''"> and submitprompt = #{submitprompt}</if>
- <if test="templateid != null "> and templateid = #{templateid}</if>
- <if test="version != null "> and version = #{version}</if>
- <if test="centerlibrarycode != null and centerlibrarycode != ''"> and centerlibrarycode = #{centerlibrarycode}</if>
- <if test="centerlibraryid != null "> and centerlibraryid = #{centerlibraryid}</if>
- <if test="islocal != null "> and islocal = #{islocal}</if>
- <if test="isenable != null "> and isenable = #{isenable}</if>
- <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
- <if test="isupload != null "> and isupload = #{isupload}</if>
- <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
+ <select id="selectSvyLibTitleList" parameterType="com.smartor.domain.SvyLibTitleReq" resultMap="SvyLibTitleResult">
+ select a.svyid, a.categoryid, a.svycode, a.svyname, a.description, a.introduce,a.submitprompt, a.templateid,
+ a.version,a.centerlibrarycode, a.centerlibraryid, a.islocal, a.isenable, a.orgid, a.del_flag, a.create_by,
+ a.create_time, a.update_by, a.update_time, a.isupload, a.upload_time,c.icdname from svy_lib_title
+ a,icd10_association b,icd10 c
+ <where>
+ a.svyid=b.SVYID and b.ICD10CODE=c.icdcode
+ <if test="categoryid != null ">and a.categoryid = #{categoryid}</if>
+ <if test="svyname != null and svyname != ''">and a.svyname like concat('%', #{svyname}, '%')</if>
+ <if test="description != null and description != ''">and a.icdname like concat('%', #{description}, '%')
+ </if>
</where>
</select>
-
+
<select id="selectSvyLibTitleBySvyid" parameterType="Long" resultMap="SvyLibTitleResult">
<include refid="selectSvyLibTitleVo"/>
where svyid = #{svyid}
</select>
-
- <insert id="insertSvyLibTitle" parameterType="SvyLibTitle" useGeneratedKeys="true" keyProperty="svyid">
+
+ <insert id="insertSvyLibTitle" parameterType="com.smartor.domain.SvyLibTitle" useGeneratedKeys="true"
+ keyProperty="svyid">
insert into svy_lib_title
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="categoryid != null">categoryid,</if>
@@ -81,7 +96,7 @@
<if test="updateTime != null">update_time,</if>
<if test="isupload != null">isupload,</if>
<if test="uploadTime != null">upload_time,</if>
- </trim>
+ </trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="categoryid != null">#{categoryid},</if>
<if test="svycode != null">#{svycode},</if>
@@ -103,10 +118,10 @@
<if test="updateTime != null">#{updateTime},</if>
<if test="isupload != null">#{isupload},</if>
<if test="uploadTime != null">#{uploadTime},</if>
- </trim>
+ </trim>
</insert>
- <update id="updateSvyLibTitle" parameterType="SvyLibTitle">
+ <update id="updateSvyLibTitle" parameterType="com.smartor.domain.SvyLibTitle">
update svy_lib_title
<trim prefix="SET" suffixOverrides=",">
<if test="categoryid != null">categoryid = #{categoryid},</if>
@@ -134,11 +149,13 @@
</update>
<delete id="deleteSvyLibTitleBySvyid" parameterType="Long">
- delete from svy_lib_title where svyid = #{svyid}
+ delete
+ from svy_lib_title
+ where svyid = #{svyid}
</delete>
<delete id="deleteSvyLibTitleBySvyids" parameterType="String">
- delete from svy_lib_title where svyid in
+ delete from svy_lib_title where svyid in
<foreach item="svyid" collection="array" open="(" separator="," close=")">
#{svyid}
</foreach>
--
Gitblit v1.9.3