客户体征优化、客户健康修改

This commit is contained in:
xiezhijun
2021-01-25 16:13:32 +08:00
parent 789f835f72
commit bc63f7bbf4
24 changed files with 1216 additions and 519 deletions

View File

@ -26,62 +26,6 @@
<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" />
<result property="comments" column="comments"/>
<!-- 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>
@ -184,38 +128,6 @@
where phone = #{phone} and del_flag = 0
</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 and scps.del_flag = 0
</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, scps.comments
</sql>
<select id="selectSysCustomerAndSignList" parameterType="SysCustomer" resultMap="SysCustomerSignResult">
<include refid="selectSysCustomerAndSign"/> where sc.del_flag = 0
<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>
order by sc.create_time 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>
<!-- 根据手机号查询体征 -->
<select id="selectSysCustomerAndSignByPhone" parameterType="String" resultMap="SysCustomerSignResult">
<include refid="selectSysCustomerAndSign"/> where sc.del_flag = 0 and sc.phone = #{phone} limit 1
</select>
</mapper>