一对多完善
This commit is contained in:
parent
e73d581adf
commit
1a6837f49e
@ -28,8 +28,6 @@ public class ClientPatientController extends BaseController {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String createAt = sdf.format(new Date());
|
||||
|
||||
FtPatientVo reportMealsToday = iFtPatientDaoService.getReportMealsToday("2020-12-29", patientId);
|
||||
|
||||
return AjaxResult.success(reportMealsToday);
|
||||
return AjaxResult.success(iFtPatientDaoService.getReportMealsToday("2020-12-29", patientId));
|
||||
}
|
||||
}
|
||||
|
@ -51,5 +51,5 @@ public interface FtPatientDaoMapper extends BaseMapper<FtPatientDao> {
|
||||
@Select("select a.hospital_id, a.name, a.depart_name, a.bed_id, b.depart_id, c.hospital_id as old_hospital_id, c.name as old_name, a.depart_name as old_depart_name, c.bed_id as old_bed_id, c.depart_id as old_depart_id, c.patient_id as patient_id from ft_sync a LEFT JOIN ft_depart b on a.depart_name = b.depart_name LEFT JOIN ft_patient c on a.hospital_id = c.hospital_id where b.depart_id = c.depart_id and a.bed_id = c.bed_id and a.name = c.name and c.hospital_id!=a.hospital_id")
|
||||
List<ftSyncConflictVo> syncConflictOtherAllEqual();
|
||||
|
||||
FtPatientVo getReportMealsToday(@Param("createAt") String createAt, @Param("patientId") Long patientId);
|
||||
List<FtPatientVo> getReportMealsToday(@Param("createAt") String createAt, @Param("patientId") Long patientId);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.system.fantang.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.system.fantang.domain.FtPatientDao;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.system.fantang.vo.FtPatientVo;
|
||||
@ -14,5 +15,5 @@ import java.util.List;
|
||||
*/
|
||||
public interface IFtPatientDaoService extends IService<FtPatientDao> {
|
||||
|
||||
FtPatientVo getReportMealsToday(String createAt, Long patientId );
|
||||
AjaxResult getReportMealsToday(String createAt, Long patientId );
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.system.fantang.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.system.fantang.vo.FtPatientVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -19,7 +20,7 @@ import java.util.List;
|
||||
public class FtPatientDaoServiceImpl extends ServiceImpl<FtPatientDaoMapper, FtPatientDao> implements IFtPatientDaoService {
|
||||
|
||||
@Override
|
||||
public FtPatientVo getReportMealsToday(String createAt, Long patientId) {
|
||||
return this.baseMapper.getReportMealsToday(createAt, patientId);
|
||||
public AjaxResult getReportMealsToday(String createAt, Long patientId) {
|
||||
return AjaxResult.success(this.baseMapper.getReportMealsToday(createAt, patientId));
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.fantang.mapper.FtPatientDaoMapper">
|
||||
|
||||
|
||||
<resultMap type="FtPatientDao" id="FtPatientDaoResult">
|
||||
<result property="patientId" column="patient_id" />
|
||||
<result property="name" column="name" />
|
||||
@ -14,6 +14,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="offFlag" column="off_flag" />
|
||||
<result property="createAt" column="create_at" />
|
||||
</resultMap>
|
||||
<select id="getReportMealsToday" 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 a.patient_id = #{patientId} and c.create_at = #{createAt}
|
||||
</select>
|
||||
<resultMap id="patientReportMealsList" type="com.ruoyi.system.fantang.vo.FtPatientVo">
|
||||
<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>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user