<?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.BabyEyeCheckMapper">
	<resultMap type="com.lyms.platform.pojo.BabyEyeCheck" id="babyEyeCheckMap">
		<result column="id" property="id"/>
		<result column="created" property="created"/>
		<result column="yn" property="yn"/>
		<result column="operaterId" property="operaterId"/>
		<result column="hospitalId" property="hospitalId"/>
		<result column="babyId" property="babyId"/>
		<result column="pid" property="pid"/>
		<result column="checkMonthId" property="checkMonthId"/>
		<result column="checkHospital" property="checkHospital"/>
		<result column="checkTime" property="checkTime"/>
		<result column="riskFactor" property="riskFactor"/>
		<result column="extRightEyelook" property="extRightEyelook"/>
		<result column="extRightEyelookOther" property="extRightEyelookOther"/>
		<result column="blinkRightReflex" property="blinkRightReflex"/>
		<result column="pupillaryRightReflex" property="pupillaryRightReflex"/>
		<result column="redRightReflex" property="redRightReflex"/>
		<result column="extLeftEyelook" property="extLeftEyelook"/>
		<result column="extLeftEyelookOther" property="extLeftEyelookOther"/>
		<result column="blinkLefttReflex" property="blinkLefttReflex"/>
		<result column="pupillaryLeftReflex" property="pupillaryLeftReflex"/>
		<result column="redLeftReflex" property="redLeftReflex"/>
		<result column="fundusResult" property="fundusResult"/>
		<result column="handleOpinionsId" property="handleOpinionsId"/>
		<result column="guidanceOpinions" property="guidanceOpinions"/>
		<result column="doctor" property="doctor"/>
		<result column="nextCheckMonthId" property="nextCheckMonthId"/>
		<result column="nextCheckTime" property="nextCheckTime"/>
		<result column="extEyelook" property="extEyelook"/>
		<result column="extEyelookOther" property="extEyelookOther"/>
		<result column="redReflex" property="redReflex"/>
		<result column="redReflexOther" property="redReflexOther"/>
		<result column="r1" property="r1"/>
		<result column="r2" property="r2"/>
		<result column="l1" property="l1"/>
		<result column="l2" property="l2"/>
		<result column="optometry" property="optometry"/>
		<result column="conjunctiva" property="conjunctiva"/>
		<result column="conjunctivaOther" property="conjunctivaOther"/>
		<result column="corneal" property="corneal"/>
		<result column="cornealOther" property="cornealOther"/>
		<result column="lacrimalApparatus" property="lacrimalApparatus"/>
		<result column="lacrimalApparatusOther" property="lacrimalApparatusOther"/>
		<result column="eyeMovementsId" property="eyeMovementsId"/>
		<result column="eyePositionId" property="eyePositionId"/>
		<result column="eyePositionOther" property="eyePositionOther"/>
		<result column="binocularVision" property="binocularVision"/>
		<result column="other" property="other"/>
		<result column="lVision" property="lVision"/>
		<result column="rVision" property="rVision"/>
		<result column="refractionL1" property="refractionL1"/>
		<result column="refractionL2" property="refractionL2"/>
		<result column="refractionR1" property="refractionR1"/>
		<result column="refractionR2" property="refractionR2"/>
		<result column="nystagmus" property="nystagmus"/>
		<result column="fixationCard" property="fixationCard"/>
	</resultMap>
	<sql id="columnList">
		id,created,yn,operaterId,hospitalId,babyId,pid,checkMonthId,checkHospital,checkTime,riskFactor,extRightEyelook,extRightEyelookOther,blinkRightReflex,pupillaryRightReflex,redRightReflex,extLeftEyelook,extLeftEyelookOther,blinkLefttReflex,pupillaryLeftReflex,redLeftReflex,fundusResult,handleOpinionsId,guidanceOpinions,doctor,nextCheckMonthId,nextCheckTime,extEyelook,extEyelookOther,redReflex,redReflexOther,r1,r2,l1,l2,optometry,conjunctiva,conjunctivaOther,corneal,cornealOther,lacrimalApparatus,lacrimalApparatusOther,eyeMovementsId,eyePositionId,eyePositionOther,binocularVision,other,lVision,rVision,refractionL1,refractionL2,refractionR1,refractionR2,nystagmus,fixationCard
	</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 operaterId = #{operaterId}
			</if>
			<if test="hospitalId != null">
				and hospitalId = #{hospitalId}
			</if>
			<if test="babyId != null">
				and babyId = #{babyId}
			</if>
			<if test="pid != null">
				and pid = #{pid}
			</if>
			<if test="checkMonthId != null">
				and checkMonthId = #{checkMonthId}
			</if>
			<if test="checkHospital != null">
				and checkHospital = #{checkHospital}
			</if>
			<if test="checkTime != null">
				and checkTime = #{checkTime}
			</if>
			<if test="riskFactor != null">
				and riskFactor = #{riskFactor}
			</if>
			<if test="extRightEyelook != null">
				and extRightEyelook = #{extRightEyelook}
			</if>
			<if test="extRightEyelookOther != null">
				and extRightEyelookOther = #{extRightEyelookOther}
			</if>
			<if test="blinkRightReflex != null">
				and blinkRightReflex = #{blinkRightReflex}
			</if>
			<if test="pupillaryRightReflex != null">
				and pupillaryRightReflex = #{pupillaryRightReflex}
			</if>
			<if test="redRightReflex != null">
				and redRightReflex = #{redRightReflex}
			</if>
			<if test="extLeftEyelook != null">
				and extLeftEyelook = #{extLeftEyelook}
			</if>
			<if test="extLeftEyelookOther != null">
				and extLeftEyelookOther = #{extLeftEyelookOther}
			</if>
			<if test="blinkLefttReflex != null">
				and blinkLefttReflex = #{blinkLefttReflex}
			</if>
			<if test="pupillaryLeftReflex != null">
				and pupillaryLeftReflex = #{pupillaryLeftReflex}
			</if>
			<if test="redLeftReflex != null">
				and redLeftReflex = #{redLeftReflex}
			</if>
			<if test="fundusResult != null">
				and fundusResult = #{fundusResult}
			</if>
			<if test="handleOpinionsId != null">
				and handleOpinionsId = #{handleOpinionsId}
			</if>
			<if test="guidanceOpinions != null">
				and guidanceOpinions = #{guidanceOpinions}
			</if>
			<if test="doctor != null">
				and doctor = #{doctor}
			</if>
			<if test="nextCheckMonthId != null">
				and nextCheckMonthId = #{nextCheckMonthId}
			</if>
			<if test="nextCheckTime != null">
				and nextCheckTime = #{nextCheckTime}
			</if>
			<if test="extEyelook != null">
				and extEyelook = #{extEyelook}
			</if>
			<if test="extEyelookOther != null">
				and extEyelookOther = #{extEyelookOther}
			</if>
			<if test="redReflex != null">
				and redReflex = #{redReflex}
			</if>
			<if test="redReflexOther != null">
				and redReflexOther = #{redReflexOther}
			</if>
			<if test="r1 != null">
				and r1 = #{r1}
			</if>
			<if test="r2 != null">
				and r2 = #{r2}
			</if>
			<if test="l1 != null">
				and l1 = #{l1}
			</if>
			<if test="l2 != null">
				and l2 = #{l2}
			</if>
			<if test="optometry != null">
				and optometry = #{optometry}
			</if>
			<if test="conjunctiva != null">
				and conjunctiva = #{conjunctiva}
			</if>
			<if test="conjunctivaOther != null">
				and conjunctivaOther = #{conjunctivaOther}
			</if>
			<if test="corneal != null">
				and corneal = #{corneal}
			</if>
			<if test="cornealOther != null">
				and cornealOther = #{cornealOther}
			</if>
			<if test="lacrimalApparatus != null">
				and lacrimalApparatus = #{lacrimalApparatus}
			</if>
			<if test="lacrimalApparatusOther != null">
				and lacrimalApparatusOther = #{lacrimalApparatusOther}
			</if>
			<if test="eyeMovementsId != null">
				and eyeMovementsId = #{eyeMovementsId}
			</if>
			<if test="eyePositionId != null">
				and eyePositionId = #{eyePositionId}
			</if>
			<if test="eyePositionOther != null">
				and eyePositionOther = #{eyePositionOther}
			</if>
			<if test="binocularVision != null">
				and binocularVision = #{binocularVision}
			</if>
			<if test="other != null">
				and other = #{other}
			</if>
			<if test="lVision != null">
				and lVision = #{lVision}
			</if>
			<if test="rVision != null">
				and rVision = #{rVision}
			</if>
			<if test="refractionL1 != null">
				and refractionL1 = #{refractionL1}
			</if>
			<if test="refractionL2 != null">
				and refractionL2 = #{refractionL2}
			</if>
			<if test="refractionR1 != null">
				and refractionR1 = #{refractionR1}
			</if>
			<if test="refractionR2 != null">
				and refractionR2 = #{refractionR2}
			</if>
			<if test="nystagmus != null">
				and nystagmus = #{nystagmus}
			</if>
			<if test="fixationCard != null">
				and fixationCard = #{fixationCard}
			</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">
				operaterId = #{operaterId},
			</if>
			<if test="hospitalId != null">
				hospitalId = #{hospitalId},
			</if>
			<if test="babyId != null">
				babyId = #{babyId},
			</if>
			<if test="pid != null">
				pid = #{pid},
			</if>
			<if test="checkMonthId != null">
				checkMonthId = #{checkMonthId},
			</if>
			<if test="checkHospital != null">
				checkHospital = #{checkHospital},
			</if>
			<if test="checkTime != null">
				checkTime = #{checkTime},
			</if>
			<if test="riskFactor != null">
				riskFactor = #{riskFactor},
			</if>
			<if test="extRightEyelook != null">
				extRightEyelook = #{extRightEyelook},
			</if>
			<if test="extRightEyelookOther != null">
				extRightEyelookOther = #{extRightEyelookOther},
			</if>
			<if test="blinkRightReflex != null">
				blinkRightReflex = #{blinkRightReflex},
			</if>
			<if test="pupillaryRightReflex != null">
				pupillaryRightReflex = #{pupillaryRightReflex},
			</if>
			<if test="redRightReflex != null">
				redRightReflex = #{redRightReflex},
			</if>
			<if test="extLeftEyelook != null">
				extLeftEyelook = #{extLeftEyelook},
			</if>
			<if test="extLeftEyelookOther != null">
				extLeftEyelookOther = #{extLeftEyelookOther},
			</if>
			<if test="blinkLefttReflex != null">
				blinkLefttReflex = #{blinkLefttReflex},
			</if>
			<if test="pupillaryLeftReflex != null">
				pupillaryLeftReflex = #{pupillaryLeftReflex},
			</if>
			<if test="redLeftReflex != null">
				redLeftReflex = #{redLeftReflex},
			</if>
			<if test="fundusResult != null">
				fundusResult = #{fundusResult},
			</if>
			<if test="handleOpinionsId != null">
				handleOpinionsId = #{handleOpinionsId},
			</if>
			<if test="guidanceOpinions != null">
				guidanceOpinions = #{guidanceOpinions},
			</if>
			<if test="doctor != null">
				doctor = #{doctor},
			</if>
			<if test="nextCheckMonthId != null">
				nextCheckMonthId = #{nextCheckMonthId},
			</if>
			<if test="nextCheckTime != null">
				nextCheckTime = #{nextCheckTime},
			</if>
			<if test="extEyelook != null">
				extEyelook = #{extEyelook},
			</if>
			<if test="extEyelookOther != null">
				extEyelookOther = #{extEyelookOther},
			</if>
			<if test="redReflex != null">
				redReflex = #{redReflex},
			</if>
			<if test="redReflexOther != null">
				redReflexOther = #{redReflexOther},
			</if>
			<if test="r1 != null">
				r1 = #{r1},
			</if>
			<if test="r2 != null">
				r2 = #{r2},
			</if>
			<if test="l1 != null">
				l1 = #{l1},
			</if>
			<if test="l2 != null">
				l2 = #{l2},
			</if>
			<if test="optometry != null">
				optometry = #{optometry},
			</if>
			<if test="conjunctiva != null">
				conjunctiva = #{conjunctiva},
			</if>
			<if test="conjunctivaOther != null">
				conjunctivaOther = #{conjunctivaOther},
			</if>
			<if test="corneal != null">
				corneal = #{corneal},
			</if>
			<if test="cornealOther != null">
				cornealOther = #{cornealOther},
			</if>
			<if test="lacrimalApparatus != null">
				lacrimalApparatus = #{lacrimalApparatus},
			</if>
			<if test="lacrimalApparatusOther != null">
				lacrimalApparatusOther = #{lacrimalApparatusOther},
			</if>
			<if test="eyeMovementsId != null">
				eyeMovementsId = #{eyeMovementsId},
			</if>
			<if test="eyePositionId != null">
				eyePositionId = #{eyePositionId},
			</if>
			<if test="eyePositionOther != null">
				eyePositionOther = #{eyePositionOther},
			</if>
			<if test="binocularVision != null">
				binocularVision = #{binocularVision},
			</if>
			<if test="other != null">
				other = #{other},
			</if>
			<if test="lVision != null">
				lVision = #{lVision},
			</if>
			<if test="rVision != null">
				rVision = #{rVision},
			</if>
			<if test="refractionL1 != null">
				refractionL1 = #{refractionL1},
			</if>
			<if test="refractionL2 != null">
				refractionL2 = #{refractionL2},
			</if>
			<if test="refractionR1 != null">
				refractionR1 = #{refractionR1},
			</if>
			<if test="refractionR2 != null">
				refractionR2 = #{refractionR2},
			</if>
			<if test="nystagmus != null">
				nystagmus = #{nystagmus},
			</if>
			<if test="fixationCard != null">
				fixationCard = #{fixationCard}
			</if>
		</set>
	</sql>
	<select id="getById" resultMap="babyEyeCheckMap">
		select id,<include refid="columnList" /> from baby_eye_check where id = #{id}
	</select>
	<select id="getListByCondition" parameterType="map" resultType="map">
		select id,<include refid="columnList" /> from baby_eye_check
		<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="babyEyeCheckMap">
		select id,<include refid="columnList" /> from baby_eye_check
		<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_eye_check
		<include refid="columnWhere" />
	</select>
	<insert id="save" parameterType="com.lyms.platform.pojo.BabyEyeCheck">
		insert into baby_eye_check(<include refid="columnList" />) values(#{id},#{created},#{yn},#{operaterId},#{hospitalId},#{babyId},#{pid},#{checkMonthId},#{checkHospital},#{checkTime},#{riskFactor},#{extRightEyelook},#{extRightEyelookOther},#{blinkRightReflex},#{pupillaryRightReflex},#{redRightReflex},#{extLeftEyelook},#{extLeftEyelookOther},#{blinkLefttReflex},#{pupillaryLeftReflex},#{redLeftReflex},#{fundusResult},#{handleOpinionsId},#{guidanceOpinions},#{doctor},#{nextCheckMonthId},#{nextCheckTime},#{extEyelook},#{extEyelookOther},#{redReflex},#{redReflexOther},#{r1},#{r2},#{l1},#{l2},#{optometry},#{conjunctiva},#{conjunctivaOther},#{corneal},#{cornealOther},#{lacrimalApparatus},#{lacrimalApparatusOther},#{eyeMovementsId},#{eyePositionId},#{eyePositionOther},#{binocularVision},#{other},#{lVision},#{rVision},#{refractionL1},#{refractionL2},#{refractionR1},#{refractionR2},#{nystagmus},#{fixationCard})
	</insert>
	<delete id="deleteById" parameterType="String">
		update baby_eye_check
		set yn = 0
		where id = #{id}
	</delete>
	<delete id="deleteByIds" parameterType="list">
		delete from baby_eye_check where id in
		<foreach collection="list" open="(" close=")" separator="," item="id">
			#{id}
		</foreach>
	</delete>
	<update id="update" parameterType="com.lyms.platform.pojo.BabyEyeCheck">
		update baby_eye_check
		<include refid="columnUpdate" />
		where id = #{id}
	</update>
</mapper>