2020-11-19 15:15:23 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
<!DOCTYPE mapper
|
2020-12-31 10:13:57 +08:00
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
2020-11-19 15:15:23 +08:00
|
|
|
<mapper namespace="com.ruoyi.system.fantang.mapper.FtPatientDaoMapper">
|
2020-12-29 18:41:11 +08:00
|
|
|
|
2020-11-19 15:15:23 +08:00
|
|
|
<resultMap type="FtPatientDao" id="FtPatientDaoResult">
|
2020-12-31 10:13:57 +08:00
|
|
|
<result property="patientId" column="patient_id"/>
|
|
|
|
<result property="name" column="name"/>
|
|
|
|
<result property="departId" column="depart_id"/>
|
|
|
|
<result property="bedId" column="bed_id"/>
|
|
|
|
<result property="hospitalId" column="hospital_id"/>
|
|
|
|
<result property="syncFlag" column="sync_flag"/>
|
|
|
|
<result property="offFlag" column="off_flag"/>
|
|
|
|
<result property="createAt" column="create_at"/>
|
2020-11-19 15:15:23 +08:00
|
|
|
</resultMap>
|
2020-12-29 18:41:11 +08:00
|
|
|
<select id="getReportMealsToday" resultMap="patientReportMealsList">
|
2020-12-31 10:13:57 +08:00
|
|
|
SELECT a.patient_id,
|
|
|
|
a.`name`,
|
|
|
|
b.depart_name,
|
|
|
|
a.bed_id,
|
|
|
|
a.hospital_id,
|
|
|
|
c.create_at,
|
|
|
|
c.foods,
|
|
|
|
c.id,
|
|
|
|
c.nutrition_food_id,
|
|
|
|
c.type
|
|
|
|
from ft_patient a
|
|
|
|
LEFT JOIN ft_depart b on a.depart_id = b.depart_id
|
|
|
|
RIGHT JOIN ft_report_meals c on a.patient_id = c.patient_id
|
|
|
|
WHERE a.patient_id = #{patientId}
|
|
|
|
and c.create_at = #{createAt}
|
2020-12-29 18:41:11 +08:00
|
|
|
</select>
|
|
|
|
<resultMap id="patientReportMealsList" type="com.ruoyi.system.fantang.vo.FtPatientVo">
|
2020-12-29 22:08:22 +08:00
|
|
|
<result property="patientId" column="patient_id"></result>
|
|
|
|
<result property="name" column="name"></result>
|
|
|
|
<result property="departName" column="depart_name"></result>
|
|
|
|
<result property="bedId" column="bed_id"></result>
|
|
|
|
<result property="hospitalId" column="hospital_id"></result>
|
2020-12-29 18:41:11 +08:00
|
|
|
<collection property="reportMealsList" ofType="com.ruoyi.system.fantang.domain.FtReportMealsDao">
|
|
|
|
<result property="id" column="id"></result>
|
|
|
|
<result property="createAt" column="create_at"></result>
|
|
|
|
<result property="type" column="type"></result>
|
|
|
|
<result property="foods" column="foods"></result>
|
|
|
|
<result property="nutritionFoodId" column="nutrition_food_id"></result>
|
|
|
|
</collection>
|
|
|
|
</resultMap>
|
2020-11-19 15:15:23 +08:00
|
|
|
|
|
|
|
|
2020-12-31 10:13:57 +08:00
|
|
|
<select id="getReportMealsByDepart" resultMap="patientReportMealsList">
|
|
|
|
SELECT a.patient_id,
|
|
|
|
a.`name`,
|
|
|
|
b.depart_name,
|
|
|
|
a.bed_id,
|
|
|
|
a.hospital_id,
|
|
|
|
c.create_at,
|
|
|
|
c.foods,
|
|
|
|
c.id,
|
|
|
|
c.nutrition_food_id,
|
|
|
|
c.type
|
|
|
|
from ft_patient a
|
|
|
|
LEFT JOIN ft_depart b on a.depart_id = b.depart_id
|
|
|
|
RIGHT JOIN ft_report_meals c on a.patient_id = c.patient_id
|
|
|
|
WHERE b.depart_id = #{departId}
|
|
|
|
and c.create_at = #{createAt}
|
2020-12-30 09:26:41 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
2020-11-19 15:15:23 +08:00
|
|
|
</mapper>
|