Bonus-Cloud-Houqin/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/nutrition.common/HealthCustMedicalReportMapp...

65 lines
2.1 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.canteen.core.nutrition.common.mapper.HealthCustMedicalReportMapper">
<delete id="deleteCustReport">
DELETE
t1.*,
t2.*
FROM
health_cust_medical_report_project t1,
health_cust_medical_report_detail t2
WHERE
t1.medical_id = t2.medical_id
AND t1.medical_id = #{medicalId}
</delete>
<select id="pageMedicalReportInfo" resultType="com.bonus.canteen.core.nutrition.common.vo.HealthCustMedicalReportVO">
SELECT medical_id,
cust_id,
medical_date,
medical_mechanism,
medical_template_id
FROM health_cust_medical_report
WHERE cust_id = #{param.custId}
<if test="param.medicalDate != null">
AND medical_date = #{param.medicalDate}
</if>
ORDER BY medical_date DESC
</select>
<select id="listCustReport" resultType="com.bonus.canteen.core.nutrition.common.vo.HealthCustMedicalReportProjectVO">
SELECT medical_project_id,
medical_project_name
FROM health_cust_medical_report_project
WHERE medical_id = #{medicalId}
ORDER BY
medical_project_id
</select>
<select id="listCustHistoryReport" resultType="com.bonus.canteen.core.nutrition.common.vo.HealthHistoryReportInfoVO">
SELECT
medical_id,
medical_date
FROM
health_cust_medical_report
WHERE
cust_id = #{custId}
ORDER BY
medical_date DESC
</select>
<select id="listMedicalReport" resultType="com.bonus.canteen.core.nutrition.common.vo.HealthCustMedicalReportVO">
SELECT medical_id,
cust_id,
medical_date,
medical_mechanism,
medical_template_id
FROM health_cust_medical_report
WHERE cust_id = #{custId}
ORDER BY medical_date DESC
</select>
</mapper>