病人配餐设置页面改造

This commit is contained in:
ryoeiken 2021-01-04 15:29:48 +08:00
parent d04a9c5cbb
commit 4bec2d207f
3 changed files with 33 additions and 5 deletions

View File

@ -97,6 +97,7 @@ public class FtCateringDaoController extends BaseController {
foodDemandDao.setType(type);
foodDemandDao.setNutritionFoodId(ftCateringDao.getNumber());
foodDemandDao.setCreateAt(new Date());
foodDemandDao.setNutritionFoodFlag(0);
iFtFoodDemandDaoService.save(foodDemandDao);
} else {
QueryWrapper<FtFoodDemandDao> wrapper = new QueryWrapper<>();
@ -105,6 +106,7 @@ public class FtCateringDaoController extends BaseController {
FtFoodDemandDao foodDemandDao = iFtFoodDemandDaoService.getOne(wrapper);
foodDemandDao.setNutritionFoodId(ftCateringDao.getNumber());
foodDemandDao.setUpdateAt(new Date());
foodDemandDao.setNutritionFoodFlag(0);
iFtFoodDemandDaoService.updateById(foodDemandDao);
}
}

View File

@ -1,5 +1,6 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
@ -125,4 +126,10 @@ public class FtFoodDemandDao extends BasePatient implements Serializable {
* 营养餐标志
**/
private Integer nutritionFoodFlag;
/**
* 营养餐名
*/
@TableField(exist = false)
private String nutritionFood;
}

View File

@ -25,18 +25,37 @@
</resultMap>
<select id="listNewFormatter" resultType="com.ruoyi.system.fantang.domain.FtFoodDemandDao">
select a.*, b.name, b.bed_id, c.depart_name, b.hospital_id from ft_food_demand a LEFT JOIN ft_patient b LEFT
JOIN ft_depart c on b.depart_id = c.depart_id on a.patient_id = b.patient_id where b.off_flag = 0
SELECT
a.*,
b.`name`,
b.bed_id,
c.depart_name,
b.hospital_id,
d.`name` AS nutrition_food
FROM
ft_food_demand a
LEFT JOIN ft_patient b
LEFT JOIN ft_depart c ON b.depart_id = c.depart_id ON a.patient_id = b.patient_id
LEFT JOIN ft_nutrition_food d ON d.id = a.nutrition_food_id
WHERE
b.off_flag = 0
<if test="name != null and name !=''">and b.name = #{name}</if>
<if test="bedId != null">and b.bed_id = #{bedId}</if>
<if test="departId != null">and b.depart_id = #{departId}</if>
<if test="hospitalId != null">and b.hospital_id = #{hospitalId}</if>
<if test="flag != null">and a.flag = #{flag}</if>
ORDER BY
patient_id ASC,
type ASC
</select>
<select id="getByIdNewFormatter" resultType="com.ruoyi.system.fantang.domain.FtFoodDemandDao">
select a.*, b.name, b.bed_id, c.depart_name, b.hospital_id from ft_food_demand a LEFT JOIN ft_patient b LEFT
JOIN ft_depart c on b.depart_id = c.depart_id on a.patient_id = b.patient_id where b.off_flag = 0 and a.id =
#{id}
select a.*, b.name, b.bed_id, c.depart_name, b.hospital_id
from ft_food_demand a
LEFT JOIN ft_patient b
LEFT JOIN ft_depart c on b.depart_id = c.depart_id on a.patient_id = b.patient_id
where b.off_flag = 0
and a.id =
#{id}
</select>
</mapper>