You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
438 lines
12 KiB
438 lines
12 KiB
<?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.acupuncture.system.persist.dao.ExternalDao">
|
|
<select id="select" resultType="com.acupuncture.system.domain.vo.ExternalVo$Result"
|
|
parameterType="com.acupuncture.system.domain.dto.ExternalDto$Query">
|
|
select
|
|
t.visit_number as memberid,
|
|
t.name as name,
|
|
t.gender as sex,
|
|
t.birth_date as birthYear,
|
|
t.phone as phone,
|
|
t.tenant_id as gid
|
|
from
|
|
pms_treatment t
|
|
left join
|
|
pms_patient p on t.patient_id = p.id
|
|
<where>
|
|
t.del_flag = 0
|
|
<if test="query.memberid != null and query.memberid != ''">
|
|
and t.visit_number = #{query.memberid}
|
|
</if>
|
|
<if test="query.from != null and query.from != ''">
|
|
and t.tenant_id = #{query.from}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectByMemberId" resultType="com.acupuncture.system.domain.vo.ExternalVo$Result"
|
|
parameterType="com.acupuncture.system.domain.dto.ExternalDto$Query">
|
|
select
|
|
t.member_id as memberid,
|
|
t.name as name,
|
|
t.gender as sex,
|
|
t.birth_date as birthYear,
|
|
t.phone as phone,
|
|
t.tenant_id as gid
|
|
from
|
|
pms_treatment t
|
|
left join
|
|
pms_patient p on t.patient_id = p.id
|
|
<where>
|
|
t.del_flag = 0
|
|
<if test="query.memberid != null and query.memberid != ''">
|
|
and t.member_id = #{query.memberid}
|
|
</if>
|
|
<if test="query.from != null and query.from != ''">
|
|
and t.tenant_id = #{query.from}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="motionQueryMember" resultType="com.acupuncture.system.domain.vo.ExternalVo$UserInfo">
|
|
select
|
|
t.member_id as UID,
|
|
t.name as Name,
|
|
t.gender as Sex,
|
|
t.birth_date as BirthYear,
|
|
t.phone as Phone,
|
|
t.tenant_id as GID
|
|
from
|
|
v_pms_treatment t
|
|
<where>
|
|
t.del_flag = 0
|
|
<if test="memberid != null and memberid != ''">
|
|
and t.member_id = #{memberid}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<insert id="motionAdd" parameterType="com.acupuncture.system.domain.dto.ExternalDto$RtcfInfo">
|
|
insert into
|
|
fit_test_main
|
|
(
|
|
TestID,
|
|
Title,
|
|
UUID,
|
|
UID,
|
|
TestDate,
|
|
Name,
|
|
Sex,
|
|
BirthYear
|
|
)
|
|
values
|
|
(
|
|
#{rtcfInfoDto.TestID},
|
|
#{rtcfInfoDto.title},
|
|
#{rtcfInfoDto.UUID},
|
|
#{rtcfInfoDto.UID},
|
|
#{rtcfInfoDto.testDate},
|
|
#{rtcfInfoDto.Name},
|
|
#{rtcfInfoDto.Sex},
|
|
#{rtcfInfoDto.BirthYear}
|
|
)
|
|
</insert>
|
|
|
|
<select id="motionQueryMemberInfo" resultType="com.acupuncture.system.domain.vo.ExternalVo$UserInfo">
|
|
select
|
|
t.UID as UID,
|
|
t.Name as Name,
|
|
TestID as TestID
|
|
from
|
|
fit_test_main t
|
|
<where>
|
|
<if test="memberid != null and memberid != ''">
|
|
and t.UID = #{memberid}
|
|
</if>
|
|
<!-- <if test="testData != null">-->
|
|
<!-- and t.TestDate = #{testData}-->
|
|
<!-- </if>-->
|
|
<if test="Title != null">
|
|
and t.Title = #{Title}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<insert id="motionAddDetail" parameterType="java.util.List">
|
|
INSERT INTO fit_test_data (TestID, ItemCode, TestValue, Score)
|
|
VALUES
|
|
<foreach collection="list" item="item" separator=",">
|
|
(#{item.TestID}, #{item.Item}, #{item.Value}, #{item.Score})
|
|
</foreach>
|
|
</insert>
|
|
|
|
<insert id="motionAddAdvice" parameterType="com.acupuncture.system.domain.dto.ExternalDto$RtcfInfo$Advice">
|
|
insert into
|
|
fit_test_advice
|
|
(
|
|
TestID,
|
|
SportPrinciple,
|
|
Aerobic,
|
|
Strength,
|
|
Flexibility,
|
|
FunctionExcercise,
|
|
Caution
|
|
)
|
|
values
|
|
(
|
|
#{dto.TestID},
|
|
#{dto.SportPrinciple},
|
|
#{dto.Aerobic},
|
|
#{dto.Strength},
|
|
#{dto.Flexibility},
|
|
#{dto.FunctionExcercise},
|
|
#{dto.Caution}
|
|
)
|
|
</insert>
|
|
|
|
<insert id="motionAddTcf" parameterType="com.acupuncture.system.domain.dto.ExternalDto$BcaData$Data">
|
|
insert into fit_test_records
|
|
(
|
|
TestID,
|
|
UUID,
|
|
UID,
|
|
TestDate,
|
|
Name,
|
|
Sex,
|
|
Weight,
|
|
Fat,
|
|
Bone,
|
|
Protein,
|
|
Water,
|
|
Muscle,
|
|
SMM,
|
|
PBF,
|
|
BMI,
|
|
BMR,
|
|
Edema,
|
|
VFI,
|
|
BodyAge,
|
|
Score,
|
|
BodyType,
|
|
Standard_weight,
|
|
Weight_control,
|
|
Fat_control,
|
|
Muscle_control,
|
|
ASMI,
|
|
WeightMax,
|
|
WeightMin,
|
|
FatMax,
|
|
FatMin,
|
|
BoneMax,
|
|
BoneMin,
|
|
ProteinMax,
|
|
ProteinMin,
|
|
WaterMax,
|
|
WaterMin,
|
|
MuscleMax,
|
|
MuscleMin,
|
|
SMMMax,
|
|
SMMMin,
|
|
PBFMax,
|
|
PBFMin,
|
|
BMIMax,
|
|
BMIMin,
|
|
WHRMax,
|
|
WHRMin,
|
|
EdemaMax,
|
|
EdemaMin,
|
|
VFIMax,
|
|
VFIMin,
|
|
Diagnosis)
|
|
values (
|
|
#{dto.TestID},
|
|
#{dto.UUID},
|
|
#{dto.UID},
|
|
#{dto.TestDate},
|
|
#{dto.Name},
|
|
#{dto.Sex},
|
|
#{dto.Weight},
|
|
#{dto.Fat},
|
|
#{dto.Bone},
|
|
#{dto.Protein},
|
|
#{dto.Water},
|
|
#{dto.Muscle},
|
|
#{dto.SMM},
|
|
#{dto.PBF},
|
|
#{dto.BMI},
|
|
#{dto.BMR},
|
|
#{dto.Edema},
|
|
#{dto.VFI},
|
|
#{dto.BodyAge},
|
|
#{dto.Score},
|
|
#{dto.BodyType},
|
|
#{dto.Standard_weight},
|
|
#{dto.Weight_control},
|
|
#{dto.Fat_control},
|
|
#{dto.Muscle_control},
|
|
#{dto.ASMI},
|
|
#{dto.WeightMax},
|
|
#{dto.WeightMin},
|
|
#{dto.FatMax},
|
|
#{dto.FatMin},
|
|
#{dto.BoneMax},
|
|
#{dto.BoneMin},
|
|
#{dto.ProteinMax},
|
|
#{dto.ProteinMin},
|
|
#{dto.WaterMax},
|
|
#{dto.WaterMin},
|
|
#{dto.MuscleMax},
|
|
#{dto.MuscleMin},
|
|
#{dto.SMMMax},
|
|
#{dto.SMMMin},
|
|
#{dto.PBFMax},
|
|
#{dto.PBFMin},
|
|
#{dto.BMIMax},
|
|
#{dto.BMIMin},
|
|
#{dto.WHRMax},
|
|
#{dto.WHRMin},
|
|
#{dto.EdemaMax},
|
|
#{dto.EdemaMin},
|
|
#{dto.VFIMax},
|
|
#{dto.VFIMin},
|
|
#{dto.Diagnosis}
|
|
)
|
|
</insert>
|
|
|
|
<insert id="motionAddTcfMain" parameterType="com.acupuncture.system.domain.dto.ExternalDto$RtcfInfo">
|
|
insert into
|
|
fit_test_main
|
|
(
|
|
TestID,
|
|
Title,
|
|
UUID,
|
|
UID,
|
|
TestDate,
|
|
Name,
|
|
Sex
|
|
)
|
|
values
|
|
(
|
|
#{dto.TestID},
|
|
#{dto.title},
|
|
#{dto.UUID},
|
|
#{dto.UID},
|
|
#{dto.testDate},
|
|
#{dto.Name},
|
|
#{dto.Sex}
|
|
)
|
|
</insert>
|
|
|
|
<insert id="motionAddTcfAdvice" parameterType="com.acupuncture.system.domain.dto.ExternalDto$BcaData$Advice">
|
|
insert into fit_bca_advice(TestID,
|
|
PersonType,
|
|
DailyEnergy,
|
|
DietPrinciple,
|
|
StandardBreakfast,
|
|
StandardLunch,
|
|
StandardDinner,
|
|
StandardNutrition)
|
|
values ( #{dto.TestID},
|
|
#{dto.PersonType},
|
|
#{dto.DailyEnergy},
|
|
#{dto.DietPrinciple},
|
|
#{dto.StandardBreakfast},
|
|
#{dto.StandardLunch},
|
|
#{dto.StandardDinner},
|
|
#{dto.StandardNutrition})
|
|
</insert>
|
|
|
|
<delete id="delMain" >
|
|
delete from fit_test_main where UID = #{uId} and Title = #{Title}
|
|
</delete>
|
|
|
|
<delete id="delAdvice">
|
|
delete from fit_test_advice where TestID = #{TestID}
|
|
</delete>
|
|
|
|
<delete id="delData">
|
|
delete from fit_test_data where TestID = #{TestID}
|
|
</delete>
|
|
|
|
<delete id="delRecord">
|
|
delete from fit_test_records where TestID = #{TestID}
|
|
</delete>
|
|
|
|
<delete id="delBcaAdvice">
|
|
delete from fit_bca_advice where TestID = #{TestID}
|
|
</delete>
|
|
|
|
<select id="queryMotionInfo" resultType="com.acupuncture.system.domain.vo.ExternalVo$RtcfInfo">
|
|
select TestID,
|
|
UID,
|
|
TestDate,
|
|
Name,
|
|
Sex,
|
|
UUID
|
|
from fit_test_main
|
|
where UID = #{memberid}
|
|
and Title = #{Title}
|
|
order by TestDate desc limit 1
|
|
</select>
|
|
|
|
<select id="queryMotionDetail" resultType="com.acupuncture.system.domain.vo.ExternalVo$RtcfInfo$Detail">
|
|
select TestID,
|
|
ItemCode as Item,
|
|
TestValue as Value,
|
|
Score
|
|
from fit_test_data
|
|
where TestID = #{TestID}
|
|
</select>
|
|
|
|
<select id="queryMotionAdvice" resultType="com.acupuncture.system.domain.vo.ExternalVo$RtcfInfo$Advice">
|
|
select TestID,
|
|
PersonType,
|
|
DailyEnergy,
|
|
DietPrinciple,
|
|
StandardBreakfast,
|
|
StandardLunch,
|
|
StandardDinner,
|
|
StandardNutrition
|
|
from fit_bca_advice
|
|
where TestID = #{TestID}
|
|
</select>
|
|
|
|
<select id="queryMotionTcfInfo" resultType="com.acupuncture.system.domain.vo.ExternalVo$BcaData">
|
|
select TestID,
|
|
UID,
|
|
TestDate,
|
|
Name,
|
|
Sex,
|
|
UUID
|
|
from fit_test_main
|
|
where UID = #{memberid}
|
|
and Title = #{Title}
|
|
order by TestDate desc limit 1
|
|
</select>
|
|
|
|
<select id="queryMotionTcfData" resultType="com.acupuncture.system.domain.vo.ExternalVo$BcaData$Data">
|
|
select
|
|
TestID,
|
|
UUID,
|
|
UID,
|
|
TestDate,
|
|
Name,
|
|
Sex,
|
|
Weight,
|
|
Fat,
|
|
Bone,
|
|
Protein,
|
|
Water,
|
|
Muscle,
|
|
SMM,
|
|
PBF,
|
|
BMI,
|
|
BMR,
|
|
Edema,
|
|
VFI,
|
|
BodyAge,
|
|
Score,
|
|
BodyType,
|
|
Standard_weight,
|
|
Weight_control,
|
|
Fat_control,
|
|
Muscle_control,
|
|
ASMI,
|
|
WeightMax,
|
|
WeightMin,
|
|
FatMax,
|
|
FatMin,
|
|
BoneMax,
|
|
BoneMin,
|
|
ProteinMax,
|
|
ProteinMin,
|
|
WaterMax,
|
|
WaterMin,
|
|
MuscleMax,
|
|
MuscleMin,
|
|
SMMMax,
|
|
SMMMin,
|
|
PBFMax,
|
|
PBFMin,
|
|
BMIMax,
|
|
BMIMin,
|
|
WHRMax,
|
|
WHRMin,
|
|
EdemaMax,
|
|
EdemaMin,
|
|
VFIMax,
|
|
VFIMin,
|
|
Diagnosis
|
|
from fit_test_records
|
|
where TestID = #{TestID}
|
|
</select>
|
|
|
|
<select id="queryMotionTcfAdvice" resultType="com.acupuncture.system.domain.vo.ExternalVo$BcaData$Advice">
|
|
select TestID,
|
|
PersonType,
|
|
DailyEnergy,
|
|
DietPrinciple,
|
|
StandardBreakfast,
|
|
StandardLunch,
|
|
StandardDinner,
|
|
StandardNutrition
|
|
from fit_bca_advice
|
|
where TestID = #{TestID}
|
|
</select>
|
|
|
|
</mapper>
|
|
|