| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.smartor.mapper.MedicalHistoryBadyMapper"> |
| | | <mapper namespace="com.smartor.mapper.MedicalHistoryBabyMapper"> |
| | | |
| | | <resultMap type="com.smartor.domain.MedicalHistoryBady" id="MedicalHistoryBadyResult"> |
| | | <resultMap type="com.smartor.domain.MedicalHistoryBaby" id="MedicalHistoryBabyResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="procreate" column="procreate"/> |
| | | <result property="gestationIllnesses" column="gestation_illnesses"/> |
| | |
| | | <result property="outWeight" column="out_weight"/> |
| | | <result property="allergy" column="allergy"/> |
| | | <result property="feed" column="feed"/> |
| | | <result property="pid" column="pid"/> |
| | | <result property="patid" column="patid"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectMedicalHistoryBadyVo"> |
| | | select id, procreate, gestation_illnesses, family_history, surgical_history, birth_age, birth_weight, out_correct_age, out_weight, allergy, feed, pid |
| | | from medical_history_bady |
| | | <sql id="selectMedicalHistoryBabyVo"> |
| | | select id, procreate, gestation_illnesses, family_history, surgical_history, birth_age, birth_weight, out_correct_age, out_weight, allergy, feed, patid |
| | | from medical_history_baby |
| | | </sql> |
| | | |
| | | <select id="selectMedicalHistoryBadyList" parameterType="com.smartor.domain.MedicalHistoryBady" |
| | | resultMap="MedicalHistoryBadyResult"> |
| | | <include refid="selectMedicalHistoryBadyVo"/> |
| | | <select id="selectMedicalHistoryBabyList" parameterType="com.smartor.domain.MedicalHistoryBaby" |
| | | resultMap="MedicalHistoryBabyResult"> |
| | | <include refid="selectMedicalHistoryBabyVo"/> |
| | | <where> |
| | | del_flag=0 |
| | | <if test="procreate != null and procreate != ''"> |
| | |
| | | <if test="feed != null and feed != ''"> |
| | | and feed = #{feed} |
| | | </if> |
| | | <if test="pid != null "> |
| | | and pid = #{pid} |
| | | <if test="patid != null "> |
| | | and patid = #{patid} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectMedicalHistoryBadyById" parameterType="Long" |
| | | resultMap="MedicalHistoryBadyResult"> |
| | | <include refid="selectMedicalHistoryBadyVo"/> |
| | | <select id="selectMedicalHistoryBabyById" parameterType="Long" |
| | | resultMap="MedicalHistoryBabyResult"> |
| | | <include refid="selectMedicalHistoryBabyVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertMedicalHistoryBady" parameterType="com.smartor.domain.MedicalHistoryBady" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into medical_history_bady |
| | | <insert id="insertMedicalHistoryBaby" parameterType="com.smartor.domain.MedicalHistoryBaby" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into medical_history_baby |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="procreate != null">procreate, |
| | | </if> |
| | |
| | | </if> |
| | | <if test="feed != null">feed, |
| | | </if> |
| | | <if test="pid != null">pid, |
| | | <if test="patid != null">patid, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | |
| | | </if> |
| | | <if test="feed != null">#{feed}, |
| | | </if> |
| | | <if test="pid != null">#{pid}, |
| | | <if test="patid != null">#{patid}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateMedicalHistoryBady" parameterType="com.smartor.domain.MedicalHistoryBady"> |
| | | update medical_history_bady |
| | | <update id="updateMedicalHistoryBaby" parameterType="com.smartor.domain.MedicalHistoryBaby"> |
| | | update medical_history_baby |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="procreate != null">procreate = |
| | | #{procreate}, |
| | |
| | | <if test="feed != null">feed = |
| | | #{feed}, |
| | | </if> |
| | | <if test="pid != null">pid = |
| | | #{pid}, |
| | | <if test="patid != null">patid = |
| | | #{patid}, |
| | | </if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <update id="deleteMedicalHistoryBadyById" parameterType="Long"> |
| | | update medical_history_bady |
| | | <update id="deleteMedicalHistoryBabyById" parameterType="Long"> |
| | | update medical_history_baby |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | del_flag =1 |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <update id="deleteMedicalHistoryBadyByIds" parameterType="String"> |
| | | update medical_history_bady |
| | | <update id="deleteMedicalHistoryBabyByIds" parameterType="String"> |
| | | update medical_history_baby |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | del_flag =1 |
| | | </trim> |