修复病人配餐查询

This commit is contained in:
ryoeiken 2020-12-07 16:06:10 +08:00
parent 99abbdb015
commit 3bb9e8a105
4 changed files with 49 additions and 32 deletions

View File

@ -39,7 +39,7 @@ public class FtFoodDemandDaoController extends BaseController {
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(FtFoodDemandDao ftFoodDemandDao) { public TableDataInfo list(FtFoodDemandDao ftFoodDemandDao) {
startPage(); startPage();
LambdaQueryWrapper<FtFoodDemandDao> lqw = Wrappers.lambdaQuery(ftFoodDemandDao); // LambdaQueryWrapper<FtFoodDemandDao> lqw = Wrappers.lambdaQuery(ftFoodDemandDao);
// List<FtFoodDemandDao> list = iFtFoodDemandDaoService.list(lqw); // List<FtFoodDemandDao> list = iFtFoodDemandDaoService.list(lqw);
List<FtFoodDemandDao> list = iFtFoodDemandDaoService.listNewFormatter(ftFoodDemandDao); List<FtFoodDemandDao> list = iFtFoodDemandDaoService.listNewFormatter(ftFoodDemandDao);
return getDataTable(list); return getDataTable(list);

View File

@ -115,4 +115,6 @@ public class FtFoodDemandDao extends BasePatient implements Serializable {
*/ */
@Excel(name = "启用状态") @Excel(name = "启用状态")
private Boolean flag; private Boolean flag;
private Long departId;
} }

View File

@ -1,30 +1,34 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.fantang.mapper.FtFoodDemandDaoMapper"> <mapper namespace="com.ruoyi.system.fantang.mapper.FtFoodDemandDaoMapper">
<resultMap type="FtFoodDemandDao" id="FtFoodDemandDaoResult"> <resultMap type="FtFoodDemandDao" id="FtFoodDemandDaoResult">
<result property="id" column="id" /> <result property="id" column="id"/>
<result property="patientId" column="patient_id" /> <result property="patientId" column="patient_id"/>
<result property="foods" column="foods" /> <result property="foods" column="foods"/>
<result property="type" column="type" /> <result property="type" column="type"/>
<result property="createAt" column="create_at" /> <result property="createAt" column="create_at"/>
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by"/>
<result property="updateAt" column="update_at" /> <result property="updateAt" column="update_at"/>
<result property="vegetables" column="vegetables" /> <result property="vegetables" column="vegetables"/>
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by"/>
<result property="meat" column="meat" /> <result property="meat" column="meat"/>
<result property="updateFrom" column="update_from" /> <result property="updateFrom" column="update_from"/>
<result property="rice" column="rice" /> <result property="rice" column="rice"/>
<result property="egg" column="egg" /> <result property="egg" column="egg"/>
<result property="orderInfo" column="order_info" /> <result property="orderInfo" column="order_info"/>
<result property="flag" column="flag" /> <result property="flag" column="flag"/>
</resultMap> </resultMap>
<select id="listNewFormatter" resultType="com.ruoyi.system.fantang.domain.FtFoodDemandDao"> <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 from ft_food_demand a LEFT JOIN ft_patient b LEFT
<if test="name != null">and b.name = #{name}</if> JOIN ft_depart c on b.depart_id = c.depart_id on a.patient_id = b.patient_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="hospitalId != null">and b.hospital_id = #{hospitalId}</if>
<if test="flag != null">and a.flag = #{flag}</if>
</select> </select>
</mapper> </mapper>

View File

@ -19,14 +19,15 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="科室" prop="departName"> <el-form-item label="科室" prop="departId">
<el-input <el-select v-model="queryParams.departId" placeholder="请选择科室">
v-model="queryParams.departName" <el-option
placeholder="请输入科室" v-for="item in departOptions"
clearable :key="item.departName"
size="small" :label="item.departName"
@keyup.enter.native="handleQuery" :value="item.departId">
/> </el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="住院号" prop="hospitalId"> <el-form-item label="住院号" prop="hospitalId">
<el-input <el-input
@ -93,7 +94,7 @@
<el-table-column label="加菜" align="center" prop="vegetables" width="80px" :formatter="formatVegetables"/> <el-table-column label="加菜" align="center" prop="vegetables" width="80px" :formatter="formatVegetables"/>
<el-table-column label="加肉" align="center" prop="meat" width="80px" :formatter="formatMeat"/> <el-table-column label="加肉" align="center" prop="meat" width="80px" :formatter="formatMeat"/>
<el-table-column label="加饭" align="center" prop="rice" width="80px" :formatter="formatRice"/> <el-table-column label="加饭" align="center" prop="rice" width="80px" :formatter="formatRice"/>
<el-table-column label="加蛋" align="center" prop="egg" width="80px" /> <el-table-column label="加蛋" align="center" prop="egg" width="80px"/>
<el-table-column label="营养配餐" align="center" prop="nutritionFood" width="120px"/> <el-table-column label="营养配餐" align="center" prop="nutritionFood" width="120px"/>
<!-- <el-table-column label="更新日期" align="center" prop="updateAt" width="180">--> <!-- <el-table-column label="更新日期" align="center" prop="updateAt" width="180">-->
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
@ -191,13 +192,15 @@ import {
updateFoodDemand updateFoodDemand
} from "@/api/fantang/foodDemand"; } from "@/api/fantang/foodDemand";
import {listFood} from "@/api/fantang/food"; import {listFood} from "@/api/fantang/food";
import {listDepart} from "@/api/fantang/depart";
export default { export default {
name: "FoodDemand", name: "FoodDemand",
components: {}, components: {},
data() { data() {
return { return {
foodList:[], departOptions:[],
foodList: [],
flagOptions: [{ flagOptions: [{
value: 1, value: 1,
label: '启用' label: '启用'
@ -231,7 +234,11 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
flag: null flag: null,
name: null,
bedId: null,
departName: null,
hospitalId: null,
}, },
// //
form: {}, form: {},
@ -252,6 +259,10 @@ export default {
this.getDicts("ft_update_from").then(response => { this.getDicts("ft_update_from").then(response => {
this.updateFromOptions = response.data; this.updateFromOptions = response.data;
}); });
listDepart().then(response => {
console.log(response);
this.departOptions = response.rows;
})
}, },
beforeCreate() { beforeCreate() {