Merge branch 'master' of gitee.com:darlk/ShengTangManage

This commit is contained in:
huangdeliang
2021-01-28 15:54:24 +08:00
8 changed files with 288 additions and 87 deletions

View File

@ -5,6 +5,8 @@ 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_healthy
*
@ -410,6 +412,24 @@ public class SysCustomerHealthy extends BaseEntity
@Excel(name = "饮食习惯")
private Long makeFoodType;
/** 客户病史体征id使用隔开 */
//@Excel(name = "客户病史体征id使用隔开")
private String physicalSignsId;
/** 体征对象集合 **/
private List<SysPhysicalSigns> signList;
/** 其他病史体征 **/
private String otherPhysicalSigns;
/** 气血数据 */
@Excel(name = "气血数据")
private String bloodData;
/** 湿气数据 */
@Excel(name = "湿气数据")
private String moistureDate;
/** 删除标识 0未删除 1已删除。默认0 */
private Long delFlag;
@ -1301,6 +1321,46 @@ public class SysCustomerHealthy extends BaseEntity
this.tall = tall;
}
public String getPhysicalSignsId() {
return physicalSignsId;
}
public void setPhysicalSignsId(String physicalSignsId) {
this.physicalSignsId = physicalSignsId;
}
public List<SysPhysicalSigns> getSignList() {
return signList;
}
public void setSignList(List<SysPhysicalSigns> signList) {
this.signList = signList;
}
public String getOtherPhysicalSigns() {
return otherPhysicalSigns;
}
public void setOtherPhysicalSigns(String otherPhysicalSigns) {
this.otherPhysicalSigns = otherPhysicalSigns;
}
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;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -600,4 +600,12 @@ public class SysOrder extends BaseEntity {
public void setConditioningProject(String conditioningProject) {
this.conditioningProject = conditioningProject;
}
public Integer getAmountFlag() {
return amountFlag;
}
public void setAmountFlag(Integer amountFlag) {
this.amountFlag = amountFlag;
}
}

View File

@ -107,16 +107,23 @@
<result property="crux" column="crux" />
<result property="dishesIngredient" column="dishes_ingredient" />
<result property="makeFoodType" column="make_food_type" />
<result property="physicalSignsId" column="physical_signs_id" />
<result property="otherPhysicalSigns" column="other_physical_signs" />
<result property="bloodData" column="blood_data" />
<result property="moistureDate" column="moisture_date" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="delFlag" column="del_flag" />
<!-- column是传的参数, select是调用的查询 -->
<association property="signList" column="physical_signs_id" select="getSignByIds"/>
</resultMap>
<sql id="selectSysCustomerHealthyVo">
select sch.id, customer_id, conditioning_project_id, sex, age, weight, tall, condiment, other_condiment, cooking_style, cooking_style_rate, wash_vegetables_style, other_wash_vegetables_style, breakfast_type, breakfast_food, lunch_type, dinner, vegetable_rate, common_meat, dinner_time, supper_num, supper_food, diet_hot_and_cold, diet_flavor, vegetables_num, vegetables_rate_type, fruits_num, fruits_time, fruits_rate, rice_num, rice_full, eating_speed, snacks, other_snacks, health_products_flag, health_products_brand, health_products_name, health_products_week_rate, health_products_day_rate, water_num, water_type, water_habit, drinks_num, drink_wine_flag, drink_wine_classify, other_wine_classify, drink_wine_amount, smoke_flag, smoke_rate, second_smoke, work_industry, work_type, defecation_num, other_defecation_num, defecation_time, defecation_shape, defecation_smell, defecation_speed, defecation_color, motion_num, motion_duration, motion_time, aerobic_motion_classify, anaerobic_motion_classify, anaerobic_aerobic_motion_classify, other_motion_classify, motion_field, other_motion_field, sleep_time, sleep_quality, sleep_drug_flag, sleep_drug, stayup_late_flag, stayup_late_week_num, family_illness_history, other_family_illness_history, operation_history, other_operation_history, near_operation_flag, recoverye_situation, long_eat_drug_flag, long_eat_drug_classify, other_long_eat_drug_classify, allergy_flag, allergy_situation, allergen, other_allergen, medical_report, medical_report_name,
position,experience,rebound,difficulty,crux,dishes_ingredient,make_food_type,sch.create_time, sch.create_by,sch. update_time, sch.update_by, sch.del_flag
position,experience,rebound,difficulty,crux,dishes_ingredient,make_food_type,physical_signs_id,other_physical_signs,blood_data,moisture_date,
sch.create_time, sch.create_by,sch. update_time, sch.update_by, sch.del_flag
</sql>
<select id="selectSysCustomerHealthyList" parameterType="SysCustomerHealthy" resultMap="SysCustomerHealthyResult">
@ -137,6 +144,7 @@
from sys_customer_healthy as sch
left join sys_customer sc on sc.id = sch.customer_id
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON cp.dict_value = sch.conditioning_project_id
where sch.del_flag = 0 and sc.del_flag = 0 and sch.id = #{id}
</select>
@ -239,6 +247,10 @@
<if test="crux != null">crux,</if>
<if test="dishesIngredient != null">dishes_ingredient,</if>
<if test="makeFoodType != null">make_food_type,</if>
<if test="physicalSignsId != null">physical_signs_id,</if>
<if test="otherPhysicalSigns != null">other_physical_signs,</if>
<if test="bloodData != null">blood_data,</if>
<if test="moistureDate != null">moisture_date,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
@ -342,6 +354,10 @@
<if test="crux != null">#{crux},</if>
<if test="dishesIngredient != null">#{dishesIngredient},</if>
<if test="makeFoodType != null">#{makeFoodType},</if>
<if test="physicalSignsId != null">#{physicalSignsId},</if>
<if test="otherPhysicalSigns != null">#{otherPhysicalSigns},</if>
<if test="bloodData != null">#{bloodData},</if>
<if test="moistureDate != null">#{moistureDate},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
@ -448,6 +464,10 @@
<if test="crux != null">crux = #{crux},</if>
<if test="dishesIngredient != null">dishes_ingredient = #{dishesIngredient},</if>
<if test="makeFoodType != null">make_food_type = #{makeFoodType},</if>
<if test="physicalSignsId != null">physical_signs_id = #{physicalSignsId},</if>
<if test="otherPhysicalSigns != null">other_physical_signs = #{otherPhysicalSigns},</if>
<if test="bloodData != null">blood_data = #{bloodData},</if>
<if test="moistureDate != null">moisture_date = #{moistureDate},</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>
@ -468,6 +488,11 @@
</foreach>
</update>
<!-- 根据体征id获取体征 -->
<select id="getSignByIds" parameterType="String" resultType="SysPhysicalSigns">
select * from sys_physical_signs sps where FIND_IN_SET(id, #{physical_signs_id})
</select>
<!-- 根据手机号查询客户健康评估信息 -->
<select id="selectSysCustomerHealthyByPhone" parameterType="String" resultMap="SysCustomerHealthyResult">
<include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone from sys_customer_healthy as sch

View File

@ -61,9 +61,11 @@
SELECT SUM(amount) FROM sys_order
<where>
<if test="orderId != null and orderId != ''">and order_id = #{orderId}</if>
<if test="customer != null and customer != ''">and customer = #{customer}</if>
<if test="customer != null and customer != ''">
and (customer like concat('%',#{customer},'%') or phone like concat('%',#{customer},'%'))
</if>
<if test="cusId != null and cusId != ''">and cus_id = #{cusId}</if>
<if test="phone != null and phone != ''">and phone = #{phone}</if>
<!-- <if test="phone != null and phone != ''">and phone = #{phone}</if>-->
<if test="status != null ">and status = #{status}</if>
<if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if>
<if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if>
@ -80,7 +82,14 @@
<if test="endTime != null and endTime != ''">and date_format(order_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')</if>
<if test="serveTimeId != null ">and serve_time_id = #{serveTimeId}</if>
<if test="reviewStatus != null ">and review_status = #{reviewStatus}</if>
<if test="serveTimeId != null ">and serve_time_id = #{serveTimeId}</if>
<if test="amountFlag != null">
<if test="amountFlag == 0">
and amount >= 0
</if>
<if test="amountFlag == 1">
and 0 > amount
</if>
</if>
</where>
</select>
@ -88,9 +97,11 @@
<include refid="selectSysOrderVo"/>
<where>
<if test="orderId != null and orderId != ''">and order_id = #{orderId}</if>
<if test="customer != null and customer != ''">and customer = #{customer}</if>
<if test="cusId != null and cusId != ''">and cus_id = #{cusId}</if>
<if test="phone != null and phone != ''">and phone = #{phone}</if>
<if test="customer != null and customer != ''">
and (customer like concat('%',#{customer},'%') or phone like concat('%',#{customer},'%'))
</if>
<if test="cusId != null and cusId != ''">and cus_id = #{cusId}</if>
<!--<if test="phone != null and phone != ''">and phone = #{phone}</if>-->
<if test="status != null ">and status = #{status}</if>
<if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if>
<if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if>
@ -107,6 +118,14 @@
<if test="endTime != null and endTime != ''">and date_format(order_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')</if>
<if test="serveTimeId != null ">and serve_time_id = #{serveTimeId}</if>
<if test="reviewStatus != null ">and review_status = #{reviewStatus}</if>
<if test="amountFlag != null">
<if test="amountFlag == 0">
and amount >= 0
</if>
<if test="amountFlag == 1">
and 0 > amount
</if>
</if>
</where>
order by order_time desc
</select>