客户体征优化、客户健康修改
This commit is contained in:
@ -7,6 +7,10 @@
|
||||
<resultMap type="SysCustomerHealthy" id="SysCustomerHealthyResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="customerId" column="customer_id" />
|
||||
<!-- 非持久化字段 -->
|
||||
<result property="name" column="name"></result>
|
||||
<!-- 非持久化字段 -->
|
||||
<result property="phone" column="phone"></result>
|
||||
<result property="conditioningProjectId" column="conditioning_project_id" />
|
||||
<result property="sex" column="sex" />
|
||||
<result property="age" column="age" />
|
||||
@ -99,19 +103,22 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysCustomerHealthyVo">
|
||||
select id, customer_id, conditioning_project_id, sex, age, 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, create_time, create_by, update_time, update_by, del_flag from sys_customer_healthy
|
||||
select sch.id, customer_id, conditioning_project_id, sex, age, 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, sch.create_time, sch.create_by,sch. update_time, sch.update_by, sch.del_flag
|
||||
</sql>
|
||||
|
||||
<select id="selectSysCustomerHealthyList" parameterType="SysCustomerHealthy" resultMap="SysCustomerHealthyResult">
|
||||
<include refid="selectSysCustomerHealthyVo"/>
|
||||
<where>
|
||||
<if test="conditioningProjectId != null "> and conditioning_project_id = #{conditioningProjectId}</if>
|
||||
</where>
|
||||
<include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone
|
||||
from sys_customer_healthy as sch
|
||||
left join sys_customer sc on sc.id = sch.customer_id
|
||||
where sch.del_flag = 0 and sc.del_flag = 0
|
||||
<if test="conditioningProjectId != null "> and sch.conditioning_project_id = #{conditioningProjectId}</if>
|
||||
</select>
|
||||
|
||||
<select id="selectSysCustomerHealthyById" parameterType="Long" resultMap="SysCustomerHealthyResult">
|
||||
<include refid="selectSysCustomerHealthyVo"/>
|
||||
where id = #{id}
|
||||
<include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone
|
||||
from sys_customer_healthy as sch
|
||||
left join sys_customer sc on sc.id = sch.customer_id
|
||||
where sch.del_flag = 0 and sc.del_flag = 0 and sch.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysCustomerHealthy" parameterType="SysCustomerHealthy">
|
||||
@ -401,15 +408,23 @@
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysCustomerHealthyById" parameterType="Long">
|
||||
delete from sys_customer_healthy where id = #{id}
|
||||
</delete>
|
||||
<update id="deleteSysCustomerHealthyById" parameterType="Long">
|
||||
update sys_customer_healthy set del_flag = 1 where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysCustomerHealthyByIds" parameterType="String">
|
||||
delete from sys_customer_healthy where id in
|
||||
<update id="deleteSysCustomerHealthyByIds" parameterType="String">
|
||||
update sys_customer_healthy set del_flag = 1 where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</update>
|
||||
|
||||
<!-- 根据手机号查询客户健康评估信息 -->
|
||||
<select id="selectSysCustomerHealthyByPhone" parameterType="String" resultMap="SysCustomerHealthyResult">
|
||||
<include refid="selectSysCustomerHealthyVo"/>,sc.name,sc.phone from sys_customer_healthy as sch
|
||||
left join sys_customer sc on sc.id = sch.customer_id
|
||||
where sch.del_flag = 0 and sc.del_flag = 0 and sc.phone = #{phone} limit 1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user