fix: 修改包名,模块名。

This commit is contained in:
tianyongbao
2025-01-15 22:06:44 +08:00
parent 47ca61ec9e
commit 96f4c874d9
874 changed files with 3328 additions and 5344 deletions

View File

@@ -0,0 +1,145 @@
<?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.intc.health.mapper.HealthActivityMapper">
<resultMap type="HealthActivityVo" id="HealthActivityResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="type" column="type" />
<result property="place" column="place" />
<result property="activityVolume" column="activity_volume" />
<result property="exerciseTime" column="exercise_time" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="harvest" column="harvest" />
<result property="foods" column="foods" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="totalCost" column="total_cost" />
<result property="partner" column="partner" />
<result property="costDetail" column="cost_detail" />
</resultMap>
<sql id="selectHealthActivityVo">
select a.id, a.name, a.type, a.place, a.activity_volume, a.exercise_time, a.start_time, a.end_time, a.harvest, a.foods, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark, a.total_cost, a.partner, a.cost_detail from health_activity a
</sql>
<select id="selectHealthActivityList" parameterType="HealthActivityDto" resultMap="HealthActivityResult">
<include refid="selectHealthActivityVo"/>
<where>
a.del_flag='0'
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
<if test="type != null and type != ''"> and a.type = #{type}</if>
<if test="place != null and place != ''"> and a.place = #{place}</if>
<if test="activityVolume != null and activityVolume != ''"> and a.activity_volume = #{activityVolume}</if>
<if test="startTime != null "> and a.start_time = #{startTime}</if>
<if test="endTime != null "> and a.end_time = #{endTime}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
order by a.create_time desc
</select>
<select id="selectHealthActivityById" parameterType="Long" resultMap="HealthActivityResult">
<include refid="selectHealthActivityVo"/>
where a.id = #{id}
</select>
<insert id="insertHealthActivity" parameterType="HealthActivity">
insert into health_activity
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null">name,</if>
<if test="type != null">type,</if>
<if test="place != null">place,</if>
<if test="activityVolume != null">activity_volume,</if>
<if test="exerciseTime != null">exercise_time,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="harvest != null">harvest,</if>
<if test="foods != null">foods,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="totalCost != null">total_cost,</if>
<if test="partner != null">partner,</if>
<if test="costDetail != null">cost_detail,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null">#{name},</if>
<if test="type != null">#{type},</if>
<if test="place != null">#{place},</if>
<if test="activityVolume != null">#{activityVolume},</if>
<if test="exerciseTime != null">#{exerciseTime},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="harvest != null">#{harvest},</if>
<if test="foods != null">#{foods},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="totalCost != null">#{totalCost},</if>
<if test="partner != null">#{partner},</if>
<if test="costDetail != null">#{costDetail},</if>
</trim>
</insert>
<update id="updateHealthActivity" parameterType="HealthActivity">
update health_activity
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="type != null">type = #{type},</if>
<if test="place != null">place = #{place},</if>
<if test="activityVolume != null">activity_volume = #{activityVolume},</if>
<if test="exerciseTime != null">exercise_time = #{exerciseTime},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="harvest != null">harvest = #{harvest},</if>
<if test="foods != null">foods = #{foods},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="totalCost != null">total_cost = #{totalCost},</if>
<if test="partner != null">partner = #{partner},</if>
<if test="costDetail != null">cost_detail = #{costDetail},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthActivityById" parameterType="Long">
delete from health_activity where id = #{id}
</delete>
<delete id="deleteHealthActivityByIds" parameterType="String">
delete from health_activity where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeHealthActivityById" parameterType="Long">
update health_activity set del_flag='1' where id = #{id}
</update>
<update id="removeHealthActivityByIds" parameterType="String">
update health_activity set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,128 @@
<?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.intc.health.mapper.HealthDiseasesMapper">
<resultMap type="HealthDiseasesVo" id="HealthDiseasesResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="type" column="type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="symptom" column="symptom" />
<result property="inspectionItems" column="inspection_items" />
<result property="medicalTreatment" column="medical_treatment" />
<result property="tcmTreatment" column="tcm_treatment" />
<result property="surgicalTreatment" column="surgical_treatment" />
<result property="physicalTreatment" column="physical_treatment" />
<result property="otherTreatment" column="other_treatment" />
</resultMap>
<sql id="selectHealthDiseasesVo">
select a.id, a.name, a.type, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark, a.symptom, a.inspection_items, a.medical_treatment, a.tcm_treatment, a.surgical_treatment, a.physical_treatment, a.other_treatment from health_diseases a
</sql>
<select id="selectHealthDiseasesList" parameterType="HealthDiseasesDto" resultMap="HealthDiseasesResult">
<include refid="selectHealthDiseasesVo"/>
<where>
a.del_flag='0'
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
<if test="type != null and type != ''"> and a.type = #{type}</if>
<if test="symptom != null and symptom != ''"> and a.symptom like '%'|| #{symptom}||'%'</if>
</where>
order by a.create_time desc
</select>
<select id="selectHealthDiseasesById" parameterType="Long" resultMap="HealthDiseasesResult">
<include refid="selectHealthDiseasesVo"/>
where a.id = #{id}
</select>
<insert id="insertHealthDiseases" parameterType="HealthDiseases">
insert into health_diseases
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null and name != ''">name,</if>
<if test="type != null and type != ''">type,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="symptom != null and symptom != ''">symptom,</if>
<if test="inspectionItems != null">inspection_items,</if>
<if test="medicalTreatment != null">medical_treatment,</if>
<if test="tcmTreatment != null">tcm_treatment,</if>
<if test="surgicalTreatment != null">surgical_treatment,</if>
<if test="physicalTreatment != null">physical_treatment,</if>
<if test="otherTreatment != null">other_treatment,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="type != null and type != ''">#{type},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="symptom != null and symptom != ''">#{symptom},</if>
<if test="inspectionItems != null">#{inspectionItems},</if>
<if test="medicalTreatment != null">#{medicalTreatment},</if>
<if test="tcmTreatment != null">#{tcmTreatment},</if>
<if test="surgicalTreatment != null">#{surgicalTreatment},</if>
<if test="physicalTreatment != null">#{physicalTreatment},</if>
<if test="otherTreatment != null">#{otherTreatment},</if>
</trim>
</insert>
<update id="updateHealthDiseases" parameterType="HealthDiseases">
update health_diseases
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="type != null and type != ''">type = #{type},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="symptom != null and symptom != ''">symptom = #{symptom},</if>
<if test="inspectionItems != null">inspection_items = #{inspectionItems},</if>
<if test="medicalTreatment != null">medical_treatment = #{medicalTreatment},</if>
<if test="tcmTreatment != null">tcm_treatment = #{tcmTreatment},</if>
<if test="surgicalTreatment != null">surgical_treatment = #{surgicalTreatment},</if>
<if test="physicalTreatment != null">physical_treatment = #{physicalTreatment},</if>
<if test="otherTreatment != null">other_treatment = #{otherTreatment},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthDiseasesById" parameterType="Long">
delete from health_diseases where id = #{id}
</delete>
<delete id="deleteHealthDiseasesByIds" parameterType="String">
delete from health_diseases where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeHealthDiseasesById" parameterType="Long">
update health_diseases set del_flag='1' where id = #{id}
</update>
<update id="removeHealthDiseasesByIds" parameterType="String">
update health_diseases set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,143 @@
<?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.intc.health.mapper.HealthDoctorRecordCostMapper">
<resultMap type="HealthDoctorRecordCostVo" id="HealthDoctorRecordCostResult">
<result property="id" column="id" />
<result property="doctorRecordId" column="doctor_record_id" />
<result property="type" column="type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="healthRecordId" column="health_record_id" />
<result property="costTime" column="cost_time" />
<result property="costName" column="cost_name" />
<result property="personId" column="person_id" />
<result property="totalCost" column="total_cost" />
<result property="price" column="price" />
<result property="count" column="count" />
<result property="unit" column="unit" />
<result property="medicineId" column="medicine_id" />
<result property="checkType" column="check_type" />
</resultMap>
<sql id="selectHealthDoctorRecordCostVo">
select a.id, a.doctor_record_id, a.type, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark, a.health_record_id, a.cost_time, a.cost_name, a.person_id, a.total_cost, a.price, a.count, a.unit, a.medicine_id, a.check_type from health_doctor_record_cost a
</sql>
<select id="selectHealthDoctorRecordCostList" parameterType="HealthDoctorRecordCostDto" resultMap="HealthDoctorRecordCostResult">
<include refid="selectHealthDoctorRecordCostVo"/>
<where>
a.del_flag='0'
<if test="doctorRecordId != null "> and a.doctor_record_id = #{doctorRecordId}</if>
<if test="type != null and type != ''"> and a.type = #{type}</if>
<if test="healthRecordId != null "> and a.health_record_id = #{healthRecordId}</if>
<if test="costName != null and costName != ''"> and a.cost_name like '%'|| #{costName}||'%'</if>
<if test="personId != null "> and a.person_id = #{personId}</if>
<if test="checkType != null and checkType != ''"> and a.check_type = #{checkType}</if>
</where>
order by a.cost_time desc
</select>
<select id="selectHealthDoctorRecordCostById" parameterType="Long" resultMap="HealthDoctorRecordCostResult">
<include refid="selectHealthDoctorRecordCostVo"/>
where a.id = #{id}
</select>
<insert id="insertHealthDoctorRecordCost" parameterType="HealthDoctorRecordCost">
insert into health_doctor_record_cost
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="doctorRecordId != null">doctor_record_id,</if>
<if test="type != null">type,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="healthRecordId != null">health_record_id,</if>
<if test="costTime != null">cost_time,</if>
<if test="costName != null">cost_name,</if>
<if test="personId != null">person_id,</if>
<if test="totalCost != null">total_cost,</if>
<if test="price != null">price,</if>
<if test="count != null">count,</if>
<if test="unit != null">unit,</if>
<if test="medicineId != null">medicine_id,</if>
<if test="checkType != null">check_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="doctorRecordId != null">#{doctorRecordId},</if>
<if test="type != null">#{type},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="healthRecordId != null">#{healthRecordId},</if>
<if test="costTime != null">#{costTime},</if>
<if test="costName != null">#{costName},</if>
<if test="personId != null">#{personId},</if>
<if test="totalCost != null">#{totalCost},</if>
<if test="price != null">#{price},</if>
<if test="count != null">#{count},</if>
<if test="unit != null">#{unit},</if>
<if test="medicineId != null">#{medicineId},</if>
<if test="checkType != null">#{checkType},</if>
</trim>
</insert>
<update id="updateHealthDoctorRecordCost" parameterType="HealthDoctorRecordCost">
update health_doctor_record_cost
<trim prefix="SET" suffixOverrides=",">
<if test="doctorRecordId != null">doctor_record_id = #{doctorRecordId},</if>
<if test="type != null">type = #{type},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="healthRecordId != null">health_record_id = #{healthRecordId},</if>
<if test="costTime != null">cost_time = #{costTime},</if>
<if test="costName != null">cost_name = #{costName},</if>
<if test="personId != null">person_id = #{personId},</if>
<if test="totalCost != null">total_cost = #{totalCost},</if>
<if test="price != null">price = #{price},</if>
<if test="count != null">count = #{count},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="medicineId != null">medicine_id = #{medicineId},</if>
<if test="checkType != null">check_type = #{checkType},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthDoctorRecordCostById" parameterType="Long">
delete from health_doctor_record_cost where id = #{id}
</delete>
<delete id="deleteHealthDoctorRecordCostByIds" parameterType="String">
delete from health_doctor_record_cost where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeHealthDoctorRecordCostById" parameterType="Long">
update health_doctor_record_cost set del_flag='1' where id = #{id}
</update>
<update id="removeHealthDoctorRecordCostByIds" parameterType="String">
update health_doctor_record_cost set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,181 @@
<?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.intc.health.mapper.HealthDoctorRecordMapper">
<resultMap type="HealthDoctorRecordVo" id="HealthDoctorRecordResult">
<result property="id" column="id" />
<result property="hospitalName" column="hospital_name" />
<result property="departments" column="departments" />
<result property="doctor" column="doctor" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="healthRecordId" column="health_record_id" />
<result property="visitingTime" column="visiting_time" />
<result property="prescribe" column="prescribe" />
<result property="personId" column="person_id" />
<result property="personName" column="person_name" />
<result property="healthRecordName" column="health_record_name" />
<result property="totalCost" column="total_cost" />
<result property="partner" column="partner" />
<result property="costDetail" column="cost_detail" />
<result property="type" column="type" />
<result property="diagnosis" column="diagnosis" />
</resultMap>
<sql id="selectHealthDoctorRecordVo">
select
a.id,
a.hospital_name,
a.departments,
a.doctor,
a.create_by,
a.type,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
a.remark,
a.health_record_id,
a.visiting_time,
a.prescribe,
a.person_id,
a.total_cost,
a.partner,
a.cost_detail,
a.diagnosis,
hp."name" as person_name ,
hr."name" as health_record_name
from
health_doctor_record a
left join health_person hp on
hp.id = a.person_id
left join health_record hr on
hr.id = a.health_record_id
</sql>
<select id="selectHealthDoctorRecordList" parameterType="HealthDoctorRecordDto" resultMap="HealthDoctorRecordResult">
<include refid="selectHealthDoctorRecordVo"/>
<where>
a.del_flag='0'
<if test="hospitalName != null and hospitalName != ''"> and a.hospital_name like '%'|| #{hospitalName}||'%'</if>
<if test="departments != null and departments != ''"> and a.departments = #{departments}</if>
<if test="doctor != null and doctor != ''"> and a.doctor = #{doctor}</if>
<if test="healthRecordId != null"> and a.health_record_id = #{healthRecordId}</if>
<if test="visitingTime != null "> and a.visiting_time = #{visitingTime}</if>
<if test="personId != null "> and a.person_id = #{personId}</if>
<if test="type != null and type != ''"> and a.type = #{type}</if>
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(a.visiting_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(a.visiting_time, 'yyyy-MM-dd')>=#{startTime}
</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
order by a.visiting_time desc
</select>
<select id="selectHealthDoctorRecordById" parameterType="Long" resultMap="HealthDoctorRecordResult">
<include refid="selectHealthDoctorRecordVo"/>
where a.id = #{id}
</select>
<insert id="insertHealthDoctorRecord" parameterType="HealthDoctorRecord">
insert into health_doctor_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="hospitalName != null and hospitalName != ''">hospital_name,</if>
<if test="departments != null and departments != ''">departments,</if>
<if test="doctor != null and doctor != ''">doctor,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="healthRecordId != null and healthRecordId != ''">health_record_id,</if>
<if test="visitingTime != null">visiting_time,</if>
<if test="prescribe != null and prescribe != ''">prescribe,</if>
<if test="personId != null">person_id,</if>
<if test="totalCost != null">total_cost,</if>
<if test="partner != null">partner,</if>
<if test="costDetail != null">cost_detail,</if>
<if test="type != null and type != ''">type,</if>
<if test="diagnosis != null and diagnosis != ''">diagnosis,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="hospitalName != null and hospitalName != ''">#{hospitalName},</if>
<if test="departments != null and departments != ''">#{departments},</if>
<if test="doctor != null and doctor != ''">#{doctor},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="healthRecordId != null and healthRecordId != ''">#{healthRecordId},</if>
<if test="visitingTime != null">#{visitingTime},</if>
<if test="prescribe != null and prescribe != ''">#{prescribe},</if>
<if test="personId != null">#{personId},</if>
<if test="totalCost != null">#{totalCost},</if>
<if test="partner != null">#{partner},</if>
<if test="costDetail != null">#{costDetail},</if>
<if test="type != null and type != ''">#{type},</if>
<if test="diagnosis != null and diagnosis != ''">#{diagnosis},</if>
</trim>
</insert>
<update id="updateHealthDoctorRecord" parameterType="HealthDoctorRecord">
update health_doctor_record
<trim prefix="SET" suffixOverrides=",">
<if test="hospitalName != null and hospitalName != ''">hospital_name = #{hospitalName},</if>
<if test="departments != null and departments != ''">departments = #{departments},</if>
<if test="doctor != null and doctor != ''">doctor = #{doctor},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="healthRecordId != null and healthRecordId != ''">health_record_id = #{healthRecordId},</if>
<if test="visitingTime != null">visiting_time = #{visitingTime},</if>
<if test="prescribe != null and prescribe != ''">prescribe = #{prescribe},</if>
<if test="personId != null">person_id = #{personId},</if>
<if test="totalCost != null">total_cost = #{totalCost},</if>
<if test="partner != null">partner = #{partner},</if>
<if test="costDetail != null">cost_detail = #{costDetail},</if>
<if test="type != null and type != ''">type = #{type},</if>
<if test="diagnosis != null and diagnosis != ''">diagnosis = #{diagnosis},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthDoctorRecordById" parameterType="Long">
delete from health_doctor_record where id = #{id}
</delete>
<delete id="deleteHealthDoctorRecordByIds" parameterType="String">
delete from health_doctor_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeHealthDoctorRecordById" parameterType="Long">
update health_doctor_record set del_flag='1' where id = #{id}
</update>
<update id="removeHealthDoctorRecordByIds" parameterType="String">
update health_doctor_record set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,134 @@
<?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.intc.health.mapper.HealthHeightWeightRecordMapper">
<resultMap type="HealthHeightWeightRecordVo" id="HealthHeightWeightRecordResult">
<result property="id" column="id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="measureTime" column="measure_time" />
<result property="weight" column="weight" />
<result property="personId" column="person_id" />
<result property="height" column="height" />
<result property="personName" column="person_name" />
</resultMap>
<sql id="selectHealthHeightWeightRecordVo">
select
a.id,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
a.remark,
a.measure_time,
a.weight,
a.person_id,
a.height,
hp."name" as person_name
from
health_height_weight_record a
left join health_person hp on
hp.id = a.person_id
</sql>
<select id="selectHealthHeightWeightRecordList" parameterType="HealthHeightWeightRecordDto" resultMap="HealthHeightWeightRecordResult">
<include refid="selectHealthHeightWeightRecordVo"/>
<where>
a.del_flag='0'
<if test="measureTime != null "> and a.measure_time = #{measureTime}</if>
<if test="weight != null "> and a.weight = #{weight}</if>
<if test="personId != null and personId != ''"> and a.person_id = #{personId}</if>
<if test="height != null "> and a.height = #{height}</if>
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(a.measure_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(a.measure_time, 'yyyy-MM-dd')>=#{startTime}
</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
order by a.measure_time desc
</select>
<select id="selectHealthHeightWeightRecordById" parameterType="Long" resultMap="HealthHeightWeightRecordResult">
<include refid="selectHealthHeightWeightRecordVo"/>
where a.id = #{id}
</select>
<insert id="insertHealthHeightWeightRecord" parameterType="HealthHeightWeightRecord">
insert into health_height_weight_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="measureTime != null">measure_time,</if>
<if test="weight != null">weight,</if>
<if test="personId != null">person_id,</if>
<if test="height != null">height,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="measureTime != null">#{measureTime},</if>
<if test="weight != null">#{weight},</if>
<if test="personId != null">#{personId},</if>
<if test="height != null">#{height},</if>
</trim>
</insert>
<update id="updateHealthHeightWeightRecord" parameterType="HealthHeightWeightRecord">
update health_height_weight_record
<trim prefix="SET" suffixOverrides=",">
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="measureTime != null">measure_time = #{measureTime},</if>
<if test="weight != null">weight = #{weight},</if>
<if test="personId != null">person_id = #{personId},</if>
<if test="height != null">height = #{height},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthHeightWeightRecordById" parameterType="Long">
delete from health_height_weight_record where id = #{id}
</delete>
<delete id="deleteHealthHeightWeightRecordByIds" parameterType="String">
delete from health_height_weight_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeHealthHeightWeightRecordById" parameterType="Long">
update health_height_weight_record set del_flag='1' where id = #{id}
</update>
<update id="removeHealthHeightWeightRecordByIds" parameterType="String">
update health_height_weight_record set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,188 @@
<?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.intc.health.mapper.HealthMarRecordMapper">
<resultMap type="HealthMarRecordVo" id="HealthMarRecordResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="type" column="type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="healthRecordId" column="health_record_id" />
<result property="dosingTime" column="dosing_time" />
<result property="dosage" column="dosage" />
<result property="personId" column="person_id" />
<result property="resource" column="resource" />
<result property="place" column="place" />
<result property="medicineId" column="medicine_id" />
<result property="unit" column="unit" />
<result property="content" column="content" />
<result property="contentUnit" column="content_unit" />
<result property="personName" column="person_name" />
<result property="healthRecordName" column="health_record_name" />
<result property="count" column="count" />
</resultMap>
<sql id="selectHealthMarRecordVo">
select
a.id,
a.type,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
a.remark,
a.health_record_id,
a.dosing_time,
a.dosage,
a.person_id,
a.resource,
a.place,
a.place,
a.medicine_id,
a.unit,
a.content,
a.content_unit,
hp."name" as person_name ,
hr."name" as health_record_name,
hmb.short_name || '-' || hmb.brand || '(' || hmb.packaging || ')' as name
from
health_mar_record a
left join health_person hp on
hp.id = a.person_id
left join health_record hr on
hr.id = a.health_record_id
left join health_medicine_basic hmb on
hmb.id = a.medicine_id
</sql>
<select id="selectHealthMarRecordList" parameterType="HealthMarRecordDto" resultMap="HealthMarRecordResult">
<include refid="selectHealthMarRecordVo"/>
<where>
a.del_flag='0'
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
<if test="type != null and type != ''"> and a.type = #{type}</if>
<if test="healthRecordId != null and healthRecordId != ''"> and a.health_record_id = #{healthRecordId}</if>
<if test="dosingTime != null "> and a.dosing_time = #{dosingTime}</if>
<if test="dosage != null and dosage != ''"> and a.dosage = #{dosage}</if>
<if test="personId != null "> and a.person_id = #{personId}</if>
<if test="resource != null and resource != ''"> and a.resource = #{resource}</if>
<if test="place != null and place != ''"> and a.place = #{place}</if>
<if test="medicineId != null">and a.medicine_id = #{medicineId}</if>
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(a.dosing_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(a.dosing_time, 'yyyy-MM-dd')>=#{startTime}
</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
order by a.dosing_time desc
</select>
<select id="selectHealthMarRecordById" parameterType="Long" resultMap="HealthMarRecordResult">
<include refid="selectHealthMarRecordVo"/>
where a.id = #{id}
</select>
<insert id="insertHealthMarRecord" parameterType="HealthMarRecord">
insert into health_mar_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null and name != ''">name,</if>
<if test="type != null and type != ''">type,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="healthRecordId != null">health_record_id,</if>
<if test="dosingTime != null">dosing_time,</if>
<if test="dosage != null and dosage != ''">dosage,</if>
<if test="personId != null">person_id,</if>
<if test="resource != null">resource,</if>
<if test="place != null">place,</if>
<if test="medicineId != null">medicine_id,</if>
<if test="unit != null">unit,</if>
<if test="content != null">content,</if>
<if test="contentUnit != null">content_unit,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="type != null and type != ''">#{type},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="healthRecordId != null">#{healthRecordId},</if>
<if test="dosingTime != null">#{dosingTime},</if>
<if test="dosage != null and dosage != ''">#{dosage},</if>
<if test="personId != null">#{personId},</if>
<if test="resource != null">#{resource},</if>
<if test="place != null">#{place},</if>
<if test="medicineId != null">#{medicineId},</if>
<if test="unit != null">#{unit},</if>
<if test="content != null">#{content},</if>
<if test="contentUnit != null">#{contentUnit},</if>
</trim>
</insert>
<update id="updateHealthMarRecord" parameterType="HealthMarRecord">
update health_mar_record
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="type != null and type != ''">type = #{type},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="healthRecordId != null">health_record_id = #{healthRecordId},</if>
<if test="dosingTime != null">dosing_time = #{dosingTime},</if>
<if test="dosage != null and dosage != ''">dosage = #{dosage},</if>
<if test="personId != null">person_id = #{personId},</if>
<if test="resource != null">resource = #{resource},</if>
<if test="place != null">place = #{place},</if>
<if test="medicineId != null">medicine_id = #{medicineId},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="content != null">content = #{content},</if>
<if test="contentUnit != null">content_unit = #{contentUnit},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthMarRecordById" parameterType="Long">
delete from health_mar_record where id = #{id}
</delete>
<delete id="deleteHealthMarRecordByIds" parameterType="String">
delete from health_mar_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeHealthMarRecordById" parameterType="Long">
update health_mar_record set del_flag='1' where id = #{id}
</update>
<update id="removeHealthMarRecordByIds" parameterType="String">
update health_mar_record set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,228 @@
<?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.intc.health.mapper.HealthMedicineBasicMapper">
<resultMap type="HealthMedicineBasicVo" id="HealthMedicineBasicResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="classification" column="classification" />
<result property="category" column="category" />
<result property="brand" column="brand" />
<result property="packaging" column="packaging" />
<result property="manufacturers" column="manufacturers" />
<result property="treatmentType" column="treatment_type" />
<result property="isImport" column="is_import" />
<result property="ingredients" column="ingredients" />
<result property="usage" column="usage" />
<result property="dosageForm" column="dosage_form" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="code" column="code" />
<result property="specifications" column="specifications" />
<result property="unit" column="unit" />
<result property="adverseReaction" column="adverse_reaction" />
<result property="address" column="address" />
<result property="content" column="content" />
<result property="contentUnit" column="content_unit" />
<result property="character" column="character" />
<result property="storage" column="storage" />
<result property="indications" column="indications" />
<result property="shortName" column="short_name" />
<result property="packageUnit" column="package_unit" />
</resultMap>
<sql id="selectHealthMedicineBasicVo">
select
a.id,
a.name,
a.classification,
a.category,
a.brand,
a.packaging,
a.manufacturers,
a.treatment_type,
a.is_import,
a.ingredients,
a.usage,
a.dosage_form,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
a.remark,
a.code,
a.specifications,
a.unit,
a.adverse_reaction,
a.address,
a.content,
a.content_unit,
a.character,
a.storage,
a.indications,
a.short_name,
a.package_unit
from
health_medicine_basic a
</sql>
<select id="selectHealthMedicineBasicList" parameterType="HealthMedicineBasicDto" resultMap="HealthMedicineBasicResult">
<include refid="selectHealthMedicineBasicVo"/>
<where>
a.del_flag='0'
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
<if test="keys != null and keys != ''"> and a.name like '%'|| #{keys}||'%' or a.short_name like '%'|| #{keys}||'%' or a.brand like '%'|| #{keys}||'%' or a.manufacturers like '%'|| #{keys}||'%' or a.code like '%'|| #{keys}||'%'</if>
<if test="shortName != null and shortName != ''"> and a.short_name like '%'|| #{shortName}||'%'</if>
<if test="classification != null and classification != ''"> and a.classification = #{classification}</if>
<if test="category != null and category != ''"> and a.category = #{category}</if>
<if test="brand != null and brand != ''"> and a.brand like '%'|| #{brand}||'%'</if>
<if test="packaging != null and packaging != ''"> and a.packaging = #{packaging}</if>
<if test="manufacturers != null and manufacturers != ''"> and a.manufacturers like '%'|| #{manufacturers}||'%'</if>
<if test="treatmentType != null and treatmentType != ''"> and a.treatment_type = #{treatmentType}</if>
<if test="isImport != null and isImport != ''"> and a.is_import = #{isImport}</if>
<if test="ingredients != null and ingredients != ''"> and a.ingredients = #{ingredients}</if>
<if test="usage != null and usage != ''"> and a.usage = #{usage}</if>
<if test="dosageForm != null and dosageForm != ''"> and a.dosage_form = #{dosageForm}</if>
<if test="code != null and code != ''"> and a.code like '%'|| #{code}||'%'</if>
</where>
order by a.create_time desc
</select>
<select id="selectHealthMedicineBasicById" parameterType="Long" resultMap="HealthMedicineBasicResult">
<include refid="selectHealthMedicineBasicVo"/>
where a.id = #{id}
</select>
<insert id="insertHealthMedicineBasic" parameterType="HealthMedicineBasic">
insert into health_medicine_basic
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null and name != ''">name,</if>
<if test="classification != null and classification != ''">classification,</if>
<if test="category != null and category != ''">category,</if>
<if test="brand != null and brand != ''">brand,</if>
<if test="packaging != null and packaging != ''">packaging,</if>
<if test="manufacturers != null and manufacturers != ''">manufacturers,</if>
<if test="treatmentType != null and treatmentType != ''">treatment_type,</if>
<if test="isImport != null">is_import,</if>
<if test="ingredients != null">ingredients,</if>
<if test="usage != null">usage,</if>
<if test="dosageForm != null and dosageForm != ''">dosage_form,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="code != null and code != ''">code,</if>
<if test="specifications != null">specifications,</if>
<if test="unit != null">unit,</if>
<if test="adverseReaction != null">adverse_reaction,</if>
<if test="address != null">address,</if>
<if test="content != null">content,</if>
<if test="contentUnit != null">content_unit,</if>
<if test="character != null">character,</if>
<if test="storage != null">storage,</if>
<if test="indications != null">indications,</if>
<if test="shortName != null">short_name,</if>
<if test="packageUnit != null">package_unit,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="classification != null and classification != ''">#{classification},</if>
<if test="category != null and category != ''">#{category},</if>
<if test="brand != null and brand != ''">#{brand},</if>
<if test="packaging != null and packaging != ''">#{packaging},</if>
<if test="manufacturers != null and manufacturers != ''">#{manufacturers},</if>
<if test="treatmentType != null and treatmentType != ''">#{treatmentType},</if>
<if test="isImport != null">#{isImport},</if>
<if test="ingredients != null">#{ingredients},</if>
<if test="usage != null">#{usage},</if>
<if test="dosageForm != null and dosageForm != ''">#{dosageForm},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="code != null and code != ''">#{code},</if>
<if test="specifications != null">#{specifications},</if>
<if test="unit != null">#{unit},</if>
<if test="adverseReaction != null">#{adverseReaction},</if>
<if test="address != null">#{address},</if>
<if test="content != null">#{content},</if>
<if test="contentUnit != null">#{contentUnit},</if>
<if test="character != null">#{character},</if>
<if test="storage != null">#{storage},</if>
<if test="indications != null">#{indications},</if>
<if test="shortName != null">#{shortName},</if>
<if test="packageUnit != null">#{packageUnit},</if>
</trim>
</insert>
<update id="updateHealthMedicineBasic" parameterType="HealthMedicineBasic">
update health_medicine_basic
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="classification != null and classification != ''">classification = #{classification},</if>
<if test="category != null and category != ''">category = #{category},</if>
<if test="brand != null and brand != ''">brand = #{brand},</if>
<if test="packaging != null and packaging != ''">packaging = #{packaging},</if>
<if test="manufacturers != null and manufacturers != ''">manufacturers = #{manufacturers},</if>
<if test="treatmentType != null and treatmentType != ''">treatment_type = #{treatmentType},</if>
<if test="isImport != null">is_import = #{isImport},</if>
<if test="ingredients != null">ingredients = #{ingredients},</if>
<if test="usage != null">usage = #{usage},</if>
<if test="dosageForm != null and dosageForm != ''">dosage_form = #{dosageForm},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="code != null and code != ''">code = #{code},</if>
<if test="specifications != null">specifications = #{specifications},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="adverseReaction != null">adverse_reaction = #{adverseReaction},</if>
<if test="address != null">address = #{address},</if>
<if test="content != null">content = #{content},</if>
<if test="contentUnit != null">content_unit = #{contentUnit},</if>
<if test="character != null">character = #{character},</if>
<if test="storage != null">storage = #{storage},</if>
<if test="indications != null">indications = #{indications},</if>
<if test="shortName != null">short_name = #{shortName},</if>
<if test="packageUnit != null">package_unit = #{packageUnit},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthMedicineBasicById" parameterType="Long">
delete from health_medicine_basic where id = #{id}
</delete>
<delete id="deleteHealthMedicineBasicByIds" parameterType="String">
delete from health_medicine_basic where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeHealthMedicineBasicById" parameterType="Long">
update health_medicine_basic set del_flag='1' where id = #{id}
</update>
<update id="removeHealthMedicineBasicByIds" parameterType="String">
update health_medicine_basic set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,99 @@
<?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.intc.health.mapper.HealthMedicineRealtimeStockMapper">
<resultMap type="HealthMedicineRealtimeStockVo" id="HealthMedicineRealtimeStockResult">
<result property="id" column="id" />
<result property="medicineId" column="medicine_id" />
<result property="inventory" column="inventory" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectHealthMedicineRealtimeStockVo">
select a.id, a.medicine_id, a.inventory, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark from health_medicine_realtime_stock a
</sql>
<select id="selectHealthMedicineRealtimeStockList" parameterType="HealthMedicineRealtimeStockDto" resultMap="HealthMedicineRealtimeStockResult">
<include refid="selectHealthMedicineRealtimeStockVo"/>
<where>
a.del_flag='0'
<if test="medicineId != null and medicineId != ''"> and a.medicine_id = #{medicineId}</if>
<if test="inventory != null and inventory != ''"> and a.inventory = #{inventory}</if>
</where>
order by a.create_time desc
</select>
<select id="selectHealthMedicineRealtimeStockById" parameterType="String" resultMap="HealthMedicineRealtimeStockResult">
<include refid="selectHealthMedicineRealtimeStockVo"/>
where a.id = #{id}
</select>
<insert id="insertHealthMedicineRealtimeStock" parameterType="HealthMedicineRealtimeStock">
insert into health_medicine_realtime_stock
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="medicineId != null">medicine_id,</if>
<if test="inventory != null">inventory,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="medicineId != null">#{medicineId},</if>
<if test="inventory != null">#{inventory},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateHealthMedicineRealtimeStock" parameterType="HealthMedicineRealtimeStock">
update health_medicine_realtime_stock
<trim prefix="SET" suffixOverrides=",">
<if test="medicineId != null">medicine_id = #{medicineId},</if>
<if test="inventory != null">inventory = #{inventory},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthMedicineRealtimeStockById" parameterType="String">
delete from health_medicine_realtime_stock where id = #{id}
</delete>
<delete id="deleteHealthMedicineRealtimeStockByIds" parameterType="String">
delete from health_medicine_realtime_stock where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeHealthMedicineRealtimeStockById" parameterType="String">
update health_medicine_realtime_stock set del_flag='1' where id = #{id}
</update>
<update id="removeHealthMedicineRealtimeStockByIds" parameterType="String">
update health_medicine_realtime_stock set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,231 @@
<?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.intc.health.mapper.HealthMedicineStockInMapper">
<resultMap type="HealthMedicineStockInVo" id="HealthMedicineStockInResult">
<result property="id" column="id" />
<result property="medicineId" column="medicine_id" />
<result property="quantity" column="quantity" />
<result property="productionDate" column="production_date" />
<result property="expiringDate" column="expiring_date" />
<result property="purchaseDate" column="purchase_date" />
<result property="purchasePrice" column="purchase_price" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="code" column="code" />
<result property="state" column="state" />
<result property="leftCount" column="left_count" />
<result property="usedCount" column="used_count" />
<result property="purchaseAddress" column="purchase_address" />
<result property="totalPrice" column="total_price" />
<result property="medicineName" column="medicine_name" />
<result property="usage" column="usage" />
<result property="ageWeight" column="age_weight" />
<result property="packageUnit" column="package_unit" />
<result property="unit" column="unit" />
<result property="totalCount" column="total_count" />
</resultMap>
<sql id="selectHealthMedicineStockInVo">
select
a.id,
a.medicine_id,
a.quantity,
a.usage,
a.age_weight,
a.production_date,
a.expiring_date,
a.purchase_date,
a.purchase_price,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
a.remark,
a.code,
a.state,
a.left_count,
a.used_count,
a.purchase_address,
a.unit,
a.total_price,
hmb.short_name || '-' || hmb.brand || '(' || hmb.packaging || ')' as medicine_name,
a.package_unit,
a.total_count
from
health_medicine_stock_in a
left join health_medicine_basic hmb on
hmb.id = a.medicine_id
</sql>
<select id="selectHealthMedicineStockInList" parameterType="HealthMedicineStockInDto" resultMap="HealthMedicineStockInResult">
<include refid="selectHealthMedicineStockInVo"/>
<where>
a.del_flag='0'
<if test="medicineId != null "> and a.medicine_id = #{medicineId}</if>
<if test="quantity != null "> and a.quantity = #{quantity}</if>
<if test="productionDate != null "> and a.production_date = #{productionDate}</if>
<if test="expiringDate != null "> and a.expiring_date = #{expiringDate}</if>
<if test="purchaseDate != null "> and a.purchase_date = #{purchaseDate}</if>
<if test="purchasePrice != null "> and a.purchase_price = #{purchasePrice}</if>
<if test="code != null and code != ''"> and a.code = #{code}</if>
<if test="state != null and state != ''"> and a.state = #{state}</if>
<if test="leftCount != null "> and a.left_count = #{leftCount}</if>
<if test="usedCount != null "> and a.used_count = #{usedCount}</if>
<if test="purchaseAddress != null and purchaseAddress != ''"> and a.purchase_address = #{purchaseAddress}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
order by a.purchase_date desc
</select>
<select id="selectHealthMedicineStockInById" parameterType="Long" resultMap="HealthMedicineStockInResult">
<include refid="selectHealthMedicineStockInVo"/>
where a.id = #{id}
</select>
<insert id="insertHealthMedicineStockIn" parameterType="HealthMedicineStockIn">
insert into health_medicine_stock_in
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="medicineId != null">medicine_id,</if>
<if test="quantity != null">quantity,</if>
<if test="productionDate != null">production_date,</if>
<if test="expiringDate != null">expiring_date,</if>
<if test="purchaseDate != null">purchase_date,</if>
<if test="purchasePrice != null">purchase_price,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="code != null and code != ''">code,</if>
<if test="state != null and state != ''">state,</if>
<if test="leftCount != null">left_count,</if>
<if test="usedCount != null">used_count,</if>
<if test="purchaseAddress != null">purchase_address,</if>
<if test="totalPrice != null">total_price,</if>
<if test="usage != null">usage,</if>
<if test="ageWeight != null">age_weight,</if>
<if test="unit != null">unit,</if>
<if test="packageUnit != null">package_unit,</if>
<if test="totalCount != null">total_count,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="medicineId != null">#{medicineId},</if>
<if test="quantity != null">#{quantity},</if>
<if test="productionDate != null">#{productionDate},</if>
<if test="expiringDate != null">#{expiringDate},</if>
<if test="purchaseDate != null">#{purchaseDate},</if>
<if test="purchasePrice != null">#{purchasePrice},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="code != null and code != ''">#{code},</if>
<if test="state != null and state != ''">#{state},</if>
<if test="leftCount != null">#{leftCount},</if>
<if test="usedCount != null">#{usedCount},</if>
<if test="purchaseAddress != null">#{purchaseAddress},</if>
<if test="totalPrice != null">#{totalPrice},</if>
<if test="usage != null">#{usage},</if>
<if test="ageWeight != null">#{ageWeight},</if>
<if test="unit != null">#{unit},</if>
<if test="packageUnit != null">#{packageUnit},</if>
<if test="totalCount != null">#{totalCount},</if>
</trim>
</insert>
<update id="updateHealthMedicineStockIn" parameterType="HealthMedicineStockIn">
update health_medicine_stock_in
<trim prefix="SET" suffixOverrides=",">
<if test="medicineId != null">medicine_id = #{medicineId},</if>
<if test="quantity != null">quantity = #{quantity},</if>
<if test="productionDate != null">production_date = #{productionDate},</if>
<if test="expiringDate != null">expiring_date = #{expiringDate},</if>
<if test="purchaseDate != null">purchase_date = #{purchaseDate},</if>
<if test="purchasePrice != null">purchase_price = #{purchasePrice},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="code != null and code != ''">code = #{code},</if>
<if test="state != null and state != ''">state = #{state},</if>
<if test="leftCount != null">left_count = #{leftCount},</if>
<if test="usedCount != null">used_count = #{usedCount},</if>
<if test="purchaseAddress != null">purchase_address = #{purchaseAddress},</if>
<if test="totalPrice != null">total_price = #{totalPrice},</if>
<if test="usage != null">usage = #{usage},</if>
<if test="ageWeight != null">age_weight = #{ageWeight},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="packageUnit != null">package_unit = #{packageUnit},</if>
<if test="totalCount != null">total_count = #{totalCount},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthMedicineStockInById" parameterType="Long">
delete from health_medicine_stock_in where id = #{id}
</delete>
<delete id="deleteHealthMedicineStockInByIds" parameterType="String">
delete from health_medicine_stock_in where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeHealthMedicineStockInById" parameterType="Long">
update health_medicine_stock_in set del_flag='1' where id = #{id}
</update>
<update id="removeHealthMedicineStockInByIds" parameterType="String">
update health_medicine_stock_in set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<select id="selectHealthMedicineRealtimeList" parameterType="HealthMedicineStockInDto" resultMap="HealthMedicineStockInResult">
select
a.medicine_id,
sum(a.left_count) as left_count,
sum(a.total_count) as total_count,
a.unit,
hmb.short_name || '-' || hmb.brand || '(' || hmb.packaging || ')' as medicine_name
from
health_medicine_stock_in a
left join health_medicine_basic hmb on
hmb.id = a.medicine_id
<where>
a.del_flag='0'
and a.left_count>0
<if test="medicineId != null "> and a.medicine_id = #{medicineId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
group by
a.medicine_id,
a.left_count,
a.unit,
hmb.short_name,
a.package_unit,
hmb.brand,
hmb.packaging,
a.total_count
</select>
</mapper>

View File

@@ -0,0 +1,112 @@
<?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.intc.health.mapper.HealthMedicineTagsMapper">
<resultMap type="HealthMedicineTagsVo" id="HealthMedicineTagsResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="type" column="type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="code" column="code" />
<result property="atttibute" column="atttibute" />
<result property="atttibuteExtra" column="atttibute_extra" />
</resultMap>
<sql id="selectHealthMedicineTagsVo">
select a.id, a.name, a.type, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark, a.code, a.atttibute, a.atttibute_extra from health_medicine_tags a
</sql>
<select id="selectHealthMedicineTagsList" parameterType="HealthMedicineTagsDto" resultMap="HealthMedicineTagsResult">
<include refid="selectHealthMedicineTagsVo"/>
<where>
a.del_flag='0'
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
<if test="type != null and type != ''"> and a.type = #{type}</if>
<if test="code != null and code != ''"> and a.code like '%'|| #{code}||'%'</if>
</where>
order by a.create_time desc
</select>
<select id="selectHealthMedicineTagsById" parameterType="Long" resultMap="HealthMedicineTagsResult">
<include refid="selectHealthMedicineTagsVo"/>
where a.id = #{id}
</select>
<insert id="insertHealthMedicineTags" parameterType="HealthMedicineTags">
insert into health_medicine_tags
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null and name != ''">name,</if>
<if test="type != null and type != ''">type,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="code != null and code != ''">code,</if>
<if test="atttibute != null">atttibute,</if>
<if test="atttibuteExtra != null">atttibute_extra,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="type != null and type != ''">#{type},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="code != null and code != ''">#{code},</if>
<if test="atttibute != null">#{atttibute},</if>
<if test="atttibuteExtra != null">#{atttibuteExtra},</if>
</trim>
</insert>
<update id="updateHealthMedicineTags" parameterType="HealthMedicineTags">
update health_medicine_tags
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="type != null and type != ''">type = #{type},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="code != null and code != ''">code = #{code},</if>
<if test="atttibute != null">atttibute = #{atttibute},</if>
<if test="atttibuteExtra != null">atttibute_extra = #{atttibuteExtra},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthMedicineTagsById" parameterType="Long">
delete from health_medicine_tags where id = #{id}
</delete>
<delete id="deleteHealthMedicineTagsByIds" parameterType="String">
delete from health_medicine_tags where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeHealthMedicineTagsById" parameterType="Long">
update health_medicine_tags set del_flag='1' where id = #{id}
</update>
<update id="removeHealthMedicineTagsByIds" parameterType="String">
update health_medicine_tags set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,99 @@
<?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.intc.health.mapper.HealthMedicineTagsRelMapper">
<resultMap type="HealthMedicineTagsRelVo" id="HealthMedicineTagsRelResult">
<result property="id" column="id" />
<result property="tagId" column="tag_id" />
<result property="medicineId" column="medicine_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectHealthMedicineTagsRelVo">
select a.id, a.tag_id, a.medicine_id, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark from health_medicine_tags_rel a
</sql>
<select id="selectHealthMedicineTagsRelList" parameterType="HealthMedicineTagsRelDto" resultMap="HealthMedicineTagsRelResult">
<include refid="selectHealthMedicineTagsRelVo"/>
<where>
a.del_flag='0'
<if test="tagId != null "> and a.tag_id = #{tagId}</if>
<if test="medicineId != null "> and a.medicine_id = #{medicineId}</if>
</where>
order by a.create_time desc
</select>
<select id="selectHealthMedicineTagsRelById" parameterType="Long" resultMap="HealthMedicineTagsRelResult">
<include refid="selectHealthMedicineTagsRelVo"/>
where a.id = #{id}
</select>
<insert id="insertHealthMedicineTagsRel" parameterType="HealthMedicineTagsRel">
insert into health_medicine_tags_rel
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="tagId != null">tag_id,</if>
<if test="medicineId != null">medicine_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="tagId != null">#{tagId},</if>
<if test="medicineId != null">#{medicineId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateHealthMedicineTagsRel" parameterType="HealthMedicineTagsRel">
update health_medicine_tags_rel
<trim prefix="SET" suffixOverrides=",">
<if test="tagId != null">tag_id = #{tagId},</if>
<if test="medicineId != null">medicine_id = #{medicineId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthMedicineTagsRelById" parameterType="Long">
delete from health_medicine_tags_rel where id = #{id}
</delete>
<delete id="deleteHealthMedicineTagsRelByIds" parameterType="String">
delete from health_medicine_tags_rel where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeHealthMedicineTagsRelById" parameterType="Long">
update health_medicine_tags_rel set del_flag='1' where id = #{id}
</update>
<update id="removeHealthMedicineTagsRelByIds" parameterType="String">
update health_medicine_tags_rel set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,130 @@
<?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.intc.health.mapper.HealthPersonMapper">
<resultMap type="HealthPersonVo" id="HealthPersonResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="type" column="type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="birthday" column="birthday" />
<result property="nickName" column="nick_name" />
<result property="height" column="height" />
<result property="weight" column="weight" />
<result property="ranking" column="ranking" />
<result property="sex" column="sex" />
<result property="identityCard" column="identity_card" />
</resultMap>
<sql id="selectHealthPersonVo">
select a.id, a.name,a.sex,a.identity_card, a.type, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark, a.birthday, a.nick_name, a.height, a.weight, a.ranking from health_person a
</sql>
<select id="selectHealthPersonList" parameterType="HealthPersonDto" resultMap="HealthPersonResult">
<include refid="selectHealthPersonVo"/>
<where>
a.del_flag='0'
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
<if test="type != null and type != ''"> and a.type = #{type}</if>
<if test="nickName != null and nickName != ''"> and a.nick_name like '%'|| #{nickName}||'%'</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
order by a.ranking asc
</select>
<select id="selectHealthPersonById" parameterType="Long" resultMap="HealthPersonResult">
<include refid="selectHealthPersonVo"/>
where a.id = #{id}
</select>
<insert id="insertHealthPerson" parameterType="HealthPerson">
insert into health_person
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null and name != ''">name,</if>
<if test="type != null and type != ''">type,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="birthday != null">birthday,</if>
<if test="nickName != null and nickName != ''">nick_name,</if>
<if test="height != null">height,</if>
<if test="weight != null">weight,</if>
<if test="ranking != null">ranking,</if>
<if test="sex != null and sex != ''">sex,</if>
<if test="identityCard != null and identityCard != ''">identity_card,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="type != null and type != ''">#{type},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="birthday != null">#{birthday},</if>
<if test="nickName != null and nickName != ''">#{nickName},</if>
<if test="height != null">#{height},</if>
<if test="weight != null">#{weight},</if>
<if test="ranking != null">#{ranking},</if>
<if test="sex != null and sex != ''">#{sex},</if>
<if test="identityCard != null and identityCard != ''">#{identityCard},</if>
</trim>
</insert>
<update id="updateHealthPerson" parameterType="HealthPerson">
update health_person
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="type != null and type != ''">type = #{type},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="birthday != null">birthday = #{birthday},</if>
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
<if test="height != null">height = #{height},</if>
<if test="weight != null">weight = #{weight},</if>
<if test="ranking != null">ranking = #{ranking},</if>
<if test="sex != null and sex != ''">sex = #{sex},</if>
<if test="identityCard != null and identityCard != ''">identity_card = #{identityCard},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthPersonById" parameterType="Long">
delete from health_person where id = #{id}
</delete>
<delete id="deleteHealthPersonByIds" parameterType="String">
delete from health_person where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeHealthPersonById" parameterType="Long">
update health_person set del_flag='1' where id = #{id}
</update>
<update id="removeHealthPersonByIds" parameterType="String">
update health_person set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,137 @@
<?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.intc.health.mapper.HealthProcessRecordMapper">
<resultMap type="HealthProcessRecordVo" id="HealthProcessRecordResult">
<result property="id" column="id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="healthRecordId" column="health_record_id" />
<result property="recordingTime" column="recording_time" />
<result property="content" column="content" />
<result property="personId" column="person_id" />
<result property="personName" column="person_name" />
<result property="healthRecordName" column="health_record_name" />
</resultMap>
<sql id="selectHealthProcessRecordVo">
select
a.id,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
a.remark,
a.health_record_id,
a.recording_time,
a.content,
a.person_id,
hp."name" as person_name ,
hr."name" as health_record_name
from
health_process_record a
left join health_person hp on
hp.id = a.person_id
left join health_record hr on
hr.id = a.health_record_id</sql>
<select id="selectHealthProcessRecordList" parameterType="HealthProcessRecordDto" resultMap="HealthProcessRecordResult">
<include refid="selectHealthProcessRecordVo"/>
<where>
a.del_flag='0'
<if test="healthRecordId != null "> and a.health_record_id = #{healthRecordId}</if>
<if test="content != null and content != ''"> and a.content like '%'|| #{content}||'%'</if>
<if test="personId != null "> and a.person_id = #{personId}</if>
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(a.recording_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(a.recording_time, 'yyyy-MM-dd')>=#{startTime}
</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
order by a.recording_time desc
</select>
<select id="selectHealthProcessRecordById" parameterType="Long" resultMap="HealthProcessRecordResult">
<include refid="selectHealthProcessRecordVo"/>
where a.id = #{id}
</select>
<insert id="insertHealthProcessRecord" parameterType="HealthProcessRecord">
insert into health_process_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="healthRecordId != null">health_record_id,</if>
<if test="recordingTime != null">recording_time,</if>
<if test="content != null">content,</if>
<if test="personId != null">person_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="healthRecordId != null">#{healthRecordId},</if>
<if test="recordingTime != null">#{recordingTime},</if>
<if test="content != null">#{content},</if>
<if test="personId != null">#{personId},</if>
</trim>
</insert>
<update id="updateHealthProcessRecord" parameterType="HealthProcessRecord">
update health_process_record
<trim prefix="SET" suffixOverrides=",">
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="healthRecordId != null">health_record_id = #{healthRecordId},</if>
<if test="recordingTime != null">recording_time = #{recordingTime},</if>
<if test="content != null">content = #{content},</if>
<if test="personId != null">person_id = #{personId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthProcessRecordById" parameterType="Long">
delete from health_process_record where id = #{id}
</delete>
<delete id="deleteHealthProcessRecordByIds" parameterType="String">
delete from health_process_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeHealthProcessRecordById" parameterType="Long">
update health_process_record set del_flag='1' where id = #{id}
</update>
<update id="removeHealthProcessRecordByIds" parameterType="String">
update health_process_record set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,166 @@
<?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.intc.health.mapper.HealthRecordMapper">
<resultMap type="HealthRecordVo" id="HealthRecordResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="type" column="type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="occurTime" column="occur_time" />
<result property="rehabilitationTime" column="rehabilitation_time" />
<result property="initialSymptoms" column="initial_symptoms" />
<result property="mediumTermSymptoms" column="medium_term_symptoms" />
<result property="laterStageSymptoms" column="later_stage_symptoms" />
<result property="etiology" column="etiology" />
<result property="personId" column="person_id" />
<result property="state" column="state" />
<result property="personName" column="person_name" />
</resultMap>
<sql id="selectHealthRecordVo">
select
a.id,
a.name,
a.type,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
a.remark,
a.occur_time,
a.rehabilitation_time,
a.initial_symptoms,
a.medium_term_symptoms,
a.later_stage_symptoms,
a.etiology,
a.person_id,
a.state,
hp."name" as person_name
from
health_record a
left join health_person hp on
hp.id = a.person_id
</sql>
<select id="selectHealthRecordList" parameterType="HealthRecordDto" resultMap="HealthRecordResult">
<include refid="selectHealthRecordVo"/>
<where>
a.del_flag='0'
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
<if test="type != null and type != ''"> and a.type = #{type}</if>
<if test="state != null and state != ''"> and a.state = #{state}</if>
<if test="etiology != null and etiology != ''"> and a.etiology = #{etiology}</if>
<if test="personId != null "> and a.person_id = #{personId}</if>
<if test="healthRecordId != null "> and a.id = #{healthRecordId}</if>
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(a.occur_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(a.occur_time, 'yyyy-MM-dd')>=#{startTime}
</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
order by a.occur_time desc
</select>
<select id="selectHealthRecordById" parameterType="Long" resultMap="HealthRecordResult">
<include refid="selectHealthRecordVo"/>
where a.id = #{id}
</select>
<insert id="insertHealthRecord" parameterType="HealthRecord">
insert into health_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null and name != ''">name,</if>
<if test="type != null and type != ''">type,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="occurTime != null">occur_time,</if>
<if test="rehabilitationTime != null">rehabilitation_time,</if>
<if test="initialSymptoms != null and initialSymptoms != ''">initial_symptoms,</if>
<if test="mediumTermSymptoms != null">medium_term_symptoms,</if>
<if test="laterStageSymptoms != null">later_stage_symptoms,</if>
<if test="etiology != null and etiology != ''">etiology,</if>
<if test="personId != null">person_id,</if>
<if test="state != null">state,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="type != null and type != ''">#{type},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="occurTime != null">#{occurTime},</if>
<if test="rehabilitationTime != null">#{rehabilitationTime},</if>
<if test="initialSymptoms != null and initialSymptoms != ''">#{initialSymptoms},</if>
<if test="mediumTermSymptoms != null">#{mediumTermSymptoms},</if>
<if test="laterStageSymptoms != null">#{laterStageSymptoms},</if>
<if test="etiology != null and etiology != ''">#{etiology},</if>
<if test="personId != null">#{personId},</if>
<if test="state != null">#{state},</if>
</trim>
</insert>
<update id="updateHealthRecord" parameterType="HealthRecord">
update health_record
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="type != null and type != ''">type = #{type},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="occurTime != null">occur_time = #{occurTime},</if>
<if test="rehabilitationTime != null">rehabilitation_time = #{rehabilitationTime},</if>
<if test="initialSymptoms != null and initialSymptoms != ''">initial_symptoms = #{initialSymptoms},</if>
<if test="mediumTermSymptoms != null">medium_term_symptoms = #{mediumTermSymptoms},</if>
<if test="laterStageSymptoms != null">later_stage_symptoms = #{laterStageSymptoms},</if>
<if test="etiology != null and etiology != ''">etiology = #{etiology},</if>
<if test="personId != null">person_id = #{personId},</if>
<if test="state != null">state = #{state},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthRecordById" parameterType="Long">
delete from health_record where id = #{id}
</delete>
<delete id="deleteHealthRecordByIds" parameterType="String">
delete from health_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeHealthRecordById" parameterType="Long">
update health_record set del_flag='1' where id = #{id}
</update>
<update id="removeHealthRecordByIds" parameterType="String">
update health_record set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,138 @@
<?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.intc.health.mapper.HealthTemperatureRecordMapper">
<resultMap type="HealthTemperatureRecordVo" id="HealthTemperatureRecordResult">
<result property="id" column="id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="healthRecordId" column="health_record_id" />
<result property="measureTime" column="measure_time" />
<result property="temperature" column="temperature" />
<result property="personId" column="person_id" />
<result property="personName" column="person_name" />
<result property="healthRecordName" column="health_record_name" />
</resultMap>
<sql id="selectHealthTemperatureRecordVo">
select
a.id,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
a.remark,
a.health_record_id,
a.measure_time,
a.temperature,
a.person_id,
hp."name" as person_name ,
hr."name" as health_record_name
from
health_temperature_record a
left join health_person hp on
hp.id = a.person_id
left join health_record hr on
hr.id = a.health_record_id
</sql>
<select id="selectHealthTemperatureRecordList" parameterType="HealthTemperatureRecordDto" resultMap="HealthTemperatureRecordResult">
<include refid="selectHealthTemperatureRecordVo"/>
<where>
a.del_flag='0'
<if test="healthRecordId != null "> and a.health_record_id = #{healthRecordId}</if>
<if test="measureTime != null "> and a.measure_time = #{measureTime}</if>
<if test="temperature != null "> and a.temperature = #{temperature}</if>
<if test="personId != null "> and a.person_id = #{personId}</if>
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(a.measure_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(a.measure_time, 'yyyy-MM-dd')>=#{startTime}
</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
order by a.measure_time desc
</select>
<select id="selectHealthTemperatureRecordById" parameterType="Long" resultMap="HealthTemperatureRecordResult">
<include refid="selectHealthTemperatureRecordVo"/>
where a.id = #{id}
</select>
<insert id="insertHealthTemperatureRecord" parameterType="HealthTemperatureRecord">
insert into health_temperature_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="healthRecordId != null">health_record_id,</if>
<if test="measureTime != null">measure_time,</if>
<if test="temperature != null">temperature,</if>
<if test="personId != null">person_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="healthRecordId != null">#{healthRecordId},</if>
<if test="measureTime != null">#{measureTime},</if>
<if test="temperature != null">#{temperature},</if>
<if test="personId != null">#{personId},</if>
</trim>
</insert>
<update id="updateHealthTemperatureRecord" parameterType="HealthTemperatureRecord">
update health_temperature_record
<trim prefix="SET" suffixOverrides=",">
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="healthRecordId != null">health_record_id = #{healthRecordId},</if>
<if test="measureTime != null">measure_time = #{measureTime},</if>
<if test="temperature != null">temperature = #{temperature},</if>
<if test="personId != null">person_id = #{personId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHealthTemperatureRecordById" parameterType="Long">
delete from health_temperature_record where id = #{id}
</delete>
<delete id="deleteHealthTemperatureRecordByIds" parameterType="String">
delete from health_temperature_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeHealthTemperatureRecordById" parameterType="Long">
update health_temperature_record set del_flag='1' where id = #{id}
</update>
<update id="removeHealthTemperatureRecordByIds" parameterType="String">
update health_temperature_record set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,603 @@
<?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.intc.health.mapper.StatisticAnalysisMapper">
<resultMap type="HealthMarRecordVo" id="HealthMarRecordResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="type" column="type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="healthRecordId" column="health_record_id" />
<result property="dosingTime" column="dosing_time" />
<result property="dosage" column="dosage" />
<result property="personId" column="person_id" />
<result property="resource" column="resource" />
<result property="place" column="place" />
<result property="medicineId" column="medicine_id" />
<result property="unit" column="unit" />
<result property="content" column="content" />
<result property="contentUnit" column="content_unit" />
<result property="personName" column="person_name" />
<result property="healthRecordName" column="health_record_name" />
<result property="useDays" column="useDays" />
<result property="count" column="count" />
<result property="dosingTimeStr" column="dosingTimeStr" />
</resultMap>
<select id="selectMarRecordList" parameterType="HealthMarRecordDto" resultMap="HealthMarRecordResult">
select
count(*) as count,
sum(hmr.dosage) as dosage,
hmr.medicine_id,
hmb."short_name"||'-'||hmb."brand"||'('||hmb.packaging||')' as name,
hmr.unit ,
hmr.person_id ,
hp."name" as person_name,
hmr.health_record_id as health_record_id,
hr."name" as health_record_name,
(
select
count(distinct to_char(t.dosing_time, 'yyyy-MM-dd'))
from
health_mar_record t
where
t.person_id = hmr.person_id
and t.health_record_id = hmr.health_record_id
and t.medicine_id = hmr.medicine_id
) as useDays
from
health_mar_record hmr
left join health_medicine_basic hmb on
hmb.id = hmr.medicine_id
left join health_person hp on
hp.id = hmr.person_id
left join health_record hr on
hr.id = hmr.health_record_id
<where>
hmr.del_flag = '0'
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(hmr.dosing_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(hmr.dosing_time, 'yyyy-MM-dd')>=#{startTime}
</if>
<if test="healthRecordId != null and healthRecordId != ''"> and hmr.health_record_id = #{healthRecordId}</if>
<if test="personId != null "> and hmr.person_id = #{personId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
group by
hmr.medicine_id,
hmb."short_name" ,
hmr.person_id ,
hp.name ,
hmr.health_record_id,
hr."name",
hmr.unit ,
hmb."brand",
hmb.packaging
order by hmb."short_name" desc
</select>
<select id="selectHospitalCount" parameterType="HealthMarRecordDto" resultType="int">
select
count(distinct hospital_name)
from
health_doctor_record hmr
left join health_record hr on hr.id=hmr.health_record_id
<where>
hmr.del_flag = '0'
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(hr.occur_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(hr.occur_time, 'yyyy-MM-dd')>=#{startTime}
</if>
<if test="healthRecordId != null and healthRecordId != ''"> and hmr.health_record_id = #{healthRecordId}</if>
<if test="personId != null "> and hmr.person_id = #{personId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectDoctorCount" parameterType="HealthMarRecordDto" resultType="int">
select
count(distinct doctor )
from
health_doctor_record hmr
left join health_record hr on hr.id=hmr.health_record_id
<where>
hmr.del_flag = '0'
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(hr.occur_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(hr.occur_time, 'yyyy-MM-dd')>=#{startTime}
</if>
<if test="healthRecordId != null and healthRecordId != ''"> and hmr.health_record_id = #{healthRecordId}</if>
<if test="personId != null "> and hmr.person_id = #{personId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectDistinctMedicalCount" parameterType="HealthMarRecordDto" resultType="int">
select
count(distinct medicine_id )
from
health_mar_record hmr
left join health_record hr on hr.id=hmr.health_record_id
<where>
hmr.del_flag = '0'
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(hr.occur_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(hr.occur_time, 'yyyy-MM-dd')>=#{startTime}
</if>
<if test="healthRecordId != null and healthRecordId != ''"> and hmr.health_record_id = #{healthRecordId}</if>
<if test="personId != null "> and hmr.person_id = #{personId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectMarTypeList" parameterType="HealthMarRecordDto" resultMap="HealthMarRecordResult">
select
hmr."type" ,
count(hmr."type" ) as count
from
health_mar_record hmr
left join health_record hr on hr.id=hmr.health_record_id
<where>
hmr.del_flag = '0'
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(hr.occur_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(hr.occur_time, 'yyyy-MM-dd')>=#{startTime}
</if>
<if test="healthRecordId != null and healthRecordId != ''"> and hmr.health_record_id = #{healthRecordId}</if>
<if test="personId != null "> and hmr.person_id = #{personId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
group by
hmr."type"
order by count(hmr."type" ) desc
</select>
<select id="selectMarDayCountList" parameterType="HealthMarRecordDto" resultMap="HealthMarRecordResult">
select
to_char(hmr.dosing_time, 'yyyy-MM-dd') as dosingTimeStr,
count(to_char(hmr.dosing_time, 'yyyy-MM-dd')) as count
from
health_mar_record hmr
left join health_record hr on hr.id=hmr.health_record_id
<where>
hmr.del_flag = '0'
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(hr.occur_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(hr.occur_time, 'yyyy-MM-dd')>=#{startTime}
</if>
<if test="healthRecordId != null and healthRecordId != ''"> and hmr.health_record_id = #{healthRecordId}</if>
<if test="personId != null "> and hmr.person_id = #{personId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
group by
to_char(hmr.dosing_time, 'yyyy-MM-dd')
order by to_char(hmr.dosing_time, 'yyyy-MM-dd')
</select>
<select id="selectMarDayCount" parameterType="HealthMarRecordDto" resultType="int">
select
count(distinct to_char(hmr.dosing_time, 'yyyy-MM-dd') )
from
health_mar_record hmr
left join health_record hr on hr.id=hmr.health_record_id
<where>
hmr.del_flag = '0'
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(hr.occur_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(hr.occur_time, 'yyyy-MM-dd')>=#{startTime}
</if>
<if test="healthRecordId != null and healthRecordId != ''"> and hmr.health_record_id = #{healthRecordId}</if>
<if test="personId != null "> and hmr.person_id = #{personId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectFeverDayCount" parameterType="HealthRecordDto" resultType="int">
select
count(distinct to_char(hmr.measure_time, 'yyyy-MM-dd') )
from
health_temperature_record hmr
left join health_record hr on hr.id=hmr.health_record_id
<where>
hmr.del_flag = '0' and hmr.temperature>=37
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(hr.occur_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(hr.occur_time, 'yyyy-MM-dd')>=#{startTime}
</if>
<if test="healthRecordId != null and healthRecordId != ''"> and hmr.health_record_id = #{healthRecordId}</if>
<if test="personId != null "> and hmr.person_id = #{personId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectStaticPersonList" parameterType="HealthRecordDto" resultType="com.intc.health.domain.vo.HealthStaticPersonVo">
select
hp."name" as personName,
(
select
count(*)
from
health_record hr
where
hr.person_id = hp.id
and hr.del_flag = '0') as healthRecordCount,
(
select
count(distinct hdr.hospital_name)
from
health_doctor_record hdr
where
hdr.person_id = hp.id
and hdr.del_flag = '0') as hospitalCount,
(
select
count(distinct hdr.doctor)
from
health_doctor_record hdr
where
hdr.person_id = hp.id
and hdr.del_flag = '0') as doctorTotalCount,
(
select
count(*)
from
health_doctor_record hdr
where
hdr.person_id = hp.id
and hdr.del_flag = '0') as doctorCount,
(
select
case when sum(hdr.total_cost) is null then 0
else sum(hdr.total_cost)
end
from
health_doctor_record hdr
where
hdr.person_id = hp.id
and hdr.del_flag = '0') as doctorCost,
(
select
count(distinct to_char(hmr.dosing_time, 'yyyy-MM-dd') )
from
health_mar_record hmr
where
hmr.person_id = hp.id
and hmr.del_flag = '0') as marDayCount,
(
select
count(*)
from
health_mar_record hmr
where
hmr.person_id = hp.id
and hmr.del_flag = '0') as marCount,
(
select
count(distinct hmr."medicine_id")
from
health_mar_record hmr
where
hmr.person_id = hp.id
and hmr.del_flag = '0') as marTypeCount,
(
select
count(distinct to_char(hmr.measure_time, 'yyyy-MM-dd') )
from
health_temperature_record hmr
where
hmr.person_id = hp.id
and hmr.temperature >= 37) as feverDayCount
from
health_person hp
where 1=1
<!-- 数据范围过滤 -->
${params.dataScope}
order by hp.ranking
</select>
<select id="selectHealthRecordCostList" parameterType="HealthRecordDto" resultType="com.intc.health.domain.vo.HealthRecordVo">
select
(
select
case
when sum(hdr.total_cost) is null then 0
else sum(hdr.total_cost)
end
from
health_doctor_record hdr
where
hdr.health_record_id = hr.id
and hdr.del_flag = '0') as doctorCost,
hr.id ,
hr."name",
hr.person_id
from
health_record hr
<where>
hr.del_flag = '0'
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(hr.occur_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(hr.occur_time, 'yyyy-MM-dd')>=#{startTime}
</if>
<if test="healthRecordId != null and healthRecordId != ''"> and hr.id = #{healthRecordId}</if>
<if test="personId != null "> and hr.person_id = #{personId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
order by hr.occur_time
</select>
<select id="selectHealthRecordList" parameterType="HealthRecordDto" resultType="com.intc.health.domain.vo.HealthRecordVo">
select
(
select
count(distinct hdr.hospital_name)
from
health_doctor_record hdr
where
hdr.health_record_id = hr.id
and hdr.del_flag = '0') as hospitalCount,
(
select
count(distinct hdr.doctor)
from
health_doctor_record hdr
where
hdr.health_record_id = hr.id
and hdr.del_flag = '0') as doctorTotalCount,
(
select
count(*)
from
health_doctor_record hdr
where
hdr.health_record_id = hr.id
and hdr.del_flag = '0') as doctorCount,
(
select
case
when sum(hdr.total_cost) is null then 0
else sum(hdr.total_cost)
end
from
health_doctor_record hdr
where
hdr.health_record_id = hr.id
and hdr.del_flag = '0') as doctorCost,
(
select
count(distinct to_char(hmr.dosing_time, 'yyyy-MM-dd') )
from
health_mar_record hmr
where
hmr.health_record_id = hr.id
and hmr.del_flag = '0') as marDayCount,
(
select
count(*)
from
health_mar_record hmr
where
hmr.health_record_id = hr.id
and hmr.del_flag = '0') as marCount,
(
select
count(*)
from
health_process_record hmr
where
hmr.health_record_id = hr.id
and hmr.del_flag = '0') as processCount,
(
select
count(distinct hmr."medicine_id")
from
health_mar_record hmr
where
hmr.health_record_id = hr.id
and hmr.del_flag = '0') as marTypeCount,
(
select
count(distinct to_char(hmr.measure_time, 'yyyy-MM-dd') )
from
health_temperature_record hmr
where
hmr.health_record_id = hr.id
and hmr.temperature >= 37) as feverDayCount,
hr.id ,
hr."name",
hr.occur_time as occurTime,
hr.rehabilitation_time as rehabilitationTime,
hr.person_id as personId
from
health_record hr
<where>
hr.del_flag = '0'
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(hr.occur_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(hr.occur_time, 'yyyy-MM-dd')>=#{startTime}
</if>
<if test="healthRecordId != null and healthRecordId != ''"> and hr.id = #{healthRecordId}</if>
<if test="personId != null "> and hr.person_id = #{personId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
order by hr.occur_time desc
</select>
<select id="selectDoctorRecordList" parameterType="HealthDoctorRecordDto" resultType="com.intc.health.domain.vo.HealthDoctorRecordVo">
select
hmr.id,
hmr.health_record_id as healthRecordId,
hmr.total_cost as totalCost
from
health_doctor_record hmr
left join health_record hr on
hr.id = hmr.health_record_id
<where>
hmr.del_flag = '0'
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(hr.occur_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(hr.occur_time, 'yyyy-MM-dd')>=#{startTime}
</if>
<if test="healthRecordId != null and healthRecordId != ''"> and hr.id = #{healthRecordId}</if>
<if test="personId != null "> and hr.person_id = #{personId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectMarCount" parameterType="HealthMarRecordDto" resultType="int">
select
count(*)
from
health_mar_record hmr
left join health_record hr on hr.id=hmr.health_record_id
<where>
hmr.del_flag = '0'
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(hr.occur_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(hr.occur_time, 'yyyy-MM-dd')>=#{startTime}
</if>
<if test="healthRecordId != null and healthRecordId != ''"> and hmr.health_record_id = #{healthRecordId}</if>
<if test="personId != null "> and hmr.person_id = #{personId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectProcessCount" parameterType="HealthMarRecordDto" resultType="int">
select
count(*)
from
health_process_record hmr
left join health_record hr on hr.id=hmr.health_record_id
<where>
hmr.del_flag = '0'
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(hr.occur_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(hr.occur_time, 'yyyy-MM-dd')>=#{startTime}
</if>
<if test="healthRecordId != null and healthRecordId != ''"> and hmr.health_record_id = #{healthRecordId}</if>
<if test="personId != null "> and hmr.person_id = #{personId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectHospitalStaticList" parameterType="HealthDoctorRecordDto" resultType="com.intc.health.domain.vo.HealthDoctorRecordVo">
select
count(hmr.hospital_name) as count,
hmr.hospital_name as hospitalName
from
health_doctor_record hmr
left join health_record hr on
hr.id = hmr.health_record_id
<where>
hmr.del_flag = '0'
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(hmr.visiting_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(hmr.visiting_time, 'yyyy-MM-dd')>=#{startTime}
</if>
<if test="healthRecordId != null"> and hmr.health_record_id = #{healthRecordId}</if>
<if test="personId != null "> and hr.person_id = #{personId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
group by hmr.hospital_name
order by count(hmr.hospital_name) desc
</select>
<select id="selectDoctorStaticList" parameterType="HealthDoctorRecordDto" resultType="com.intc.health.domain.vo.HealthDoctorRecordVo">
select
count(hmr.doctor) as count,
hmr.doctor,
hmr.hospital_name as hospitalName
from
health_doctor_record hmr
left join health_record hr on
hr.id = hmr.health_record_id
<where>
hmr.del_flag = '0'
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(hmr.visiting_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(hmr.visiting_time, 'yyyy-MM-dd')>=#{startTime}
</if>
<if test="healthRecordId != null"> and hmr.health_record_id = #{healthRecordId}</if>
<if test="personId != null "> and hr.person_id = #{personId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
group by hmr.hospital_name,hmr.doctor
order by count(hmr.doctor) desc
</select>
<select id="selectDepartStaticList" parameterType="HealthDoctorRecordDto" resultType="com.intc.health.domain.vo.HealthDoctorRecordVo">
select
count(hmr.departments) as count,
hmr.departments as departments
from
health_doctor_record hmr
left join health_record hr on
hr.id = hmr.health_record_id
<where>
hmr.del_flag = '0'
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(hmr.visiting_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(hmr.visiting_time, 'yyyy-MM-dd')>=#{startTime}
</if>
<if test="healthRecordId != null"> and hmr.health_record_id = #{healthRecordId}</if>
<if test="personId != null "> and hr.person_id = #{personId}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
group by hmr.departments
order by count(hmr.departments) desc
</select>
</mapper>