客户体征相关

This commit is contained in:
xiezhijun
2021-01-04 16:51:56 +08:00
parent b1a94bc630
commit f76356da68
24 changed files with 3636 additions and 3 deletions

View File

@ -0,0 +1,253 @@
package com.stdiet.custom.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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_customer
*
* @author xzj
* @date 2020-12-31
*/
public class SysCustomer extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 名字 */
@Excel(name = "名字")
private String name;
/** 手机号 */
@Excel(name = "手机号")
private String phone;
/** 邮箱 */
@Excel(name = "邮箱")
private String email;
/** 地址 */
@Excel(name = "地址")
private String address;
/** 付款日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "付款日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date payDate;
/** 开始日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date startDate;
/** 购买月数 */
@Excel(name = "购买月数")
private Long purchaseNum;
/** 累计总金额 */
@Excel(name = "累计总金额")
private BigDecimal payTotal;
/** 主营养师 */
@Excel(name = "主营养师")
private Long mainDietitian;
/** 营养师助理 */
@Excel(name = "营养师助理")
private Long assistantDietitian;
/** 售后营养师 */
@Excel(name = "售后营养师")
private Long afterDietitian;
/** 销售人员 */
@Excel(name = "销售人员")
private Long salesman;
/** 负责人 */
@Excel(name = "负责人")
private Long chargePerson;
/** 跟进状态 */
@Excel(name = "跟进状态")
private Long followStatus;
/** 体征数据,非持久化字段 */
private SysCustomerPhysicalSigns sign;
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 setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setEmail(String email)
{
this.email = email;
}
public String getEmail()
{
return email;
}
public void setAddress(String address)
{
this.address = address;
}
public String getAddress()
{
return address;
}
public void setPayDate(Date payDate)
{
this.payDate = payDate;
}
public Date getPayDate()
{
return payDate;
}
public void setStartDate(Date startDate)
{
this.startDate = startDate;
}
public Date getStartDate()
{
return startDate;
}
public void setPurchaseNum(Long purchaseNum)
{
this.purchaseNum = purchaseNum;
}
public Long getPurchaseNum()
{
return purchaseNum;
}
public void setPayTotal(BigDecimal payTotal)
{
this.payTotal = payTotal;
}
public BigDecimal getPayTotal()
{
return payTotal;
}
public void setMainDietitian(Long mainDietitian)
{
this.mainDietitian = mainDietitian;
}
public Long getMainDietitian()
{
return mainDietitian;
}
public void setAssistantDietitian(Long assistantDietitian)
{
this.assistantDietitian = assistantDietitian;
}
public Long getAssistantDietitian()
{
return assistantDietitian;
}
public void setAfterDietitian(Long afterDietitian)
{
this.afterDietitian = afterDietitian;
}
public Long getAfterDietitian()
{
return afterDietitian;
}
public void setSalesman(Long salesman)
{
this.salesman = salesman;
}
public Long getSalesman()
{
return salesman;
}
public void setChargePerson(Long chargePerson)
{
this.chargePerson = chargePerson;
}
public Long getChargePerson()
{
return chargePerson;
}
public void setFollowStatus(Long followStatus)
{
this.followStatus = followStatus;
}
public Long getFollowStatus()
{
return followStatus;
}
public SysCustomerPhysicalSigns getSign() {
return sign;
}
public void setSign(SysCustomerPhysicalSigns sign) {
this.sign = sign;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("phone", getPhone())
.append("email", getEmail())
.append("address", getAddress())
.append("payDate", getPayDate())
.append("startDate", getStartDate())
.append("purchaseNum", getPurchaseNum())
.append("payTotal", getPayTotal())
.append("mainDietitian", getMainDietitian())
.append("assistantDietitian", getAssistantDietitian())
.append("afterDietitian", getAfterDietitian())
.append("salesman", getSalesman())
.append("chargePerson", getChargePerson())
.append("followStatus", getFollowStatus())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.toString();
}
}

View File

@ -0,0 +1,444 @@
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;
import java.util.List;
/**
* 客户数据对象 sys_customer_physical_signs
*
* @author xzj
* @date 2020-12-31
*/
public class SysCustomerPhysicalSigns extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 客户id */
@Excel(name = "客户id")
private Long customerId;
/** 客户性别 0男 1女 */
@Excel(name = "客户性别 0男 1女")
private Integer sex;
/** 客户年龄(岁) */
@Excel(name = "客户年龄", readConverterExp = "岁=")
private Integer age;
/** 客户身高(厘米) */
@Excel(name = "客户身高", readConverterExp = "厘=米")
private Integer tall;
/** 客户体重(斤) */
@Excel(name = "客户体重", readConverterExp = "斤=")
private Integer weight;
/** 客户病史体征id */
@Excel(name = "客户病史体征id")
private String physicalSignsId;
/** 客户忌口不爱吃食材id */
@Excel(name = "客户忌口不爱吃食材id")
private String dishesIngredientId;
/** 客户照片 */
@Excel(name = "客户照片")
private String photo;
/** 是否便秘 0是 1否 */
@Excel(name = "是否便秘 0是 1否")
private Integer constipation;
/** 是否熬夜、失眠 0是 1否 */
@Excel(name = "是否熬夜、失眠 0是 1否")
private Integer staylate;
/** 是否经常运动 0是 1否 */
@Excel(name = "是否经常运动 0是 1否")
private Integer motion;
/** 饮食方式 0自己做 1外面吃 */
@Excel(name = "饮食方式 0自己做 1外面吃")
private Integer makeFoodType;
/** 饮食特点 0清淡 1重口味 */
@Excel(name = "饮食特点 0清淡 1重口味")
private Integer makeFoodTaste;
/** 平时是否久坐 0久坐多 1走动多 */
@Excel(name = "平时是否久坐 0久坐多 1走动多")
private Integer walk;
/** 减脂过程遇到的困难 */
@Excel(name = "减脂过程遇到的困难")
private String difficulty;
/** 是否浑身乏力 0是 1否 */
@Excel(name = "是否浑身乏力 0是 1否")
private Integer weakness;
/** 是否减脂反弹 0是 1否 */
@Excel(name = "是否减脂反弹 0是 1否")
private Integer rebound;
/** 能否认识到生活习惯的改善才是减脂的关键 0是 1否 */
@Excel(name = "能否认识到生活习惯的改善才是减脂的关键 0是 1否")
private Integer crux;
/** 南方人还是北方人 0南方 1北方 */
@Excel(name = "南方人还是北方人 0南方 1北方")
private Integer position;
/** 睡觉时间24小时制 */
@Excel(name = "睡觉时间", readConverterExp = "2=4小时制")
private Integer sleepTime;
/** 起床时间24小时制 */
@Excel(name = "起床时间", readConverterExp = "2=4小时制")
private Integer getupTime;
/** 联系沟通时间24小时制 */
@Excel(name = "联系沟通时间", readConverterExp = "2=4小时制")
private Integer connectTime;
/** 备注 */
@Excel(name = "备注")
private String remarks;
/** 湿气数据 */
@Excel(name = "湿气数据")
private String bloodData;
/** 气血数据 */
@Excel(name = "气血数据")
private String moistureDate;
/** 工作职业 */
@Excel(name = "工作职业")
private String vocation;
/** 是否上夜班 */
@Excel(name = "是否上夜班")
private Integer night;
/** 减脂经历 */
@Excel(name = "减脂经历")
private String experience;
/** 体征对象集合 **/
private List<SysPhysicalSigns> signList;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setCustomerId(Long customerId)
{
this.customerId = customerId;
}
public Long getCustomerId()
{
return customerId;
}
public void setSex(Integer sex)
{
this.sex = sex;
}
public Integer getSex()
{
return sex;
}
public void setAge(Integer age)
{
this.age = age;
}
public Integer getAge()
{
return age;
}
public void setTall(Integer tall)
{
this.tall = tall;
}
public Integer getTall()
{
return tall;
}
public void setWeight(Integer weight)
{
this.weight = weight;
}
public Integer getWeight()
{
return weight;
}
public void setPhysicalSignsId(String physicalSignsId)
{
this.physicalSignsId = physicalSignsId;
}
public String getPhysicalSignsId()
{
return physicalSignsId;
}
public void setDishesIngredientId(String dishesIngredientId)
{
this.dishesIngredientId = dishesIngredientId;
}
public String getDishesIngredientId()
{
return dishesIngredientId;
}
public void setPhoto(String photo)
{
this.photo = photo;
}
public String getPhoto()
{
return photo;
}
public void setConstipation(Integer constipation)
{
this.constipation = constipation;
}
public Integer getConstipation()
{
return constipation;
}
public void setStaylate(Integer staylate)
{
this.staylate = staylate;
}
public Integer getStaylate()
{
return staylate;
}
public void setMotion(Integer motion)
{
this.motion = motion;
}
public Integer getMotion()
{
return motion;
}
public void setMakeFoodType(Integer makeFoodType)
{
this.makeFoodType = makeFoodType;
}
public Integer getMakeFoodType()
{
return makeFoodType;
}
public void setMakeFoodTaste(Integer makeFoodTaste)
{
this.makeFoodTaste = makeFoodTaste;
}
public Integer getMakeFoodTaste()
{
return makeFoodTaste;
}
public void setWalk(Integer walk)
{
this.walk = walk;
}
public Integer getWalk()
{
return walk;
}
public void setDifficulty(String difficulty)
{
this.difficulty = difficulty;
}
public String getDifficulty()
{
return difficulty;
}
public void setWeakness(Integer weakness)
{
this.weakness = weakness;
}
public Integer getWeakness()
{
return weakness;
}
public void setRebound(Integer rebound)
{
this.rebound = rebound;
}
public Integer getRebound()
{
return rebound;
}
public void setCrux(Integer crux)
{
this.crux = crux;
}
public Integer getCrux()
{
return crux;
}
public void setPosition(Integer position)
{
this.position = position;
}
public Integer getPosition()
{
return position;
}
public void setSleepTime(Integer sleepTime)
{
this.sleepTime = sleepTime;
}
public Integer getSleepTime()
{
return sleepTime;
}
public void setGetupTime(Integer getupTime)
{
this.getupTime = getupTime;
}
public Integer getGetupTime()
{
return getupTime;
}
public void setConnectTime(Integer connectTime)
{
this.connectTime = connectTime;
}
public Integer getConnectTime()
{
return connectTime;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
public void setBloodData(String bloodData)
{
this.bloodData = bloodData;
}
public String getBloodData()
{
return bloodData;
}
public void setMoistureDate(String moistureDate)
{
this.moistureDate = moistureDate;
}
public String getMoistureDate()
{
return moistureDate;
}
public String getVocation() {
return vocation;
}
public void setVocation(String vocation) {
this.vocation = vocation;
}
public Integer getNight() {
return night;
}
public void setNight(Integer night) {
this.night = night;
}
public String getExperience() {
return experience;
}
public void setExperience(String experience) {
this.experience = experience;
}
public List<SysPhysicalSigns> getSignList() {
return signList;
}
public void setSignList(List<SysPhysicalSigns> signList) {
this.signList = signList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("customerId", getCustomerId())
.append("sex", getSex())
.append("age", getAge())
.append("tall", getTall())
.append("weight", getWeight())
.append("physicalSignsId", getPhysicalSignsId())
.append("dishesIngredientId", getDishesIngredientId())
.append("photo", getPhoto())
.append("constipation", getConstipation())
.append("staylate", getStaylate())
.append("motion", getMotion())
.append("makeFoodType", getMakeFoodType())
.append("makeFoodTaste", getMakeFoodTaste())
.append("walk", getWalk())
.append("difficulty", getDifficulty())
.append("weakness", getWeakness())
.append("rebound", getRebound())
.append("crux", getCrux())
.append("position", getPosition())
.append("sleepTime", getSleepTime())
.append("getupTime", getGetupTime())
.append("connectTime", getConnectTime())
.append("remarks", getRemarks())
.append("bloodData", getBloodData())
.append("moistureDate", getMoistureDate())
.append("vocation", getVocation())
.append(" night", getNight())
.append("experience", getExperience())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.toString();
}
}

View File

@ -0,0 +1,402 @@
package com.stdiet.custom.dto.request;
import com.stdiet.common.annotation.Excel;
import com.stdiet.common.core.domain.BaseEntity;
/**
* 客户信息建档调查DTO
*
* @author xzj
* @date 2020-12-31
*/
public class CustomerInvestigateRequest extends BaseEntity
{
private static final long serialVersionUID = 1L;
//基础信息
/** $column.columnComment */
private Long id;
/** 名字 */
@Excel(name = "名字")
private String name;
/** 手机号 */
@Excel(name = "手机号")
private String phone;
/** 邮箱 */
@Excel(name = "邮箱")
private String email;
/** 地址 */
@Excel(name = "地址")
private String address;
//体征信息
/** 客户性别 0男 1女 */
@Excel(name = "客户性别 0男 1女")
private Integer sex;
/** 客户年龄(岁) */
@Excel(name = "客户年龄", readConverterExp = "岁=")
private Integer age;
/** 客户身高(厘米) */
@Excel(name = "客户身高", readConverterExp = "厘=米")
private Integer tall;
/** 客户体重(斤) */
@Excel(name = "客户体重", readConverterExp = "斤=")
private Integer weight;
/** 客户病史体征id */
@Excel(name = "客户病史体征id")
private String physicalSignsId;
/** 客户忌口不爱吃食材id */
@Excel(name = "客户忌口不爱吃食材id")
private String dishesIngredientId;
/** 客户照片 */
@Excel(name = "客户照片")
private String photo;
/** 是否便秘 0是 1否 */
@Excel(name = "是否便秘 0是 1否")
private Integer constipation;
/** 是否熬夜、失眠 0是 1否 */
@Excel(name = "是否熬夜、失眠 0是 1否")
private Integer staylate;
/** 是否经常运动 0是 1否 */
@Excel(name = "是否经常运动 0是 1否")
private Integer motion;
/** 饮食方式 0自己做 1外面吃 */
@Excel(name = "饮食方式 0自己做 1外面吃")
private Integer makeFoodType;
/** 饮食特点 0清淡 1重口味 */
@Excel(name = "饮食特点 0清淡 1重口味")
private Integer makeFoodTaste;
/** 平时是否久坐 0久坐多 1走动多 */
@Excel(name = "平时是否久坐 0久坐多 1走动多")
private Integer walk;
/** 减脂过程遇到的困难 */
@Excel(name = "减脂过程遇到的困难")
private String difficulty;
/** 是否浑身乏力 0是 1否 */
@Excel(name = "是否浑身乏力 0是 1否")
private Integer weakness;
/** 是否减脂反弹 0是 1否 */
@Excel(name = "是否减脂反弹 0是 1否")
private Integer rebound;
/** 能否认识到生活习惯的改善才是减脂的关键 0是 1否 */
@Excel(name = "能否认识到生活习惯的改善才是减脂的关键 0是 1否")
private Integer crux;
/** 南方人还是北方人 0南方 1北方 */
@Excel(name = "南方人还是北方人 0南方 1北方")
private Integer position;
/** 睡觉时间24小时制 */
@Excel(name = "睡觉时间", readConverterExp = "2=4小时制")
private Integer sleepTime;
/** 起床时间24小时制 */
@Excel(name = "起床时间", readConverterExp = "2=4小时制")
private Integer getupTime;
/** 联系沟通时间24小时制 */
@Excel(name = "联系沟通时间", readConverterExp = "2=4小时制")
private Integer connectTime;
/** 备注 */
@Excel(name = "备注")
private String remarks;
/** 湿气数据 */
@Excel(name = "湿气数据")
private String bloodData;
/** 气血数据 */
@Excel(name = "气血数据")
private String moistureDate;
/** 工作职业 */
@Excel(name = "工作职业")
private String vocation;
/** 是否上夜班 */
@Excel(name = "是否上夜班")
private Integer night;
/** 减脂经历 */
@Excel(name = "减脂经历")
private String experience;
public Long getId() {
return id;
}
public String getName() {
return name;
}
public String getPhone() {
return phone;
}
public String getEmail() {
return email;
}
public String getAddress() {
return address;
}
public void setId(Long id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setPhone(String phone) {
this.phone = phone;
}
public void setEmail(String email) {
this.email = email;
}
public void setAddress(String address) {
this.address = address;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public Integer getTall() {
return tall;
}
public void setTall(Integer tall) {
this.tall = tall;
}
public Integer getWeight() {
return weight;
}
public void setWeight(Integer weight) {
this.weight = weight;
}
public String getPhysicalSignsId() {
return physicalSignsId;
}
public void setPhysicalSignsId(String physicalSignsId) {
this.physicalSignsId = physicalSignsId;
}
public String getDishesIngredientId() {
return dishesIngredientId;
}
public void setDishesIngredientId(String dishesIngredientId) {
this.dishesIngredientId = dishesIngredientId;
}
public String getPhoto() {
return photo;
}
public void setPhoto(String photo) {
this.photo = photo;
}
public Integer getConstipation() {
return constipation;
}
public void setConstipation(Integer constipation) {
this.constipation = constipation;
}
public Integer getStaylate() {
return staylate;
}
public void setStaylate(Integer staylate) {
this.staylate = staylate;
}
public Integer getMotion() {
return motion;
}
public void setMotion(Integer motion) {
this.motion = motion;
}
public Integer getMakeFoodType() {
return makeFoodType;
}
public void setMakeFoodType(Integer makeFoodType) {
this.makeFoodType = makeFoodType;
}
public Integer getMakeFoodTaste() {
return makeFoodTaste;
}
public void setMakeFoodTaste(Integer makeFoodTaste) {
this.makeFoodTaste = makeFoodTaste;
}
public Integer getWalk() {
return walk;
}
public void setWalk(Integer walk) {
this.walk = walk;
}
public String getDifficulty() {
return difficulty;
}
public void setDifficulty(String difficulty) {
this.difficulty = difficulty;
}
public Integer getWeakness() {
return weakness;
}
public void setWeakness(Integer weakness) {
this.weakness = weakness;
}
public Integer getRebound() {
return rebound;
}
public void setRebound(Integer rebound) {
this.rebound = rebound;
}
public Integer getCrux() {
return crux;
}
public void setCrux(Integer crux) {
this.crux = crux;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
public Integer getSleepTime() {
return sleepTime;
}
public void setSleepTime(Integer sleepTime) {
this.sleepTime = sleepTime;
}
public Integer getGetupTime() {
return getupTime;
}
public void setGetupTime(Integer getupTime) {
this.getupTime = getupTime;
}
public Integer getConnectTime() {
return connectTime;
}
public void setConnectTime(Integer connectTime) {
this.connectTime = connectTime;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public String getBloodData() {
return bloodData;
}
public void setBloodData(String bloodData) {
this.bloodData = bloodData;
}
public String getMoistureDate() {
return moistureDate;
}
public void setMoistureDate(String moistureDate) {
this.moistureDate = moistureDate;
}
public String getVocation() {
return vocation;
}
public void setVocation(String vocation) {
this.vocation = vocation;
}
public Integer getNight() {
return night;
}
public void setNight(Integer night) {
this.night = night;
}
public String getExperience() {
return experience;
}
public void setExperience(String experience) {
this.experience = experience;
}
}

View File

@ -0,0 +1,73 @@
package com.stdiet.custom.mapper;
import java.util.List;
import com.stdiet.custom.domain.SysCustomer;
import org.apache.ibatis.annotations.Param;
/**
* 客户信息Mapper接口
*
* @author xzj
* @date 2020-12-31
*/
public interface SysCustomerMapper
{
/**
* 查询客户信息
*
* @param id 客户信息ID
* @return 客户信息
*/
public SysCustomer selectSysCustomerById(Long id);
/**
* 查询客户信息列表
*
* @param sysCustomer 客户信息
* @return 客户信息集合
*/
public List<SysCustomer> selectSysCustomerList(SysCustomer sysCustomer);
/**
* 新增客户信息
*
* @param sysCustomer 客户信息
* @return 结果
*/
public int insertSysCustomer(SysCustomer sysCustomer);
/**
* 修改客户信息
*
* @param sysCustomer 客户信息
* @return 结果
*/
public int updateSysCustomer(SysCustomer sysCustomer);
/**
* 删除客户信息
*
* @param id 客户信息ID
* @return 结果
*/
public int deleteSysCustomerById(Long id);
/**
* 批量删除客户信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteSysCustomerByIds(Long[] ids);
/**
* 根据手机号查询客户信息
*
* @param phone 手机号
* @return 结果
*/
SysCustomer getCustomerByPhone(@Param("phone")String phone);
//查询客户基础信息以及体征信息
List<SysCustomer> selectSysCustomerAndSignList(SysCustomer sysCustomer);
}

View File

@ -0,0 +1,72 @@
package com.stdiet.custom.mapper;
import java.util.List;
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
import org.apache.ibatis.annotations.Param;
/**
* 客户体征信息Mapper接口
*
* @author xzj
* @date 2020-12-31
*/
public interface SysCustomerPhysicalSignsMapper
{
/**
* 查询客户体征信息
*
* @param id 客户体征信息ID
* @return 客户体征信息
*/
public SysCustomerPhysicalSigns selectSysCustomerPhysicalSignsById(Long id);
/**
* 查询客户体征信息列表
*
* @param sysCustomerPhysicalSigns 客户体征信息
* @return 客户体征信息集合
*/
public List<SysCustomerPhysicalSigns> selectSysCustomerPhysicalSignsList(SysCustomerPhysicalSigns sysCustomerPhysicalSigns);
/**
* 新增客户体征信息
*
* @param sysCustomerPhysicalSigns 客户体征信息
* @return 结果
*/
public int insertSysCustomerPhysicalSigns(SysCustomerPhysicalSigns sysCustomerPhysicalSigns);
/**
* 修改客户体征信息
*
* @param sysCustomerPhysicalSigns 客户体征信息
* @return 结果
*/
public int updateSysCustomerPhysicalSigns(SysCustomerPhysicalSigns sysCustomerPhysicalSigns);
/**
* 删除客户体征信息
*
* @param id 客户体征信息ID
* @return 结果
*/
public int deleteSysCustomerPhysicalSignsById(Long id);
/**
* 批量删除客户体征信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteSysCustomerPhysicalSignsByIds(Long[] ids);
/**
* 根据客户id修改客户体征信息
*
* @param sysCustomerPhysicalSigns 客户体征信息
* @return 结果
*/
int updateSysCustomerPhysicalSignsByCustomerId(SysCustomerPhysicalSigns sysCustomerPhysicalSigns);
int deleteSysCustomerPhysicalSignsByCustomerIds(Long[] ids);
}

View File

@ -0,0 +1,60 @@
package com.stdiet.custom.service;
import java.util.List;
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
/**
* 客户体征信息Service接口
*
* @author xzj
* @date 2020-12-31
*/
public interface ISysCustomerPhysicalSignsService {
/**
* 查询客户体征信息
*
* @param id 客户体征信息ID
* @return 客户体征信息
*/
public SysCustomerPhysicalSigns selectSysCustomerPhysicalSignsById(Long id);
/**
* 查询客户体征信息列表
*
* @param sysCustomerPhysicalSigns 客户体征信息
* @return 客户体征信息集合
*/
public List<SysCustomerPhysicalSigns> selectSysCustomerPhysicalSignsList(SysCustomerPhysicalSigns sysCustomerPhysicalSigns);
/**
* 新增客户体征信息
*
* @param sysCustomerPhysicalSigns 客户体征信息
* @return 结果
*/
public int insertSysCustomerPhysicalSigns(SysCustomerPhysicalSigns sysCustomerPhysicalSigns);
/**
* 修改客户体征信息
*
* @param sysCustomerPhysicalSigns 客户体征信息
* @return 结果
*/
public int updateSysCustomerPhysicalSigns(SysCustomerPhysicalSigns sysCustomerPhysicalSigns);
/**
* 批量删除客户体征信息
*
* @param ids 需要删除的客户体征信息ID
* @return 结果
*/
public int deleteSysCustomerPhysicalSignsByIds(Long[] ids);
/**
* 删除客户体征信息信息
*
* @param id 客户体征信息ID
* @return 结果
*/
public int deleteSysCustomerPhysicalSignsById(Long id);
}

View File

@ -0,0 +1,96 @@
package com.stdiet.custom.service;
import java.util.List;
import com.stdiet.custom.domain.SysCustomer;
import com.stdiet.custom.dto.request.CustomerInvestigateRequest;
/**
* 客户信息Service接口
*
* @author xzj
* @date 2020-12-31
*/
public interface ISysCustomerService
{
/**
* 查询客户信息
*
* @param id 客户信息ID
* @return 客户信息
*/
public SysCustomer selectSysCustomerById(Long id);
/**
* 查询客户信息列表
*
* @param sysCustomer 客户信息
* @return 客户信息集合
*/
public List<SysCustomer> selectSysCustomerList(SysCustomer sysCustomer);
/**
* 新增客户信息
*
* @param sysCustomer 客户信息
* @return 结果
*/
public int insertSysCustomer(SysCustomer sysCustomer);
/**
* 修改客户信息
*
* @param sysCustomer 客户信息
* @return 结果
*/
public int updateSysCustomer(SysCustomer sysCustomer);
/**
* 批量删除客户信息
*
* @param ids 需要删除的客户信息ID
* @return 结果
*/
public int deleteSysCustomerByIds(Long[] ids);
/**
* 删除客户信息信息
*
* @param id 客户信息ID
* @return 结果
*/
public int deleteSysCustomerById(Long id);
/**
* 根据手机号查询
*
* @param phone 手机号
* @return 结果
*/
SysCustomer getCustomerByPhone(String phone);
/**
* 客户建档资料填写
*
* @param customerInvestigateRequest 客户建档相关资料
* @return 结果
*/
int addOrupdateCustomerAndSign( CustomerInvestigateRequest customerInvestigateRequest) throws Exception;
/**
* 查询客户基础信息以及体征信息列表
*
* @param sysCustomer 查询条件
* @return 结果
*/
List<SysCustomer> selectSysCustomerAndSignList(SysCustomer sysCustomer);
/**
* 根据id查询客户信息基础信息以及体征信息
*
* @param id 客户id
* @return 结果
*/
SysCustomer getCustomerAndSignById(Long id);
int delCustomerAndSignById(Long[] ids);
}

View File

@ -0,0 +1,96 @@
package com.stdiet.custom.service.impl;
import java.util.List;
import com.stdiet.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.stdiet.custom.mapper.SysCustomerPhysicalSignsMapper;
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
import com.stdiet.custom.service.ISysCustomerPhysicalSignsService;
/**
* 客户体征信息Service业务层处理
*
* @author xzj
* @date 2020-12-31
*/
@Service
public class SysCustomerPhysicalSignsServiceImpl implements ISysCustomerPhysicalSignsService
{
@Autowired
private SysCustomerPhysicalSignsMapper sysCustomerPhysicalSignsMapper;
/**
* 查询客户体征信息
*
* @param id 客户体征信息ID
* @return 客户体征信息
*/
@Override
public SysCustomerPhysicalSigns selectSysCustomerPhysicalSignsById(Long id)
{
return sysCustomerPhysicalSignsMapper.selectSysCustomerPhysicalSignsById(id);
}
/**
* 查询客户体征信息列表
*
* @param sysCustomerPhysicalSigns 客户体征信息
* @return 客户体征信息
*/
@Override
public List<SysCustomerPhysicalSigns> selectSysCustomerPhysicalSignsList(SysCustomerPhysicalSigns sysCustomerPhysicalSigns)
{
return sysCustomerPhysicalSignsMapper.selectSysCustomerPhysicalSignsList(sysCustomerPhysicalSigns);
}
/**
* 新增客户体征信息
*
* @param sysCustomerPhysicalSigns 客户体征信息
* @return 结果
*/
@Override
public int insertSysCustomerPhysicalSigns(SysCustomerPhysicalSigns sysCustomerPhysicalSigns)
{
sysCustomerPhysicalSigns.setCreateTime(DateUtils.getNowDate());
return sysCustomerPhysicalSignsMapper.insertSysCustomerPhysicalSigns(sysCustomerPhysicalSigns);
}
/**
* 修改客户体征信息
*
* @param sysCustomerPhysicalSigns 客户体征信息
* @return 结果
*/
@Override
public int updateSysCustomerPhysicalSigns(SysCustomerPhysicalSigns sysCustomerPhysicalSigns)
{
sysCustomerPhysicalSigns.setUpdateTime(DateUtils.getNowDate());
return sysCustomerPhysicalSignsMapper.updateSysCustomerPhysicalSigns(sysCustomerPhysicalSigns);
}
/**
* 批量删除客户体征信息
*
* @param ids 需要删除的客户体征信息ID
* @return 结果
*/
@Override
public int deleteSysCustomerPhysicalSignsByIds(Long[] ids)
{
return sysCustomerPhysicalSignsMapper.deleteSysCustomerPhysicalSignsByIds(ids);
}
/**
* 删除客户体征信息信息
*
* @param id 客户体征信息ID
* @return 结果
*/
@Override
public int deleteSysCustomerPhysicalSignsById(Long id)
{
return sysCustomerPhysicalSignsMapper.deleteSysCustomerPhysicalSignsById(id);
}
}

View File

@ -0,0 +1,181 @@
package com.stdiet.custom.service.impl;
import java.util.List;
import com.stdiet.common.core.domain.model.LoginUser;
import com.stdiet.common.utils.DateUtils;
import com.stdiet.common.utils.SecurityUtils;
import com.stdiet.common.utils.bean.ObjectUtils;
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
import com.stdiet.custom.dto.request.CustomerInvestigateRequest;
import com.stdiet.custom.mapper.SysCustomerPhysicalSignsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.stdiet.custom.mapper.SysCustomerMapper;
import com.stdiet.custom.domain.SysCustomer;
import com.stdiet.custom.service.ISysCustomerService;
import org.springframework.transaction.annotation.Transactional;
/**
* 客户信息Service业务层处理
*
* @author xzj
* @date 2020-12-31
*/
@Service
@Transactional
public class SysCustomerServiceImpl implements ISysCustomerService
{
@Autowired
private SysCustomerMapper sysCustomerMapper;
@Autowired
private SysCustomerPhysicalSignsMapper sysCustomerPhysicalSignsMapper;
/**
* 查询客户信息
*
* @param id 客户信息ID
* @return 客户信息
*/
@Override
public SysCustomer selectSysCustomerById(Long id)
{
return sysCustomerMapper.selectSysCustomerById(id);
}
/**
* 查询客户信息列表
*
* @param sysCustomer 客户信息
* @return 客户信息
*/
@Override
public List<SysCustomer> selectSysCustomerList(SysCustomer sysCustomer)
{
return sysCustomerMapper.selectSysCustomerList(sysCustomer);
}
/**
* 新增客户信息
*
* @param sysCustomer 客户信息
* @return 结果
*/
@Override
public int insertSysCustomer(SysCustomer sysCustomer)
{
sysCustomer.setCreateTime(DateUtils.getNowDate());
return sysCustomerMapper.insertSysCustomer(sysCustomer);
}
/**
* 修改客户信息
*
* @param sysCustomer 客户信息
* @return 结果
*/
@Override
public int updateSysCustomer(SysCustomer sysCustomer)
{
sysCustomer.setUpdateTime(DateUtils.getNowDate());
return sysCustomerMapper.updateSysCustomer(sysCustomer);
}
/**
* 批量删除客户信息
*
* @param ids 需要删除的客户信息ID
* @return 结果
*/
@Override
public int deleteSysCustomerByIds(Long[] ids)
{
return sysCustomerMapper.deleteSysCustomerByIds(ids);
}
/**
* 删除客户信息信息
*
* @param id 客户信息ID
* @return 结果
*/
@Override
public int deleteSysCustomerById(Long id)
{
return sysCustomerMapper.deleteSysCustomerById(id);
}
/**
* 根据手机号查询
*
* @param phone 手机号
* @return 结果
*/
public SysCustomer getCustomerByPhone(String phone){
return sysCustomerMapper.getCustomerByPhone(phone);
}
/**
* 客户建档资料填写
*
* @param customerInvestigateRequest 客户建档相关资料
* @return 结果
*/
public int addOrupdateCustomerAndSign(CustomerInvestigateRequest customerInvestigateRequest) throws Exception{
//当前登录用户
//LoginUser loginUser = SecurityUtils.getLoginUser();
SysCustomer sysCustomer = new SysCustomer();
sysCustomer.setId(customerInvestigateRequest.getId());
sysCustomer.setName(customerInvestigateRequest.getName());
sysCustomer.setPhone(customerInvestigateRequest.getPhone());
//添加人、更新人
/*if(loginUser != null){
if(customerInvestigateRequest.getId() == null){
sysCustomer.setCreateBy(loginUser.getUser().getUserId()+"");
}else{
sysCustomer.setUpdateBy(loginUser.getUser().getUserId()+"");
}
}*/
//sysCustomer.setEmail(customerInvestigateRequest.getEmail());
//sysCustomer.setAddress(customerInvestigateRequest.getAddress());
int addOrUpdateRow = customerInvestigateRequest.getId() == null ? insertSysCustomer(sysCustomer) : updateSysCustomer(sysCustomer);
if(addOrUpdateRow > 0){
SysCustomerPhysicalSigns customerSigns = ObjectUtils.getObjectByObject(customerInvestigateRequest, SysCustomerPhysicalSigns.class);
customerSigns.setCustomerId(sysCustomer.getId());
customerSigns.setId(null);
addOrUpdateRow = customerInvestigateRequest.getId() == null ? sysCustomerPhysicalSignsMapper.insertSysCustomerPhysicalSigns(customerSigns) : sysCustomerPhysicalSignsMapper.updateSysCustomerPhysicalSignsByCustomerId(customerSigns);
}
return addOrUpdateRow;
}
/**
* 查询客户基础信息以及体征信息列表
*
* @param sysCustomer 查询条件
* @return 结果
*/
public List<SysCustomer> selectSysCustomerAndSignList(SysCustomer sysCustomer){
return sysCustomerMapper.selectSysCustomerAndSignList(sysCustomer);
}
/**
* 根据id查询客户信息基础信息以及体征信息
*
* @param id 客户id
* @return 结果
*/
public SysCustomer getCustomerAndSignById(Long id){
SysCustomer sysCustomer = new SysCustomer();
sysCustomer.setId(id);
List<SysCustomer> list = sysCustomerMapper.selectSysCustomerAndSignList(sysCustomer);
return list.size() > 0 ? list.get(0) : null;
}
public int delCustomerAndSignById(Long[] ids){
if(deleteSysCustomerByIds(ids) > 0){
return sysCustomerPhysicalSignsMapper.deleteSysCustomerPhysicalSignsByCustomerIds(ids);
}
return 0;
}
}

View File

@ -0,0 +1,218 @@
<?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.stdiet.custom.mapper.SysCustomerMapper">
<resultMap type="SysCustomer" id="SysCustomerResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="phone" column="phone" />
<result property="email" column="email" />
<result property="address" column="address" />
<result property="payDate" column="pay_date" />
<result property="startDate" column="start_date" />
<result property="purchaseNum" column="purchase_num" />
<result property="payTotal" column="pay_total" />
<result property="mainDietitian" column="main_dietitian" />
<result property="assistantDietitian" column="assistant_dietitian" />
<result property="afterDietitian" column="after_dietitian" />
<result property="salesman" column="salesman" />
<result property="chargePerson" column="charge_person" />
<result property="followStatus" column="follow_status" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
</resultMap>
<resultMap type="SysCustomer" id="SysCustomerSignResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="phone" column="phone" />
<result property="email" column="email" />
<result property="address" column="address" />
<result property="payDate" column="pay_date" />
<result property="startDate" column="start_date" />
<result property="purchaseNum" column="purchase_num" />
<result property="payTotal" column="pay_total" />
<result property="mainDietitian" column="main_dietitian" />
<result property="assistantDietitian" column="assistant_dietitian" />
<result property="afterDietitian" column="after_dietitian" />
<result property="salesman" column="salesman" />
<result property="chargePerson" column="charge_person" />
<result property="followStatus" column="follow_status" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<association property="sign" javaType="com.stdiet.custom.domain.SysCustomerPhysicalSigns">
<result property="id" column="id" />
<result property="customerId" column="customer_id" />
<result property="sex" column="sex" />
<result property="age" column="age" />
<result property="tall" column="tall" />
<result property="weight" column="weight" />
<result property="physicalSignsId" column="physical_signs_id" />
<result property="dishesIngredientId" column="dishes_ingredient_id" />
<result property="photo" column="photo" />
<result property="constipation" column="constipation" />
<result property="staylate" column="stayLate" />
<result property="motion" column="motion" />
<result property="makeFoodType" column="make_food_type" />
<result property="makeFoodTaste" column="make_food_taste" />
<result property="walk" column="walk" />
<result property="difficulty" column="difficulty" />
<result property="weakness" column="weakness" />
<result property="rebound" column="rebound" />
<result property="crux" column="crux" />
<result property="position" column="position" />
<result property="sleepTime" column="sleep_time" />
<result property="getupTime" column="getup_time" />
<result property="connectTime" column="connect_time" />
<result property="remarks" column="remarks" />
<result property="bloodData" column="blood_data" />
<result property="moistureDate" column="moisture_date" />
<result property="vocation" column="vocation" />
<result property="night" column="night" />
<result property="experience" column="experience" />
<!-- column是传的参数, select是调用的查询 -->
<association property="signList" column="physical_signs_id" select="getSignByIds"/>
</association>
</resultMap>
<sql id="selectSysCustomerVo">
select id, name, phone, email, address, pay_date, start_date, purchase_num, pay_total, main_dietitian, assistant_dietitian, after_dietitian, salesman, charge_person, follow_status, create_time, create_by, update_time, update_by from sys_customer
</sql>
<select id="selectSysCustomerList" parameterType="SysCustomer" resultMap="SysCustomerResult">
<include refid="selectSysCustomerVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="phone != null and phone != ''"> and phone like concat('%', #{phone}, '%')</if>
</where>
</select>
<select id="selectSysCustomerById" parameterType="Long" resultMap="SysCustomerResult">
<include refid="selectSysCustomerVo"/>
where id = #{id}
</select>
<insert id="insertSysCustomer" parameterType="SysCustomer" useGeneratedKeys="true" keyProperty="id">
insert into sys_customer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="phone != null">phone,</if>
<if test="email != null">email,</if>
<if test="address != null">address,</if>
<if test="payDate != null">pay_date,</if>
<if test="startDate != null">start_date,</if>
<if test="purchaseNum != null">purchase_num,</if>
<if test="payTotal != null">pay_total,</if>
<if test="mainDietitian != null">main_dietitian,</if>
<if test="assistantDietitian != null">assistant_dietitian,</if>
<if test="afterDietitian != null">after_dietitian,</if>
<if test="salesman != null">salesman,</if>
<if test="chargePerson != null">charge_person,</if>
<if test="followStatus != null">follow_status,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="phone != null">#{phone},</if>
<if test="email != null">#{email},</if>
<if test="address != null">#{address},</if>
<if test="payDate != null">#{payDate},</if>
<if test="startDate != null">#{startDate},</if>
<if test="purchaseNum != null">#{purchaseNum},</if>
<if test="payTotal != null">#{payTotal},</if>
<if test="mainDietitian != null">#{mainDietitian},</if>
<if test="assistantDietitian != null">#{assistantDietitian},</if>
<if test="afterDietitian != null">#{afterDietitian},</if>
<if test="salesman != null">#{salesman},</if>
<if test="chargePerson != null">#{chargePerson},</if>
<if test="followStatus != null">#{followStatus},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateSysCustomer" parameterType="SysCustomer">
update sys_customer
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="email != null">email = #{email},</if>
<if test="address != null">address = #{address},</if>
<if test="payDate != null">pay_date = #{payDate},</if>
<if test="startDate != null">start_date = #{startDate},</if>
<if test="purchaseNum != null">purchase_num = #{purchaseNum},</if>
<if test="payTotal != null">pay_total = #{payTotal},</if>
<if test="mainDietitian != null">main_dietitian = #{mainDietitian},</if>
<if test="assistantDietitian != null">assistant_dietitian = #{assistantDietitian},</if>
<if test="afterDietitian != null">after_dietitian = #{afterDietitian},</if>
<if test="salesman != null">salesman = #{salesman},</if>
<if test="chargePerson != null">charge_person = #{chargePerson},</if>
<if test="followStatus != null">follow_status = #{followStatus},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysCustomerById" parameterType="Long">
delete from sys_customer where id = #{id}
</delete>
<delete id="deleteSysCustomerByIds" parameterType="String">
delete from sys_customer where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 根据手机号查询客户 -->
<select id="getCustomerByPhone" parameterType="String" resultMap="SysCustomerResult">
<include refid="selectSysCustomerVo"/>
where phone = #{phone}
</select>
<sql id="selectSysCustomerAndSign">
<!--sc.email, sc.address, sc.pay_date, sc.start_date, sc.purchase_num, sc.pay_total, sc.main_dietitian, sc.assistant_dietitian,
sc.after_dietitian, sc.salesman, sc.charge_person, sc.follow_status, -->
select sc.id, sc.name, sc.phone, sc.create_time, sc.create_by, sc.update_time, sc.update_by,
<include refid="selectSysCustomerPhysicalSigns"></include>
from sys_customer sc
left join sys_customer_physical_signs scps on scps.customer_id = sc.id
</sql>
<sql id="selectSysCustomerPhysicalSigns">
scps.sex, scps.age, scps.tall, scps.weight, scps.physical_signs_id, scps.dishes_ingredient_id, scps.photo, scps.constipation,
scps.stayLate, scps.motion, scps.make_food_type, scps.make_food_taste, scps.walk, scps.difficulty, scps.weakness, scps.rebound, scps.crux, scps.position,
scps.sleep_time, scps.getup_time, scps.connect_time, scps.remarks, scps.blood_data, scps.moisture_date, scps.vocation,
scps.night, scps.experience
</sql>
<select id="selectSysCustomerAndSignList" parameterType="SysCustomer" resultMap="SysCustomerSignResult">
<include refid="selectSysCustomerAndSign"/>
<where>
<if test="id != null"> and sc.id = #{id} </if>
<if test="name != null and name != ''"> and sc.name like concat('%', #{name}, '%')</if>
<if test="phone != null and phone != ''"> and sc.phone like concat('%', #{phone}, '%')</if>
</where>
order by id desc
</select>
<!-- 根据体征id获取体征 -->
<select id="getSignByIds" parameterType="String" resultType="SysPhysicalSigns">
select * from sys_physical_signs sps where FIND_IN_SET(id, #{physical_signs_id})
</select>
</mapper>

View File

@ -0,0 +1,257 @@
<?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.stdiet.custom.mapper.SysCustomerPhysicalSignsMapper">
<resultMap type="SysCustomerPhysicalSigns" id="SysCustomerPhysicalSignsResult">
<result property="id" column="id" />
<result property="customerId" column="customer_id" />
<result property="sex" column="sex" />
<result property="age" column="age" />
<result property="tall" column="tall" />
<result property="weight" column="weight" />
<result property="physicalSignsId" column="physical_signs_id" />
<result property="dishesIngredientId" column="dishes_ingredient_id" />
<result property="photo" column="photo" />
<result property="constipation" column="constipation" />
<result property="staylate" column="stayLate" />
<result property="motion" column="motion" />
<result property="makeFoodType" column="make_food_type" />
<result property="makeFoodTaste" column="make_food_taste" />
<result property="walk" column="walk" />
<result property="difficulty" column="difficulty" />
<result property="weakness" column="weakness" />
<result property="rebound" column="rebound" />
<result property="crux" column="crux" />
<result property="position" column="position" />
<result property="sleepTime" column="sleep_time" />
<result property="getupTime" column="getup_time" />
<result property="connectTime" column="connect_time" />
<result property="remarks" column="remarks" />
<result property="bloodData" column="blood_data" />
<result property="moistureDate" column="moisture_date" />
<result property="vocation" column="vocation" />
<result property="night" column="night" />
<result property="experience" column="experience" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectSysCustomerPhysicalSignsVo">
select id, customer_id, sex, age, tall, weight, physical_signs_id, dishes_ingredient_id, photo, constipation, stayLate, motion, make_food_type, make_food_taste, walk, difficulty, weakness, rebound, crux, position, sleep_time, getup_time, connect_time, remarks, blood_data, moisture_date, vocation,
night, experience, create_time, create_by, update_time, update_by from sys_customer_physical_signs
</sql>
<select id="selectSysCustomerPhysicalSignsList" parameterType="SysCustomerPhysicalSigns" resultMap="SysCustomerPhysicalSignsResult">
<include refid="selectSysCustomerPhysicalSignsVo"/>
<where>
<if test="customerId != null "> and customer_id = #{customerId}</if>
<if test="sex != null "> and sex = #{sex}</if>
<if test="age != null "> and age = #{age}</if>
<if test="tall != null "> and tall = #{tall}</if>
<if test="weight != null "> and weight = #{weight}</if>
<if test="physicalSignsId != null and physicalSignsId != ''"> and physical_signs_id = #{physicalSignsId}</if>
<if test="dishesIngredientId != null and dishesIngredientId != ''"> and dishes_ingredient_id = #{dishesIngredientId}</if>
<if test="photo != null and photo != ''"> and photo = #{photo}</if>
<if test="constipation != null "> and constipation = #{constipation}</if>
<if test="staylate != null "> and stayLate = #{staylate}</if>
<if test="motion != null "> and motion = #{motion}</if>
<if test="makeFoodType != null "> and make_food_type = #{makeFoodType}</if>
<if test="makeFoodTaste != null "> and make_food_taste = #{makeFoodTaste}</if>
<if test="walk != null "> and walk = #{walk}</if>
<if test="difficulty != null and difficulty != ''"> and difficulty = #{difficulty}</if>
<if test="weakness != null "> and weakness = #{weakness}</if>
<if test="rebound != null "> and rebound = #{rebound}</if>
<if test="crux != null "> and crux = #{crux}</if>
<if test="position != null "> and position = #{position}</if>
<if test="sleepTime != null "> and sleep_time = #{sleepTime}</if>
<if test="getupTime != null "> and getup_time = #{getupTime}</if>
<if test="connectTime != null "> and connect_time = #{connectTime}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
<if test="bloodData != null and bloodData != ''"> and blood_data = #{bloodData}</if>
<if test="moistureDate != null and moistureDate != ''"> and moisture_date = #{moistureDate}</if>
<if test="vocation != null and vocation != ''"> and vocation = #{vocation}</if>
<if test="night != null "> and night = #{night}</if>
<if test="experience != null and experience != ''"> and experience = #{experience}</if>
</where>
</select>
<select id="selectSysCustomerPhysicalSignsById" parameterType="Long" resultMap="SysCustomerPhysicalSignsResult">
<include refid="selectSysCustomerPhysicalSignsVo"/>
where id = #{id}
</select>
<insert id="insertSysCustomerPhysicalSigns" parameterType="SysCustomerPhysicalSigns" useGeneratedKeys="true" keyProperty="id">
insert into sys_customer_physical_signs
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="customerId != null">customer_id,</if>
<if test="sex != null">sex,</if>
<if test="age != null">age,</if>
<if test="tall != null">tall,</if>
<if test="weight != null">weight,</if>
<if test="physicalSignsId != null">physical_signs_id,</if>
<if test="dishesIngredientId != null">dishes_ingredient_id,</if>
<if test="photo != null">photo,</if>
<if test="constipation != null">constipation,</if>
<if test="staylate != null">stayLate,</if>
<if test="motion != null">motion,</if>
<if test="makeFoodType != null">make_food_type,</if>
<if test="makeFoodTaste != null">make_food_taste,</if>
<if test="walk != null">walk,</if>
<if test="difficulty != null">difficulty,</if>
<if test="weakness != null">weakness,</if>
<if test="rebound != null">rebound,</if>
<if test="crux != null">crux,</if>
<if test="position != null">position,</if>
<if test="sleepTime != null">sleep_time,</if>
<if test="getupTime != null">getup_time,</if>
<if test="connectTime != null">connect_time,</if>
<if test="remarks != null">remarks,</if>
<if test="bloodData != null">blood_data,</if>
<if test="moistureDate != null">moisture_date,</if>
<if test="vocation != null">vocation,</if>
<if test="
night != null">
night,</if>
<if test="experience != null">experience,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="customerId != null">#{customerId},</if>
<if test="sex != null">#{sex},</if>
<if test="age != null">#{age},</if>
<if test="tall != null">#{tall},</if>
<if test="weight != null">#{weight},</if>
<if test="physicalSignsId != null">#{physicalSignsId},</if>
<if test="dishesIngredientId != null">#{dishesIngredientId},</if>
<if test="photo != null">#{photo},</if>
<if test="constipation != null">#{constipation},</if>
<if test="staylate != null">#{staylate},</if>
<if test="motion != null">#{motion},</if>
<if test="makeFoodType != null">#{makeFoodType},</if>
<if test="makeFoodTaste != null">#{makeFoodTaste},</if>
<if test="walk != null">#{walk},</if>
<if test="difficulty != null">#{difficulty},</if>
<if test="weakness != null">#{weakness},</if>
<if test="rebound != null">#{rebound},</if>
<if test="crux != null">#{crux},</if>
<if test="position != null">#{position},</if>
<if test="sleepTime != null">#{sleepTime},</if>
<if test="getupTime != null">#{getupTime},</if>
<if test="connectTime != null">#{connectTime},</if>
<if test="remarks != null">#{remarks},</if>
<if test="bloodData != null">#{bloodData},</if>
<if test="moistureDate != null">#{moistureDate},</if>
<if test="vocation != null">#{vocation},</if>
<if test="night != null">#{night},</if>
<if test="experience != null">#{experience},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateSysCustomerPhysicalSigns" parameterType="SysCustomerPhysicalSigns">
update sys_customer_physical_signs
<trim prefix="SET" suffixOverrides=",">
<if test="customerId != null">customer_id = #{customerId},</if>
<if test="sex != null">sex = #{sex},</if>
<if test="age != null">age = #{age},</if>
<if test="tall != null">tall = #{tall},</if>
<if test="weight != null">weight = #{weight},</if>
<if test="physicalSignsId != null">physical_signs_id = #{physicalSignsId},</if>
<if test="dishesIngredientId != null">dishes_ingredient_id = #{dishesIngredientId},</if>
<if test="photo != null">photo = #{photo},</if>
<if test="constipation != null">constipation = #{constipation},</if>
<if test="staylate != null">stayLate = #{staylate},</if>
<if test="motion != null">motion = #{motion},</if>
<if test="makeFoodType != null">make_food_type = #{makeFoodType},</if>
<if test="makeFoodTaste != null">make_food_taste = #{makeFoodTaste},</if>
<if test="walk != null">walk = #{walk},</if>
<if test="difficulty != null">difficulty = #{difficulty},</if>
<if test="weakness != null">weakness = #{weakness},</if>
<if test="rebound != null">rebound = #{rebound},</if>
<if test="crux != null">crux = #{crux},</if>
<if test="position != null">position = #{position},</if>
<if test="sleepTime != null">sleep_time = #{sleepTime},</if>
<if test="getupTime != null">getup_time = #{getupTime},</if>
<if test="connectTime != null">connect_time = #{connectTime},</if>
<if test="remarks != null">remarks = #{remarks},</if>
<if test="bloodData != null">blood_data = #{bloodData},</if>
<if test="moistureDate != null">moisture_date = #{moistureDate},</if>
<if test="vocation != null">vocation = #{vocation},</if>
<if test="night != null">night = #{night},</if>
<if test="experience != null">experience = #{experience},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysCustomerPhysicalSignsById" parameterType="Long">
delete from sys_customer_physical_signs where id = #{id}
</delete>
<delete id="deleteSysCustomerPhysicalSignsByIds" parameterType="String">
delete from sys_customer_physical_signs where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 根据客户id更新体征信息 -->
<update id="updateSysCustomerPhysicalSignsByCustomerId" parameterType="SysCustomerPhysicalSigns">
update sys_customer_physical_signs
<trim prefix="SET" suffixOverrides=",">
<if test="sex != null">sex = #{sex},</if>
<if test="age != null">age = #{age},</if>
<if test="tall != null">tall = #{tall},</if>
<if test="weight != null">weight = #{weight},</if>
<if test="physicalSignsId != null">physical_signs_id = #{physicalSignsId},</if>
<if test="dishesIngredientId != null">dishes_ingredient_id = #{dishesIngredientId},</if>
<if test="photo != null">photo = #{photo},</if>
<if test="constipation != null">constipation = #{constipation},</if>
<if test="staylate != null">stayLate = #{staylate},</if>
<if test="motion != null">motion = #{motion},</if>
<if test="makeFoodType != null">make_food_type = #{makeFoodType},</if>
<if test="makeFoodTaste != null">make_food_taste = #{makeFoodTaste},</if>
<if test="walk != null">walk = #{walk},</if>
<if test="difficulty != null">difficulty = #{difficulty},</if>
<if test="weakness != null">weakness = #{weakness},</if>
<if test="rebound != null">rebound = #{rebound},</if>
<if test="crux != null">crux = #{crux},</if>
<if test="position != null">position = #{position},</if>
<if test="sleepTime != null">sleep_time = #{sleepTime},</if>
<if test="getupTime != null">getup_time = #{getupTime},</if>
<if test="connectTime != null">connect_time = #{connectTime},</if>
<if test="remarks != null">remarks = #{remarks},</if>
<if test="bloodData != null">blood_data = #{bloodData},</if>
<if test="moistureDate != null">moisture_date = #{moistureDate},</if>
<if test="vocation != null">vocation = #{vocation},</if>
<if test="night != null">night = #{night},</if>
<if test="experience != null">experience = #{experience},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where customer_id = #{customerId}
</update>
<delete id="deleteSysCustomerPhysicalSignsByCustomerIds" parameterType="String">
delete from sys_customer_physical_signs where customer_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>