客户体征优化、客户健康修改
This commit is contained in:
@ -4,9 +4,13 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.stdiet.custom.mapper.SysCustomerPhysicalSignsMapper">
|
||||
|
||||
<resultMap type="SysCustomerPhysicalSigns" id="SysCustomerPhysicalSignsResult">
|
||||
<resultMap type="SysCustomerPhysicalSigns" id="SysCustomerSignResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="customerId" column="customer_id" />
|
||||
<!-- 非持久化字段 -->
|
||||
<result property="name" column="name"/>
|
||||
<!-- 非持久化字段 -->
|
||||
<result property="phone" column="phone" />
|
||||
<result property="sex" column="sex" />
|
||||
<result property="age" column="age" />
|
||||
<result property="tall" column="tall" />
|
||||
@ -39,48 +43,28 @@
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="comments" column="comments"/>
|
||||
<!-- column是传的参数, select是调用的查询 -->
|
||||
<association property="signList" column="physical_signs_id" select="getSignByIds"/>
|
||||
</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, comments, create_time, create_by, update_time, update_by from sys_customer_physical_signs
|
||||
<sql id="selectSysCustomerPhysicalSigns">
|
||||
select scps.id,scps.customer_id,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, scps.create_time, sc.name, sc.phone
|
||||
from sys_customer_physical_signs scps
|
||||
left join sys_customer sc on scps.customer_id = sc.id
|
||||
</sql>
|
||||
|
||||
<select id="selectSysCustomerPhysicalSignsList" parameterType="SysCustomerPhysicalSigns" resultMap="SysCustomerPhysicalSignsResult">
|
||||
<include refid="selectSysCustomerPhysicalSignsVo"/> where del_flag = 0
|
||||
<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>
|
||||
<select id="selectSysCustomerAndSignList" parameterType="SysCustomerPhysicalSigns" resultMap="SysCustomerSignResult">
|
||||
<include refid="selectSysCustomerPhysicalSigns"/> where scps.del_flag = 0 and sc.del_flag = 0
|
||||
<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 scps.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectSysCustomerPhysicalSignsById" parameterType="Long" resultMap="SysCustomerPhysicalSignsResult">
|
||||
<include refid="selectSysCustomerPhysicalSignsVo"/>
|
||||
where id = #{id} and del_flag = 0
|
||||
<select id="selectSysCustomerPhysicalSignsById" parameterType="Long" resultMap="SysCustomerSignResult">
|
||||
<include refid="selectSysCustomerPhysicalSigns"/> where scps.del_flag = 0 and sc.del_flag = 0 and scps.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysCustomerPhysicalSigns" parameterType="SysCustomerPhysicalSigns" useGeneratedKeys="true" keyProperty="id">
|
||||
@ -198,61 +182,24 @@
|
||||
</update>
|
||||
|
||||
<update id="deleteSysCustomerPhysicalSignsById" parameterType="Long">
|
||||
update sys_customer_physical_signs set del_flag = 0 where id = #{id}
|
||||
update sys_customer_physical_signs set del_flag = 1 where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysCustomerPhysicalSignsByIds" parameterType="String">
|
||||
update sys_customer_physical_signs set del_flag = 0 where id in
|
||||
update sys_customer_physical_signs set del_flag = 1 where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 根据客户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="comments != null">comments = #{comments},</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>
|
||||
<!-- 根据体征id获取体征 -->
|
||||
<select id="getSignByIds" parameterType="String" resultType="SysPhysicalSigns">
|
||||
select * from sys_physical_signs sps where FIND_IN_SET(id, #{physical_signs_id})
|
||||
</select>
|
||||
|
||||
<update id="deleteSysCustomerPhysicalSignsByCustomerIds" parameterType="String">
|
||||
update sys_customer_physical_signs set del_flag = 0 where customer_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
<!-- 根据手机号查询体征 -->
|
||||
<select id="selectSysCustomerAndSignByPhone" parameterType="String" resultMap="SysCustomerSignResult">
|
||||
<include refid="selectSysCustomerPhysicalSigns"/> where scps.del_flag = 0 and sc.del_flag = 0 and sc.phone = #{phone} limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user