<?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.lyms.platform.permission.dao.master.MasterRisMapper">
<insert id="saveRisData" parameterType="com.lyms.platform.permission.model.RisReportModel">
INSERT INTO ris_report_info(
<if test="r_id != null and r_id!= ''">
R_ID,
</if>
<if test="title != null and title!= ''">
TITLE,
</if>
<if test="type != null and type!= ''">
TYPE,
</if>
<if test="vccardno != null and vccardno!= ''">
VCCARDNO,
</if>
<if test="name != null and name!= ''">
NAME,
</if>
<if test="bhnum != null and bhnum!= ''">
BHNUM,
</if>
<if test="phone != null and phone!= ''">
phone,
</if>
<if test="age != null and age!= ''">
AGE,
</if>
<if test="sex != null and sex!= ''">
SEX,
</if>
<if test="imgs != null and imgs!= ''">
IMGS,
</if>
<if test="item_finding != null and item_finding!= ''">
ITEM_FINDING,
</if>
<if test="item_diagnosis != null and item_diagnosis!= ''">
ITEM_DIAGNOSIS,
</if>
<if test="item_result != null and item_result!= ''">
ITEM_RESULT,
</if>
<if test="apply_time != null and apply_time!= ''">
APPLY_TIME,
</if>
<if test="check_time != null and check_time!= ''">
CHECK_TIME,
</if>
<if test="publish_time != null and publish_time!= ''">
PUBLISH_TIME,
</if>
<if test="apply_doctor != null and apply_doctor!= ''">
APPLY_DOCTOR,
</if>
<if test="apply_dept != null and apply_dept!= ''">
APPLY_DEPT,
</if>
<if test="checker != null and checker!= ''">
CHECKER,
</if>
<if test="modified != null and modified!= ''">
MODIFIED,
</if>
<if test="created != null and created!= ''">
CREATED,
</if>
<if test="hospital_id != null and hospital_id!= ''">
HOSPITAL_ID,
</if>
<if test="item_json != null and item_json!= ''">
ITEM_JSON
</if>
) VALUES (
<if test="r_id != null and r_id!= ''">
#{r_id},
</if>
<if test="title != null and title!= ''">
#{title},
</if>
<if test="type != null and type!= ''">
#{type},
</if>
<if test="vccardno != null and vccardno!= ''">
#{vccardno},
</if>
<if test="name != null and name!= ''">
#{name},
</if>
<if test="bhnum != null and bhnum!= ''">
#{bhnum},
</if>
<if test="phone != null and phone!= ''">
#{phone},
</if>
<if test="age != null and age!= ''">
#{age},
</if>
<if test="sex != null and sex!= ''">
#{sex},
</if>
<if test="imgs != null and imgs!= ''">
#{imgs},
</if>
<if test="item_finding != null and item_finding!= ''">
#{item_finding},
</if>
<if test="item_diagnosis != null and item_diagnosis!= ''">
#{item_diagnosis},
</if>
<if test="item_result != null and item_result!= ''">
#{item_result},
</if>
<if test="apply_time != null and apply_time!= ''">
#{apply_time},
</if>
<if test="check_time != null and check_time!= ''">
#{check_time},
</if>
<if test="publish_time != null and publish_time!= ''">
#{publish_time},
</if>
<if test="apply_doctor != null and apply_doctor!= ''">
#{apply_doctor},
</if>
<if test="apply_dept != null and apply_dept!= ''">
#{apply_dept},
</if>
<if test="checker != null and checker!= ''">
#{checker},
</if>
<if test="modified != null and modified!= ''">
#{modified},
</if>
<if test="created != null and created!= ''">
#{created},
</if>
<if test="hospital_id != null and hospital_id!= ''">
#{hospital_id},
</if>
<if test="item_json != null and item_json!= ''">
#{item_json}
</if>
)
</insert>
<insert id="saveRisItemsData" parameterType="java.util.List">
insert into ris_report_item (
R_ID,
CODE,
NAME,
RESULT,
RESULT_FLAG,
REF,
RESULT_TYPE,
UNIT,
PRINT_ORDER,
HOSPITAL_ID
)
values
<foreach collection="list" item="item" index="index" separator="," >
(
#{item.R_ID,jdbcType=VARCHAR},
#{item.CODE,jdbcType=VARCHAR},
#{item.NAME,jdbcType=VARCHAR},
#{item.RESULT,jdbcType=VARCHAR},
#{item.RESULT_FLAG,jdbcType=VARCHAR},
#{item.REF,jdbcType=VARCHAR},
#{item.RESULT_TYPE,jdbcType=VARCHAR},
#{item.UNIT,jdbcType=VARCHAR},
#{item.PRINT_ORDER,jdbcType=VARCHAR},
#{item.HOSPITAL_ID,jdbcType=VARCHAR}
)
</foreach>
</insert>
<delete id="deleteRisData" parameterType="com.lyms.platform.permission.model.LisReportModel">
DELETE FROM ris_report_info WHERE R_ID = #{R_ID} AND HOSPITAL_ID = #{HOSPITAL_ID}
</delete>
<delete id="deleteRisItemData" parameterType="com.lyms.platform.permission.model.LisReportItemModel">
DELETE FROM ris_report_item WHERE R_ID = #{R_ID} AND HOSPITAL_ID = #{HOSPITAL_ID}
</delete>
</mapper>