From 347ff618d0599c4f0f68ee30f61b6cce77b68140 Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Tue, 22 Dec 2020 20:46:20 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- running/pdf/contract.pdf | Bin 345511 -> 357568 bytes .../src/main/filters/local/application.yml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/running/pdf/contract.pdf b/running/pdf/contract.pdf index 0a8a498341cfa68fc027b63ec02a4b61b10c3d59..7f202f77d70b6da40028d637e55ccc7bc2be82a9 100644 GIT binary patch delta 2443 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 delta 19 acmX@`QgnH@XhREQ3sVbo3(FSP<*ooxod-n# diff --git a/stdiet-admin/src/main/filters/local/application.yml b/stdiet-admin/src/main/filters/local/application.yml index b62d36752..62d25246b 100644 --- a/stdiet-admin/src/main/filters/local/application.yml +++ b/stdiet-admin/src/main/filters/local/application.yml @@ -82,7 +82,7 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://47.115.23.82:3306/stdiet_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:mysql://47.115.23.82:3306/stdiet?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 password: Ttj4fAHU username: root slave: From fa5264b908479da47d6996369c91468f447bcacc Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Wed, 23 Dec 2020 20:44:23 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=A3=9F=E6=9D=90?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/filters/local/application.yml | 2 +- .../custom/SysPhysicalSignsController.java | 103 ++++++ .../stdiet/custom/domain/SysIngredient.java | 219 ++++++------- .../custom/domain/SysPhysicalSigns.java | 66 ++++ .../custom/mapper/SysPhysicalSignsMapper.java | 61 ++++ .../service/ISysPhysicalSignsService.java | 61 ++++ .../impl/SysPhysicalSignsServiceImpl.java | 93 ++++++ .../mapper/custom/SysIngredientMapper.xml | 23 +- .../mapper/custom/SysPhysicalSignsMapper.xml | 66 ++++ stdiet-ui/src/api/custom/physicalSigns.js | 53 ++++ .../src/views/custom/ingredient/index.vue | 110 +++---- .../src/views/custom/physicalSigns/index.vue | 294 ++++++++++++++++++ 12 files changed, 979 insertions(+), 172 deletions(-) create mode 100644 stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysPhysicalSignsController.java create mode 100644 stdiet-custom/src/main/java/com/stdiet/custom/domain/SysPhysicalSigns.java create mode 100644 stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysPhysicalSignsMapper.java create mode 100644 stdiet-custom/src/main/java/com/stdiet/custom/service/ISysPhysicalSignsService.java create mode 100644 stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysPhysicalSignsServiceImpl.java create mode 100644 stdiet-custom/src/main/resources/mapper/custom/SysPhysicalSignsMapper.xml create mode 100644 stdiet-ui/src/api/custom/physicalSigns.js create mode 100644 stdiet-ui/src/views/custom/physicalSigns/index.vue diff --git a/stdiet-admin/src/main/filters/local/application.yml b/stdiet-admin/src/main/filters/local/application.yml index 62d25246b..b62d36752 100644 --- a/stdiet-admin/src/main/filters/local/application.yml +++ b/stdiet-admin/src/main/filters/local/application.yml @@ -82,7 +82,7 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://47.115.23.82:3306/stdiet?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:mysql://47.115.23.82:3306/stdiet_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 password: Ttj4fAHU username: root slave: diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysPhysicalSignsController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysPhysicalSignsController.java new file mode 100644 index 000000000..d7f2c437e --- /dev/null +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysPhysicalSignsController.java @@ -0,0 +1,103 @@ +package com.stdiet.web.controller.custom; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.stdiet.common.annotation.Log; +import com.stdiet.common.core.controller.BaseController; +import com.stdiet.common.core.domain.AjaxResult; +import com.stdiet.common.enums.BusinessType; +import com.stdiet.custom.domain.SysPhysicalSigns; +import com.stdiet.custom.service.ISysPhysicalSignsService; +import com.stdiet.common.utils.poi.ExcelUtil; +import com.stdiet.common.core.page.TableDataInfo; + +/** + * 体征Controller + * + * @author wonder + * @date 2020-12-23 + */ +@RestController +@RequestMapping("/custom/physicalSigns") +public class SysPhysicalSignsController extends BaseController +{ + @Autowired + private ISysPhysicalSignsService sysPhysicalSignsService; + + /** + * 查询体征列表 + */ + @PreAuthorize("@ss.hasPermi('custom:physicalSigns:list')") + @GetMapping("/list") + public TableDataInfo list(SysPhysicalSigns sysPhysicalSigns) + { + startPage(); + List list = sysPhysicalSignsService.selectSysPhysicalSignsList(sysPhysicalSigns); + return getDataTable(list); + } + + /** + * 导出体征列表 + */ + @PreAuthorize("@ss.hasPermi('custom:physicalSigns:export')") + @Log(title = "体征", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(SysPhysicalSigns sysPhysicalSigns) + { + List list = sysPhysicalSignsService.selectSysPhysicalSignsList(sysPhysicalSigns); + ExcelUtil util = new ExcelUtil(SysPhysicalSigns.class); + return util.exportExcel(list, "physicalSigns"); + } + + /** + * 获取体征详细信息 + */ + @PreAuthorize("@ss.hasPermi('custom:physicalSigns:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(sysPhysicalSignsService.selectSysPhysicalSignsById(id)); + } + + /** + * 新增体征 + */ + @PreAuthorize("@ss.hasPermi('custom:physicalSigns:add')") + @Log(title = "体征", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SysPhysicalSigns sysPhysicalSigns) + { + return toAjax(sysPhysicalSignsService.insertSysPhysicalSigns(sysPhysicalSigns)); + } + + /** + * 修改体征 + */ + @PreAuthorize("@ss.hasPermi('custom:physicalSigns:edit')") + @Log(title = "体征", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SysPhysicalSigns sysPhysicalSigns) + { + return toAjax(sysPhysicalSignsService.updateSysPhysicalSigns(sysPhysicalSigns)); + } + + /** + * 删除体征 + */ + @PreAuthorize("@ss.hasPermi('custom:physicalSigns:remove')") + @Log(title = "体征", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(sysPhysicalSignsService.deleteSysPhysicalSignsByIds(ids)); + } +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysIngredient.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysIngredient.java index 26c48fc85..e199f4de1 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysIngredient.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysIngredient.java @@ -1,67 +1,91 @@ package com.stdiet.custom.domain; -import java.math.BigDecimal; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; import com.stdiet.common.annotation.Excel; import com.stdiet.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; /** * 食材对象 sys_ingredient - * + * * @author wonder * @date 2020-12-15 */ -public class SysIngredient extends BaseEntity -{ +public class SysIngredient extends BaseEntity { private static final long serialVersionUID = 1L; - /** id */ + /** + * id + */ private Long id; - /** 食材名称 */ + /** + * 食材名称 + */ @Excel(name = "食材名称") private String name; - /** 食材类别 */ + /** + * 食材类别 + */ @Excel(name = "食材类别") private String type; - /** 推荐分量估算 */ + /** + * 推荐分量估算 + */ @Excel(name = "推荐分量估算") private Long recEstimation; - /** 推荐分量估算单位id */ + /** + * 推荐分量估算单位id + */ @Excel(name = "推荐分量估算单位id") private Long recEstUnit; - /** 推荐分量 */ + /** + * 推荐分量 + */ @Excel(name = "推荐分量") private Long recPortion; - /** 蛋白质比例 */ + /** + * 蛋白质比例 + */ @Excel(name = "蛋白质比例") private BigDecimal proteinRatio; - /** 脂肪比例 */ + /** + * 脂肪比例 + */ @Excel(name = "脂肪比例") private BigDecimal fatRatio; - /** 碳水比例 */ + /** + * 碳水比例 + */ @Excel(name = "碳水比例") private BigDecimal carbonRatio; - /** 地域 */ + /** + * 地域 + */ @Excel(name = "地域") private String area; - /** 忌口 */ - @Excel(name = "忌口") + /** + * 忌口 + */ + @Excel(name = "忌口人群") private String notRec; - /** 推荐 */ - @Excel(name = "推荐") - private String recommend; + /** + * 推荐 + */ + @Excel(name = "推荐人群") + private String rec; private Long[] recIds; @@ -75,143 +99,122 @@ public class SysIngredient extends BaseEntity return notRecIds; } - public void setNotRecIds(Long[] notRecIds) { - this.notRecIds = notRecIds; + public Long getId() { + return id; } - public void setRedIds(Long[] recIds) { - this.recIds = recIds; - } - - public void setId(Long id) - { + public void setId(Long id) { this.id = id; } - public Long getId() - { - return id; + public String getName() { + return name; } - public void setName(String name) - { + + public void setName(String name) { this.name = name; } - public String getName() - { - return name; + public String getType() { + return type; } - public void setType(String type) - { + + public void setType(String type) { this.type = type; } - public String getType() - { - return type; + public Long getRecEstimation() { + return recEstimation; } - public void setRecEstimation(Long recEstimation) - { + + public void setRecEstimation(Long recEstimation) { this.recEstimation = recEstimation; } - public Long getRecEstimation() - { - return recEstimation; + public Long getRecEstUnit() { + return recEstUnit; } - public void setRecEstUnit(Long recEstUnit) - { + + public void setRecEstUnit(Long recEstUnit) { this.recEstUnit = recEstUnit; } - public Long getRecEstUnit() - { - return recEstUnit; + public Long getRecPortion() { + return recPortion; } - public void setRecPortion(Long recPortion) - { + + public void setRecPortion(Long recPortion) { this.recPortion = recPortion; } - public Long getRecPortion() - { - return recPortion; + public BigDecimal getProteinRatio() { + return proteinRatio; } - public void setProteinRatio(BigDecimal proteinRatio) - { + + public void setProteinRatio(BigDecimal proteinRatio) { this.proteinRatio = proteinRatio; } - public BigDecimal getProteinRatio() - { - return proteinRatio; + public BigDecimal getFatRatio() { + return fatRatio; } - public void setFatRatio(BigDecimal fatRatio) - { + + public void setFatRatio(BigDecimal fatRatio) { this.fatRatio = fatRatio; } - public BigDecimal getFatRatio() - { - return fatRatio; + public BigDecimal getCarbonRatio() { + return carbonRatio; } - public void setCarbonRatio(BigDecimal carbonRatio) - { + + public void setCarbonRatio(BigDecimal carbonRatio) { this.carbonRatio = carbonRatio; } - public BigDecimal getCarbonRatio() - { - return carbonRatio; + public String getArea() { + return area; } - public void setArea(String area) - { + + public void setArea(String area) { this.area = area; } - public String getArea() - { - return area; + public String getNotRec() { + return notRec; } - public void setNotRec(String notRec) - { + + public void setNotRec(String notRec) { this.notRec = notRec; } - public String getNotRec() - { - return notRec; - } - public void setRecommend(String recommend) - { - this.recommend = recommend; + public String getRec() { + return rec; } - public String getRecommend() - { - return recommend; + public void setRec(String rec) { + this.rec = rec; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("name", getName()) - .append("type", getType()) - .append("recEstimation", getRecEstimation()) - .append("recEstUnit", getRecEstUnit()) - .append("recPortion", getRecPortion()) - .append("proteinRatio", getProteinRatio()) - .append("fatRatio", getFatRatio()) - .append("carbonRatio", getCarbonRatio()) - .append("remark", getRemark()) - .append("area", getArea()) - .append("notRec", getNotRec()) - .append("recommend", getRecommend()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("type", getType()) + .append("recEstimation", getRecEstimation()) + .append("recEstUnit", getRecEstUnit()) + .append("recPortion", getRecPortion()) + .append("proteinRatio", getProteinRatio()) + .append("fatRatio", getFatRatio()) + .append("carbonRatio", getCarbonRatio()) + .append("remark", getRemark()) + .append("area", getArea()) + .append("notRec", getNotRec()) + .append("recommend", getRec()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); } } \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysPhysicalSigns.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysPhysicalSigns.java new file mode 100644 index 000000000..b5a70c8a9 --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysPhysicalSigns.java @@ -0,0 +1,66 @@ +package com.stdiet.custom.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.stdiet.common.annotation.Excel; +import com.stdiet.common.core.domain.BaseEntity; + +/** + * 体征对象 sys_physical_signs + * + * @author wonder + * @date 2020-12-23 + */ +public class SysPhysicalSigns extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 体征名称 */ + @Excel(name = "体征名称") + private String name; + + /** 体征类别 */ + @Excel(name = "体征类别") + private Long typeId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setTypeId(Long typeId) + { + this.typeId = typeId; + } + + public Long getTypeId() + { + return typeId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("typeId", getTypeId()) + .append("remark", getRemark()) + .toString(); + } +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysPhysicalSignsMapper.java b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysPhysicalSignsMapper.java new file mode 100644 index 000000000..22cca22d8 --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/mapper/SysPhysicalSignsMapper.java @@ -0,0 +1,61 @@ +package com.stdiet.custom.mapper; + +import java.util.List; +import com.stdiet.custom.domain.SysPhysicalSigns; + +/** + * 体征Mapper接口 + * + * @author wonder + * @date 2020-12-23 + */ +public interface SysPhysicalSignsMapper +{ + /** + * 查询体征 + * + * @param id 体征ID + * @return 体征 + */ + public SysPhysicalSigns selectSysPhysicalSignsById(Long id); + + /** + * 查询体征列表 + * + * @param sysPhysicalSigns 体征 + * @return 体征集合 + */ + public List selectSysPhysicalSignsList(SysPhysicalSigns sysPhysicalSigns); + + /** + * 新增体征 + * + * @param sysPhysicalSigns 体征 + * @return 结果 + */ + public int insertSysPhysicalSigns(SysPhysicalSigns sysPhysicalSigns); + + /** + * 修改体征 + * + * @param sysPhysicalSigns 体征 + * @return 结果 + */ + public int updateSysPhysicalSigns(SysPhysicalSigns sysPhysicalSigns); + + /** + * 删除体征 + * + * @param id 体征ID + * @return 结果 + */ + public int deleteSysPhysicalSignsById(Long id); + + /** + * 批量删除体征 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteSysPhysicalSignsByIds(Long[] ids); +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysPhysicalSignsService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysPhysicalSignsService.java new file mode 100644 index 000000000..204ba992a --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysPhysicalSignsService.java @@ -0,0 +1,61 @@ +package com.stdiet.custom.service; + +import java.util.List; +import com.stdiet.custom.domain.SysPhysicalSigns; + +/** + * 体征Service接口 + * + * @author wonder + * @date 2020-12-23 + */ +public interface ISysPhysicalSignsService +{ + /** + * 查询体征 + * + * @param id 体征ID + * @return 体征 + */ + public SysPhysicalSigns selectSysPhysicalSignsById(Long id); + + /** + * 查询体征列表 + * + * @param sysPhysicalSigns 体征 + * @return 体征集合 + */ + public List selectSysPhysicalSignsList(SysPhysicalSigns sysPhysicalSigns); + + /** + * 新增体征 + * + * @param sysPhysicalSigns 体征 + * @return 结果 + */ + public int insertSysPhysicalSigns(SysPhysicalSigns sysPhysicalSigns); + + /** + * 修改体征 + * + * @param sysPhysicalSigns 体征 + * @return 结果 + */ + public int updateSysPhysicalSigns(SysPhysicalSigns sysPhysicalSigns); + + /** + * 批量删除体征 + * + * @param ids 需要删除的体征ID + * @return 结果 + */ + public int deleteSysPhysicalSignsByIds(Long[] ids); + + /** + * 删除体征信息 + * + * @param id 体征ID + * @return 结果 + */ + public int deleteSysPhysicalSignsById(Long id); +} \ No newline at end of file diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysPhysicalSignsServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysPhysicalSignsServiceImpl.java new file mode 100644 index 000000000..71d5a4182 --- /dev/null +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysPhysicalSignsServiceImpl.java @@ -0,0 +1,93 @@ +package com.stdiet.custom.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.stdiet.custom.mapper.SysPhysicalSignsMapper; +import com.stdiet.custom.domain.SysPhysicalSigns; +import com.stdiet.custom.service.ISysPhysicalSignsService; + +/** + * 体征Service业务层处理 + * + * @author wonder + * @date 2020-12-23 + */ +@Service +public class SysPhysicalSignsServiceImpl implements ISysPhysicalSignsService +{ + @Autowired + private SysPhysicalSignsMapper sysPhysicalSignsMapper; + + /** + * 查询体征 + * + * @param id 体征ID + * @return 体征 + */ + @Override + public SysPhysicalSigns selectSysPhysicalSignsById(Long id) + { + return sysPhysicalSignsMapper.selectSysPhysicalSignsById(id); + } + + /** + * 查询体征列表 + * + * @param sysPhysicalSigns 体征 + * @return 体征 + */ + @Override + public List selectSysPhysicalSignsList(SysPhysicalSigns sysPhysicalSigns) + { + return sysPhysicalSignsMapper.selectSysPhysicalSignsList(sysPhysicalSigns); + } + + /** + * 新增体征 + * + * @param sysPhysicalSigns 体征 + * @return 结果 + */ + @Override + public int insertSysPhysicalSigns(SysPhysicalSigns sysPhysicalSigns) + { + return sysPhysicalSignsMapper.insertSysPhysicalSigns(sysPhysicalSigns); + } + + /** + * 修改体征 + * + * @param sysPhysicalSigns 体征 + * @return 结果 + */ + @Override + public int updateSysPhysicalSigns(SysPhysicalSigns sysPhysicalSigns) + { + return sysPhysicalSignsMapper.updateSysPhysicalSigns(sysPhysicalSigns); + } + + /** + * 批量删除体征 + * + * @param ids 需要删除的体征ID + * @return 结果 + */ + @Override + public int deleteSysPhysicalSignsByIds(Long[] ids) + { + return sysPhysicalSignsMapper.deleteSysPhysicalSignsByIds(ids); + } + + /** + * 删除体征信息 + * + * @param id 体征ID + * @return 结果 + */ + @Override + public int deleteSysPhysicalSignsById(Long id) + { + return sysPhysicalSignsMapper.deleteSysPhysicalSignsById(id); + } +} \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysIngredientMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysIngredientMapper.xml index c0a372b9c..214d137ae 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysIngredientMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysIngredientMapper.xml @@ -17,10 +17,27 @@ + + - select id, name, type, protein_ratio, fat_ratio, carbon_ratio, area, remark, create_by, create_time, update_by, update_time from sys_ingredient +-- select id, name, type, protein_ratio, fat_ratio, carbon_ratio, area, remark, create_by, create_time, update_by, update_time from sys_ingredient + SELECT * FROM sys_ingredient igd + LEFT JOIN ( + SELECT ingredient_id as id, GROUP_CONCAT(name SEPARATOR ',') not_rec FROM( + SELECT physical_signs_id as id, ingredient_id + FROM sys_ingredient_not_rec + ) notRec JOIN sys_physical_signs phy USING(id) + GROUP BY id + ) notRecT USING(id) + LEFT JOIN ( + SELECT ingredient_id as id, GROUP_CONCAT(name SEPARATOR ',') rec FROM( + SELECT physical_signs_id as id, ingredient_id + FROM sys_ingredient_rec + ) rec JOIN sys_physical_signs phy USING(id) + GROUP BY id) recT + USING(id) + + + and name like concat('%', #{name}, '%') + and type_id = #{typeId} + + + + + + + insert into sys_physical_signs + + name, + type_id, + remark, + + + #{name}, + #{typeId}, + #{remark}, + + + + + update sys_physical_signs + + name = #{name}, + type_id = #{typeId}, + remark = #{remark}, + + where id = #{id} + + + + delete from sys_physical_signs where id = #{id} + + + + delete from sys_physical_signs where id in + + #{id} + + + + \ No newline at end of file diff --git a/stdiet-ui/src/api/custom/physicalSigns.js b/stdiet-ui/src/api/custom/physicalSigns.js new file mode 100644 index 000000000..5e0945e55 --- /dev/null +++ b/stdiet-ui/src/api/custom/physicalSigns.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询体征列表 +export function listPhysicalSigns(query) { + return request({ + url: '/custom/physicalSigns/list', + method: 'get', + params: query + }) +} + +// 查询体征详细 +export function getPhysicalSigns(id) { + return request({ + url: '/custom/physicalSigns/' + id, + method: 'get' + }) +} + +// 新增体征 +export function addPhysicalSigns(data) { + return request({ + url: '/custom/physicalSigns', + method: 'post', + data: data + }) +} + +// 修改体征 +export function updatePhysicalSigns(data) { + return request({ + url: '/custom/physicalSigns', + method: 'put', + data: data + }) +} + +// 删除体征 +export function delPhysicalSigns(id) { + return request({ + url: '/custom/physicalSigns/' + id, + method: 'delete' + }) +} + +// 导出体征 +export function exportPhysicalSigns(query) { + return request({ + url: '/custom/physicalSigns/export', + method: 'get', + params: query + }) +} diff --git a/stdiet-ui/src/views/custom/ingredient/index.vue b/stdiet-ui/src/views/custom/ingredient/index.vue index 1ad31bbfa..d6ff7b466 100644 --- a/stdiet-ui/src/views/custom/ingredient/index.vue +++ b/stdiet-ui/src/views/custom/ingredient/index.vue @@ -47,28 +47,28 @@ >新增 - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - + +