<?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.BabyEyePatientMapper">
<!-- <resultMap type="com.lyms.platform.pojo.BabyEyePatient" id="babyEyePatientMap">
<result column="id" property="id"/>
<result column="created" property="created"/>
<result column="yn" property="yn"/>
<result column="operater_id" property="operaterId"/>
<result column="hospital_id" property="hospitalId"/>
<result column="baby_id" property="babyId"/>
<result column="pid" property="pid"/>
<result column="name" property="name"/>
<result column="sex" property="sex"/>
<result column="card_no" property="cardNo"/>
<result column="birth" property="birth"/>
<result column="birth_desc" property="birthDesc"/>
<result column="nation_id" property="nationId"/>
<result column="province_id" property="provinceId"/>
<result column="city_id" property="cityId"/>
<result column="area_id" property="areaId"/>
<result column="street_id" property="streetId"/>
<result column="address" property="address"/>
<result column="zip_code" property="zipCode"/>
<result column="m_name" property="mName"/>
<result column="mc_card_type_id" property="mcCardTypeId"/>
<result column="m_card_no" property="mCardNo"/>
<result column="m_birth" property="mBirth"/>
<result column="m_age" property="mAge"/>
<result column="m_plevel_type_id" property="mPlevelTypeId"/>
<result column="m_profession_type_id" property="mProfessionTypeId"/>
<result column="m_phone" property="mPhone"/>
<result column="f_name" property="fName"/>
<result column="f_phone" property="fPhone"/>
<result column="f_birth" property="fBirth"/>
<result column="f_age" property="fAge"/>
<result column="f_plevel_type_id" property="fPlevelTypeId"/>
<result column="f_profession_type_id" property="fProfessionTypeId"/>
<result column="due_date" property="dueDate"/>
<result column="due_date_desc" property="dueDateDesc"/>
<result column="delivery_type" property="deliveryType"/>
<result column="delivery_type2" property="deliveryType2"/>
<result column="parity_num" property="parityNum"/>
<result column="product_num" property="productNum"/>
<result column="weight" property="weight"/>
<result column="length" property="length"/>
<result column="head" property="head"/>
<result column="apgar_one_min" property="apgarOneMin"/>
<result column="apga_five_min" property="apgaFiveMin"/>
<result column="apga_ten_min" property="apgaTenMin"/>
<result column="malformation" property="malformation"/>
<result column="fm_hospital_id" property="fmHospitalId"/>
<result column="m_high_risk_factor_ids" property="mHighRiskFactorId" />
<result column="gesell" property="gesell"/>
<result column="diagnosi_ids" property="diagnosiId" />
<result column="hospitalization_num" property="hospitalizationNum"/>
<!–<result column="ddIds" property="ddIds" />–>
<result column="doctor" property="doctor"/>
<result column="book_building_date" property="bookBuildingDate"/>
<result column="vc_card_no" property="vcCardNo"/>
<result column="bar_code" property="barCode"/>
<result column="remark" property="remark"/>
<result column="service_type" property="serviceType"/>
<result column="service_status" property="serviceStatus"/>
</resultMap>
<sql id="columnList">
created,yn,operater_id,hospital_id,baby_id,pid,name,sex,card_no,birth,birth_desc,nation_id,province_id,city_id,area_id,street_id,address,zip_code,m_name,mc_card_type_id,m_card_no,m_birth,m_age,m_plevel_type_id,m_profession_type_id,m_phone,f_name,f_phone,f_birth,f_age,f_plevel_type_id,f_profession_type_id,due_date,due_date_desc,delivery_type,delivery_type2,parity_num,product_num,weight,length,head,apgar_one_min,apga_five_min,apga_ten_min,malformation,fm_hospital_id,m_high_risk_factor_ids,gesell,diagnosi_ids,hospitalization_num,ddIds,doctor,book_building_date,vc_card_no,bar_code,remark,service_type,service_status
</sql>
<sql id="columnWhere">
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="created != null">
and created = #{created}
</if>
<if test="yn != null">
and yn = #{yn}
</if>
<if test="operaterId != null">
and operater_id = #{operaterId}
</if>
<if test="hospitalId != null">
and hospital_id = #{hospitalId}
</if>
<if test="babyId != null">
and baby_id = #{babyId}
</if>
<if test="pid != null">
and pid = #{pid}
</if>
<if test="name != null">
and name = #{name}
</if>
<if test="sex != null">
and sex = #{sex}
</if>
<if test="cardNo != null">
and card_no = #{cardNo}
</if>
<if test="birth != null">
and birth = #{birth}
</if>
<if test="birthDesc != null">
and birth_desc = #{birthDesc}
</if>
<if test="nationId != null">
and nation_id = #{nationId}
</if>
<if test="provinceId != null">
and province_id = #{provinceId}
</if>
<if test="cityId != null">
and city_id = #{cityId}
</if>
<if test="areaId != null">
and area_id = #{areaId}
</if>
<if test="streetId != null">
and street_id = #{streetId}
</if>
<if test="address != null">
and address = #{address}
</if>
<if test="zipCode != null">
and zip_code = #{zipCode}
</if>
<if test="mName != null">
and m_name = #{mName}
</if>
<if test="mcCardTypeId != null">
and mc_card_type_id = #{mcCardTypeId}
</if>
<if test="mCardNo != null">
and m_card_no = #{mCardNo}
</if>
<if test="mBirth != null">
and m_birth = #{mBirth}
</if>
<if test="mAge != null">
and m_age = #{mAge}
</if>
<if test="mPlevelTypeId != null">
and m_plevel_type_id = #{mPlevelTypeId}
</if>
<if test="mProfessionTypeId != null">
and m_profession_type_id = #{mProfessionTypeId}
</if>
<if test="mPhone != null">
and m_phone = #{mPhone}
</if>
<if test="fName != null">
and f_name = #{fName}
</if>
<if test="fPhone != null">
and f_phone = #{fPhone}
</if>
<if test="fBirth != null">
and f_birth = #{fBirth}
</if>
<if test="fAge != null">
and f_age = #{fAge}
</if>
<if test="fPlevelTypeId != null">
and f_plevel_type_id = #{fPlevelTypeId}
</if>
<if test="fProfessionTypeId != null">
and f_profession_type_id = #{fProfessionTypeId}
</if>
<if test="dueDate != null">
and due_date = #{dueDate}
</if>
<if test="dueDateDesc != null">
and due_date_desc = #{dueDateDesc}
</if>
<if test="deliveryType != null">
and delivery_type = #{deliveryType}
</if>
<if test="deliveryType2 != null">
and delivery_type2 = #{deliveryType2}
</if>
<if test="parityNum != null">
and parity_num = #{parityNum}
</if>
<if test="productNum != null">
and product_num = #{productNum}
</if>
<if test="weight != null">
and weight = #{weight}
</if>
<if test="length != null">
and length = #{length}
</if>
<if test="head != null">
and head = #{head}
</if>
<if test="apgarOneMin != null">
and apgar_one_min = #{apgarOneMin}
</if>
<if test="apgaFiveMin != null">
and apga_five_min = #{apgaFiveMin}
</if>
<if test="apgaTenMin != null">
and apga_ten_min = #{apgaTenMin}
</if>
<if test="malformation != null">
and malformation = #{malformation}
</if>
<if test="fmHospitalId != null">
and fm_hospital_id = #{fmHospitalId}
</if>
<if test="mHighRiskFactorId != null">
and m_high_risk_factor_ids = #{mHighRiskFactorId}
</if>
<if test="gesell != null">
and gesell = #{gesell}
</if>
<if test="diagnosiId != null">
and diagnosi_ids = #{diagnosiId}
</if>
<if test="hospitalizationNum != null">
and hospitalization_num = #{hospitalizationNum}
</if>
<if test="ddIds != null">
and ddIds = #{ddIds}
</if>
<if test="doctor != null">
and doctor = #{doctor}
</if>
<if test="bookBuildingDate != null">
and book_building_date = #{bookBuildingDate}
</if>
<if test="vcCardNo != null">
and vc_card_no = #{vcCardNo}
</if>
<if test="barCode != null">
and bar_code = #{barCode}
</if>
<if test="remark != null">
and remark = #{remark}
</if>
<if test="serviceType != null">
and service_type = #{serviceType}
</if>
<if test="serviceStatus != null">
and service_status = #{serviceStatus}
</if>
</where>
</sql>
<sql id="columnUpdate">
<set>
<if test="created != null">
created = #{created},
</if>
<if test="yn != null">
yn = #{yn},
</if>
<if test="operaterId != null">
operater_id = #{operaterId},
</if>
<if test="hospitalId != null">
hospital_id = #{hospitalId},
</if>
<if test="babyId != null">
baby_id = #{babyId},
</if>
<if test="pid != null">
pid = #{pid},
</if>
<if test="name != null">
name = #{name},
</if>
<if test="sex != null">
sex = #{sex},
</if>
<if test="cardNo != null">
card_no = #{cardNo},
</if>
<if test="birth != null">
birth = #{birth},
</if>
<if test="birthDesc != null">
birth_desc = #{birthDesc},
</if>
<if test="nationId != null">
nation_id = #{nationId},
</if>
<if test="provinceId != null">
province_id = #{provinceId},
</if>
<if test="cityId != null">
city_id = #{cityId},
</if>
<if test="areaId != null">
area_id = #{areaId},
</if>
<if test="streetId != null">
street_id = #{streetId},
</if>
<if test="address != null">
address = #{address},
</if>
<if test="zipCode != null">
zip_code = #{zipCode},
</if>
<if test="mName != null">
m_name = #{mName},
</if>
<if test="mcCardTypeId != null">
mc_card_type_id = #{mcCardTypeId},
</if>
<if test="mCardNo != null">
m_card_no = #{mCardNo},
</if>
<if test="mBirth != null">
m_birth = #{mBirth},
</if>
<if test="mAge != null">
m_age = #{mAge},
</if>
<if test="mPlevelTypeId != null">
m_plevel_type_id = #{mPlevelTypeId},
</if>
<if test="mProfessionTypeId != null">
m_profession_type_id = #{mProfessionTypeId},
</if>
<if test="mPhone != null">
m_phone = #{mPhone},
</if>
<if test="fName != null">
f_name = #{fName},
</if>
<if test="fPhone != null">
f_phone = #{fPhone},
</if>
<if test="fBirth != null">
f_birth = #{fBirth},
</if>
<if test="fAge != null">
f_age = #{fAge},
</if>
<if test="fPlevelTypeId != null">
f_plevel_type_id = #{fPlevelTypeId},
</if>
<if test="fProfessionTypeId != null">
f_profession_type_id = #{fProfessionTypeId},
</if>
<if test="dueDate != null">
due_date = #{dueDate},
</if>
<if test="dueDateDesc != null">
due_date_desc = #{dueDateDesc},
</if>
<if test="deliveryType != null">
delivery_type = #{deliveryType},
</if>
<if test="deliveryType2 != null">
delivery_type2 = #{deliveryType2},
</if>
<if test="parityNum != null">
parity_num = #{parityNum},
</if>
<if test="productNum != null">
product_num = #{productNum},
</if>
<if test="weight != null">
weight = #{weight},
</if>
<if test="length != null">
length = #{length},
</if>
<if test="head != null">
head = #{head},
</if>
<if test="apgarOneMin != null">
apgar_one_min = #{apgarOneMin},
</if>
<if test="apgaFiveMin != null">
apga_five_min = #{apgaFiveMin},
</if>
<if test="apgaTenMin != null">
apga_ten_min = #{apgaTenMin},
</if>
<if test="malformation != null">
malformation = #{malformation},
</if>
<if test="fmHospitalId != null">
fm_hospital_id = #{fmHospitalId},
</if>
<if test="mHighRiskFactorId != null">
m_high_risk_factor_ids = #{mHighRiskFactorId},
</if>
<if test="gesell != null">
gesell = #{gesell},
</if>
<if test="diagnosiId != null">
diagnosi_ids = #{diagnosiId},
</if>
<if test="hospitalizationNum != null">
hospitalization_num = #{hospitalizationNum},
</if>
<if test="ddIds != null">
ddIds = #{ddIds},
</if>
<if test="doctor != null">
doctor = #{doctor},
</if>
<if test="bookBuildingDate != null">
book_building_date = #{bookBuildingDate},
</if>
<if test="vcCardNo != null">
vc_card_no = #{vcCardNo},
</if>
<if test="barCode != null">
bar_code = #{barCode},
</if>
<if test="remark != null">
remark = #{remark},
</if>
<if test="serviceType != null">
service_type = #{serviceType},
</if>
<if test="serviceStatus != null">
service_status = #{serviceStatus}
</if>
</set>
</sql>
<select id="getById" resultMap="babyEyePatientMap">
select id,<include refid="columnList" /> from baby_ear_patient where id = #{id}
</select>
<select id="getListByCondition" parameterType="map" resultType="map">
select id,<include refid="columnList" /> from baby_ear_patient
<include refid="columnWhere" />
<if test="sort != null and sort == true">
order by id desc
</if>
<if test="currentPage != null and pageSize != null">
limit #{currentPage},#{pageSize}
</if>
</select>
<select id="getModelByCondition" parameterType="map" resultMap="babyEyePatientMap">
select id,<include refid="columnList" /> from baby_ear_patient
<include refid="columnWhere" />
<if test="sort != null and sort == true">
order by id desc
</if>
<if test="currentPage != null and pageSize != null">
limit #{currentPage},#{pageSize}
</if>
</select>
<select id="getCount" parameterType="map" resultType="integer">
select count(1) from baby_ear_patient
<include refid="columnWhere" />
</select>
<insert id="save" parameterType="com.lyms.platform.pojo.BabyEyePatient" useGeneratedKeys="true" keyProperty="id">
insert into baby_ear_patient(<include refid="columnList" />) values(#{created},#{yn},#{operaterId},#{hospitalId},#{babyId},#{pid},#{name},#{sex},#{cardNo},#{birth},#{birthDesc},#{nationId},#{provinceId},#{cityId},#{areaId},#{streetId},#{address},#{zipCode},#{mName},#{mcCardTypeId},#{mCardNo},#{mBirth},#{mAge},#{mPlevelTypeId},#{mProfessionTypeId},#{mPhone},#{fName},#{fPhone},#{fBirth},#{fAge},#{fPlevelTypeId},#{fProfessionTypeId},#{dueDate},#{dueDateDesc},#{deliveryType},#{deliveryType2},#{parityNum},#{productNum},#{weight},#{length},#{head},#{apgarOneMin},#{apgaFiveMin},#{apgaTenMin},#{malformation},#{fmHospitalId},#{mHighRiskFactorId},#{gesell},#{diagnosiId},#{hospitalizationNum},#{ddIds},#{doctor},#{bookBuildingDate},#{vcCardNo},#{barCode},#{remark},#{serviceType},#{serviceStatus})
</insert>
<delete id="deleteById" parameterType="integer">
delete from baby_ear_patient where id = #{id}
</delete>
<delete id="deleteByIds" parameterType="list">
delete from baby_ear_patient where id in
<foreach collection="list" open="(" close=")" separator="," item="id">
#{id}
</foreach>
</delete>
<update id="update" parameterType="com.lyms.platform.pojo.BabyEyePatient">
update baby_ear_patient
<include refid="columnUpdate" />
where id = #{id}
</update>-->
</mapper>