package org.dromara.web.mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; import org.dromara.web.domain.HospitalMealPlan; import org.dromara.web.domain.vo.HospitalMealPlanQueryVo; import org.dromara.web.domain.vo.HospitalMealPlanVo; import org.springframework.stereotype.Repository; import java.util.List; /** * 院内膳食主Mapper接口 * * @author Lion Li * @date 2025-07-23 */ @Repository public interface HospitalMealPlanMapper extends BaseMapperPlus { @Select("") List queryPageVoList(@Param("prescriptionType") String prescriptionType, @Param("visitType") String visitType, @Param("makeStatus") String makeStatus, @Param("paymentStatus") String paymentStatus, @Param("executeStatus") String executeStatus, @Param("doorId") Long doorId, @Param("wardId") Long wardId, @Param("searchValue") String searchValue, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("exeBeginTime") String exeBeginTime, @Param("exeEndTime") String exeEndTime, @Param("offset") Integer offset, @Param("rows") Integer rows); @Select("") Integer queryPageVoCount(@Param("prescriptionType") String prescriptionType, @Param("visitType") String visitType, @Param("makeStatus") String makeStatus, @Param("paymentStatus") String paymentStatus, @Param("executeStatus") String executeStatus, @Param("doorId") Long doorId, @Param("wardId") Long wardId, @Param("searchValue") String searchValue, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("exeBeginTime") String exeBeginTime, @Param("exeEndTime") String exeEndTime); // @Select( // """ // SELECT // `hospital_meal_plan`.`id` AS `id`, // `settlement`.`create_time` AS `tradeDate`, // `hospital_meal_plan`.`create_time` AS `calculationDate`, // `hospital_meal_plan`.`type` AS `consultationType`, // `doctor_dept`.`dept_name` AS `calculationDoctorDepartment`, // `sys_user`.`user_name` AS `calculationDoctor`, // `patient_dept`.`dept_name` AS `patientDepartment`, // `treatment_user`.`treat_name` AS `patientName`, // `settlement`.`payment_status` AS `payStatus`, // JSON_ARRAYAGG( // JSON_OBJECT( // `mealName`, `hospital_meal_recipe`.`food_name`, // `cookbooks`, JSON_ARRAYAGG( // JSON_OBJECT( // `cookbookName`, `` // ) // ) // ) // ) AS `mealPeriods` // FROM `hospital_meal_plan` // LEFT JOIN `settlement` // ON `settlement`.`id` = `hospital_meal_plan`.`settlement_id` AND // `settlement`.`create_time` >= #{tradeDateEarliest} AND // `settlement`.`create_time` <= #{tradeDateLatest} // LEFT JOIN `sys_dept` `patient_dept` // ON `patient_dept`.`dept_id` = `hospital_meal_plan`.`dept_id` // LEFT JOIN `sys_dept` `doctor_dept` // ON `doctor_dept`.`dept_id` = `hospital_meal_plan`.`create_dept` // LEFT JOIN `sys_user` // ON `sys_user`.`user_id` = `hospital_meal_plan`.`create_by` // LEFT JOIN `treatment_user` // ON `treatment_user`.`id` = `hospital_meal_plan`.`patient_id` // LEFT JOIN `hospital_meal_recipe` // ON `hospital_meal_recipe`.`plan_id` = `hospital_meal_plan`.`id` // LEFT JOIN `sys_recipe` // ON `hospital_meal_recipe`.`food_id` = `sys_recipe`.`recipe_id` // WHERE // `hospital_meal_plan`.`type` = #{consultationType} // AND `hospital_meal_plan`.`dept_id` = #{patientDepartmentId} // AND `hospital_meal_plan`.`create_time` >= #{calculationDateEarliest} // AND `hospital_meal_plan`.`create_time` <= #{calculationDateLatest} // AND `hospital_meal_plan`.`create_dept` = #{doctorDepartmentId} // AND `hospital_meal_plan`.`settlement_id` is not null // LIMIT #{pageNum * pageSize}, #{pageSize}; // """ // ) // DietaryPrescriptionVo listPageMealPlan( // @Param("tradeDateEarliest") Date tradeDateEarliest, @Param("tradeDateLatest") Date tradeDateLatest, // @Param("calculationDateEarliest") Date calculationDateEarliest, @Param("calculationDateLatest") Date calculationDateLatest, // @Param("doctorDepartmentId") Long doctorDepartmentId, @Param("patientDepartmentId") Long patientDepartmentId, // @Param("name") String name, @Param("consultationType") Integer consultationType, // @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize // ); }