<?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.DtFmMapper">
<resultMap id="BaseResultMap" type="com.lyms.platform.pojo.DtFm">
<id property="id" column="id" jdbcType="INTEGER"/>
<result property="bhnum" column="bhnum" jdbcType="VARCHAR"/>
<result property="vccardno" column="vccardno" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="phone" column="phone" jdbcType="VARCHAR"/>
<result property="idcard" column="idCard" jdbcType="VARCHAR"/>
<result property="addr" column="addr" jdbcType="VARCHAR"/>
<result property="operation_CAUSE" column="operation_cause" jdbcType="VARCHAR"/>
<result property="fetus_NUM" column="fetus_num" jdbcType="INTEGER"/>
<result property="placenta_NUM" column="placenta_num" jdbcType="INTEGER"/>
<result property="delivery_MODE" column="delivery_mode" jdbcType="VARCHAR"/>
<result property="prod_PROCESS_ONE" column="prod_process_one" jdbcType="INTEGER"/>
<result property="prod_PROCESS_TWO" column="prod_process_two" jdbcType="INTEGER"/>
<result property="prod_PROCESS_THREE" column="prod_process_three" jdbcType="INTEGER"/>
<result property="total_PROCESS" column="total_process" jdbcType="VARCHAR"/>
<result property="silie_LEVEL" column="silie_level" jdbcType="INTEGER"/>
<result property="needle_NUM" column="needle_num" jdbcType="INTEGER"/>
<result property="maternal_INFO" column="maternal_info" jdbcType="VARCHAR"/>
<result property="death_CAUSE" column="death_cause" jdbcType="VARCHAR"/>
<result property="chbp" column="chbp" jdbcType="VARCHAR"/>
<result property="ch2BP" column="ch2bp" jdbcType="VARCHAR"/>
<result property="breath" column="breath" jdbcType="INTEGER"/>
<result property="pulse" column="pulse" jdbcType="INTEGER"/>
<result property="oh_LOSE_BLOOD" column="oh_lose_blood" jdbcType="INTEGER"/>
<result property="th_LOSE_BLOOD" column="th_lose_blood" jdbcType="INTEGER"/>
<result property="baby_SEX" column="baby_sex" jdbcType="VARCHAR"/>
<result property="tmctype" column="tmctype" jdbcType="VARCHAR"/>
<result property="perineal_CONDITION" column="perineal_condition" jdbcType="VARCHAR"/>
<result property="um_EXTYPE" column="um_extype" jdbcType="VARCHAR"/>
<result property="rh_LOSE_BLOOD" column="rh_lose_blood" jdbcType="INTEGER"/>
<result property="sh_LOSE_BLOOD" column="sh_lose_blood" jdbcType="INTEGER"/>
<result property="lose_BLOOD_CAUSE" column="lose_blood_cause" jdbcType="VARCHAR"/>
<result property="ocs" column="ocs" jdbcType="VARCHAR"/>
<result property="deliver_HOSPITAL" column="deliver_hospital" jdbcType="VARCHAR"/>
<result property="deliver_DOCTOR" column="deliver_doctor" jdbcType="VARCHAR"/>
<result property="baby_FETAL_PRESENTATION" column="baby_fetal_presentation" jdbcType="VARCHAR"/>
<result property="baby_FETAL_POSITION" column="baby_fetal_position" jdbcType="VARCHAR"/>
<result property="baby_DELIVERY_TIME" column="baby_delivery_time" jdbcType="TIMESTAMP"/>
<result property="baby_WEIGHT" column="baby_weight" jdbcType="VARCHAR"/>
<result property="baby_HEIGHT" column="baby_height" jdbcType="VARCHAR"/>
<result property="baby_APGAR_SCORE_ONE" column="baby_apgar_score_one" jdbcType="INTEGER"/>
<result property="baby_APGAR_SCORE_FIVE" column="baby_apgar_score_five" jdbcType="INTEGER"/>
<result property="baby_APGAR_SCORE_TEN" column="baby_apgar_score_ten" jdbcType="INTEGER"/>
<result property="baby_ASPHYXIAM" column="baby_asphyxiam" jdbcType="INTEGER"/>
<result property="baby_SICK" column="baby_sick" jdbcType="VARCHAR"/>
<result property="baby_TOUCH_STARTM" column="baby_touch_startm" jdbcType="INTEGER"/>
<result property="baby_TOUCH_LASTM" column="baby_touch_lastm" jdbcType="INTEGER"/>
<result property="baby_EARLYSUCK" column="baby_earlysuck" jdbcType="VARCHAR"/>
<result property="tmcside" column="tmcside" jdbcType="VARCHAR"/>
<result property="tlong" column="tlong" jdbcType="VARCHAR"/>
<result property="twidth" column="twidth" jdbcType="VARCHAR"/>
<result property="theight" column="theight" jdbcType="VARCHAR"/>
<result property="tweight" column="tweight" jdbcType="VARCHAR"/>
<result property="um_LENGTH" column="um_length" jdbcType="VARCHAR"/>
<result property="modified" column="modified" jdbcType="VARCHAR"/>
<result property="baby_PREGNANCY_OUT" column="baby_pregnancy_out" jdbcType="VARCHAR"/>
<result property="created" column="created" jdbcType="VARCHAR"/>
<result property="due_WEEK" column="due_week" jdbcType="VARCHAR"/>
<result property="due_DAY" column="due_day" jdbcType="VARCHAR"/>
<result property="baby_DEFORMITY" column="baby_deformity" jdbcType="INTEGER"/>
<result property="hospitalId" column="hospitalId" jdbcType="INTEGER"/>
<result property="isBuild" column="isBuild" jdbcType="INTEGER"/>
<result column="dateTime" property="date_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="orderAndLimit">
<if test="sort != null and sort != '' ">
order by ${sort}
<if test="need != null">
limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER}
</if>
</if>
</sql>
<sql id="fmCondition">
<where>
1 = 1
<if test="id != null">
AND id = #{id}
</if>
<if test="bhnum !=null">
AND bhnum=#{bhnum}
</if>
<if test="hospitalId != null">
AND hospitalId=#{hospitalId}
</if>
<if test="startTime != null">
and <![CDATA[date_time>=#{startTime}]]>
and <![CDATA[date_time<=#{endTime}]]>
</if>
<if test="deliveryStartTime !=null">
and <![CDATA[baby_delivery_time>=#{deliveryStartTime}]]>
and <![CDATA[baby_delivery_time<=#{deliveryEndTime}]]>
</if>
<if test="dueWeek !=null">
AND due_week like CONCAT(#{dueWeek}, '%')
</if>
<if test="isBuild !=null">
and isBuild =#{isBuild}
</if>
<if test="deliveryMode !=null">
AND delivery_mode=#{deliveryMode}
</if>
</where>
</sql>
<select id="queryFmList" resultMap="BaseResultMap">
select
id,bhnum,
vccardno,
name,
phone,
idCard,
addr,
created,
due_week,
fetus_num,
placenta_num,
delivery_mode,
hospitalId,
baby_sex,
tmctype,
baby_delivery_time,
date_time,
deliver_doctor,
isBuild
from delivery_info
<include refid="fmCondition"/>
<include refid="orderAndLimit"/>
</select>
<select id="queryFmListCount" resultType="int" parameterType="com.lyms.platform.permission.model.DtFmQuery">
select count(id)
from delivery_info
<include refid="fmCondition"/>
</select>
<insert id="saveFmData" parameterType="com.lyms.platform.pojo.DtFm">
INSERT INTO delivery_info(
bhnum,
vccardno,
name,
phone,
idCard,
addr,
fetus_num,
placenta_num,
delivery_mode,
operation_cause,
prod_process_one,
prod_process_two,
prod_process_three,
total_process,
silie_level,
needle_num,
maternal_info,
death_cause,
chbp,
ch2bp,
breath,
pulse,
oh_lose_blood,
th_lose_blood,
baby_sex,
tmctype,
perineal_condition,
um_extype,
rh_lose_blood,
sh_lose_blood,
lose_blood_cause,
ocs,
deliver_hospital,
deliver_doctor,
baby_fetal_presentation,
baby_fetal_position,
baby_delivery_time,
baby_weight,
baby_height,
baby_deformity,
baby_apgar_score_one,
baby_apgar_score_five,
baby_apgar_score_ten,
baby_asphyxiam,
baby_sick,
baby_touch_startm,
baby_touch_lastm,
baby_earlysuck,
tmcside,
tlong,
twidth,
theight,
tweight,
um_length,
modified,
baby_pregnancy_out,
created,
due_week,
due_day,
hospitalId,
date_time,
isBuild
) VALUES (
#{bhnum},
#{vccardno},
#{name},
#{phone},
#{idcard},
#{addr},
#{fetus_NUM},
#{placenta_NUM},
#{delivery_MODE},
#{operation_CAUSE},
#{prod_PROCESS_ONE},
#{prod_PROCESS_TWO},
#{prod_PROCESS_THREE},
#{total_PROCESS},
#{silie_LEVEL},
#{needle_NUM},
#{maternal_INFO},
#{death_CAUSE},
#{chbp},
#{ch2BP},
#{breath},
#{pulse},
#{oh_LOSE_BLOOD},
#{th_LOSE_BLOOD},
#{baby_SEX},
#{tmctype},
#{perineal_CONDITION},
#{um_EXTYPE},
#{rh_LOSE_BLOOD},
#{sh_LOSE_BLOOD},
#{lose_BLOOD_CAUSE},
#{ocs},
#{deliver_HOSPITAL},
#{deliver_DOCTOR},
#{baby_FETAL_PRESENTATION},
#{baby_FETAL_POSITION},
#{baby_DELIVERY_TIME},
#{baby_WEIGHT},
#{baby_HEIGHT},
#{baby_DEFORMITY},
#{baby_APGAR_SCORE_ONE},
#{baby_APGAR_SCORE_FIVE},
#{baby_APGAR_SCORE_TEN},
#{baby_ASPHYXIAM},
#{baby_SICK},
#{baby_TOUCH_STARTM},
#{baby_TOUCH_LASTM},
#{baby_EARLYSUCK},
#{tmcside},
#{tlong},
#{twidth},
#{theight},
#{tweight},
#{um_LENGTH},
#{modified},
#{baby_PREGNANCY_OUT},
#{created},
#{due_WEEK},
#{due_DAY},
#{hospitalId},
#{dateTime},
#{isBuild}
)
</insert>
</mapper>