<?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.BabyPatientExtendEarScreenMapper">
<resultMap id="BabyPatientExtendEarScreenResultMap"
type="com.lyms.platform.permission.model.BabyPatientExtendEarScreen">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="baby_id" property="babyId" jdbcType="VARCHAR"/>
<result column="screen_type" property="screenType" jdbcType="INTEGER"/>
<result column="check_hospital_id" property="checkHospitalId" jdbcType="VARCHAR"/>
<result column="screen_date" property="screenDate" jdbcType="TIMESTAMP"/>
<result column="high_risk_cause" property="highRiskCause" jdbcType="INTEGER"/>
<result column="oae_left" property="oaeLeft" jdbcType="INTEGER"/>
<result column="oae_right" property="oaeRight" jdbcType="INTEGER"/>
<result column="aabr_left" property="aabrLeft" jdbcType="INTEGER"/>
<result column="aabr_right" property="aabrRight" jdbcType="INTEGER"/>
<result column="gjb2_del_35" property="gjb2Del35" jdbcType="INTEGER"/>
<result column="gjb2_del_176" property="gjb2Del176" jdbcType="INTEGER"/>
<result column="gjb2_del_235" property="gjb2Del235" jdbcType="INTEGER"/>
<result column="gjb2_del_299" property="gjb2Del299" jdbcType="INTEGER"/>
<result column="gjb3_slc26a4_538" property="gjb3Slc26a4538" jdbcType="INTEGER"/>
<result column="gjb3_slc26a4_2168" property="gjb3Slc26a42168" jdbcType="INTEGER"/>
<result column="gjb3_slc26a4_ivs7" property="gjb3Slc26a4Ivs7" jdbcType="INTEGER"/>
<result column="process_option_type" property="processOptionType" jdbcType="INTEGER"/>
<result column="process_option_desc" property="processOptionDesc" jdbcType="VARCHAR"/>
<result column="guid_opinion" property="guidOpinion" jdbcType="VARCHAR"/>
<result column="check_doctor_id" property="checkDoctorId" jdbcType="VARCHAR"/>
<result column="referral_date" property="referralDate" jdbcType="TIMESTAMP"/>
<result column="create_date" property="createDate" jdbcType="TIMESTAMP"/>
<result column="create_user_id" property="createUserId" jdbcType="VARCHAR"/>
<result column="create_hospital_id" property="createHospitalId" jdbcType="VARCHAR"/>
<result column="last_update_date" property="lastUpdateDate" jdbcType="TIMESTAMP"/>
<result column="last_update_user_id" property="lastUpdateUserId" jdbcType="VARCHAR"/>
<result column="last_update_hospital_id" property="lastUpdateHospitalId" jdbcType="VARCHAR"/>
<result column="status" property="status" jdbcType="INTEGER"/>
</resultMap>
<insert id="addBabyPatientExtendEarScreen"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarScreen">
insert into baby_patient_extend_ear_screen (id,baby_id,screen_type,check_hospital_id,screen_date,high_risk_cause,oae_left,oae_right,aabr_left,aabr_right,gjb2_del_35,gjb2_del_176,gjb2_del_235,gjb2_del_299,gjb3_slc26a4_538,gjb3_slc26a4_2168,gjb3_slc26a4_ivs7,process_option_type,process_option_desc,guid_opinion,check_doctor_id,referral_date,create_date,create_user_id,create_hospital_id,last_update_date,last_update_user_id,last_update_hospital_id,status) values (#{id},#{babyId},#{screenType},#{checkHospitalId},#{screenDate},#{highRiskCause},#{oaeLeft},#{oaeRight},#{aabrLeft},#{aabrRight},#{gjb2Del35},#{gjb2Del176},#{gjb2Del235},#{gjb2Del299},#{gjb3Slc26a4538},#{gjb3Slc26a42168},#{gjb3Slc26a4Ivs7},#{processOptionType},#{processOptionDesc},#{guidOpinion},#{checkDoctorId},#{referralDate},#{createDate},#{createUserId},#{createHospitalId},#{lastUpdateDate},#{lastUpdateUserId},#{lastUpdateHospitalId},#{status})
</insert>
<update id="updateBabyPatientExtendEarScreen"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarScreen">
update baby_patient_extend_ear_screen
<set>
<if test="babyId != null and babyId != ''">
baby_id = #{babyId,jdbcType=VARCHAR},
</if>
<if test="screenType != null and screenType >= 0">
screen_type = #{screenType,jdbcType=INTEGER},
</if>
<if test="checkHospitalId != null and checkHospitalId != ''">
check_hospital_id = #{checkHospitalId,jdbcType=VARCHAR},
</if>
<if test="screenDate != null">
screen_date = #{screenDate,jdbcType=TIMESTAMP},
</if>
<if test="highRiskCause != null and highRiskCause >= 0">
high_risk_cause = #{highRiskCause,jdbcType=INTEGER},
</if>
<if test="oaeLeft != null and oaeLeft >= 0">
oae_left = #{oaeLeft,jdbcType=INTEGER},
</if>
<if test="oaeRight != null and oaeRight >= 0">
oae_right = #{oaeRight,jdbcType=INTEGER},
</if>
<if test="aabrLeft != null and aabrLeft >= 0">
aabr_left = #{aabrLeft,jdbcType=INTEGER},
</if>
<if test="aabrRight != null and aabrRight >= 0">
aabr_right = #{aabrRight,jdbcType=INTEGER},
</if>
<if test="gjb2Del35 != null and gjb2Del35 >= 0">
gjb2_del_35 = #{gjb2Del35,jdbcType=INTEGER},
</if>
<if test="gjb2Del176 != null and gjb2Del176 >= 0">
gjb2_del_176 = #{gjb2Del176,jdbcType=INTEGER},
</if>
<if test="gjb2Del235 != null and gjb2Del235 >= 0">
gjb2_del_235 = #{gjb2Del235,jdbcType=INTEGER},
</if>
<if test="gjb2Del299 != null and gjb2Del299 >= 0">
gjb2_del_299 = #{gjb2Del299,jdbcType=INTEGER},
</if>
<if test="gjb3Slc26a4538 != null and gjb3Slc26a4538 >= 0">
gjb3_slc26a4_538 = #{gjb3Slc26a4538,jdbcType=INTEGER},
</if>
<if test="gjb3Slc26a42168 != null and gjb3Slc26a42168 >= 0">
gjb3_slc26a4_2168 = #{gjb3Slc26a42168,jdbcType=INTEGER},
</if>
<if test="gjb3Slc26a4Ivs7 != null and gjb3Slc26a4Ivs7 >= 0">
gjb3_slc26a4_ivs7 = #{gjb3Slc26a4Ivs7,jdbcType=INTEGER},
</if>
<if test="processOptionType != null and processOptionType >= 0">
process_option_type = #{processOptionType,jdbcType=INTEGER},
</if>
<if test="processOptionDesc != null and processOptionDesc != ''">
process_option_desc = #{processOptionDesc,jdbcType=VARCHAR},
</if>
<if test="guidOpinion != null and guidOpinion != ''">
guid_opinion = #{guidOpinion,jdbcType=VARCHAR},
</if>
<if test="checkDoctorId != null and checkDoctorId != ''">
check_doctor_id = #{checkDoctorId,jdbcType=VARCHAR},
</if>
<if test="referralDate != null">
referral_date = #{referralDate,jdbcType=TIMESTAMP},
</if>
<if test="createDate != null">
create_date = #{createDate,jdbcType=TIMESTAMP},
</if>
<if test="createUserId != null and createUserId != ''">
create_user_id = #{createUserId,jdbcType=VARCHAR},
</if>
<if test="createHospitalId != null and createHospitalId != ''">
create_hospital_id = #{createHospitalId,jdbcType=VARCHAR},
</if>
<if test="lastUpdateDate != null">
last_update_date = #{lastUpdateDate,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdateUserId != null and lastUpdateUserId != ''">
last_update_user_id = #{lastUpdateUserId,jdbcType=VARCHAR},
</if>
<if test="lastUpdateHospitalId != null and lastUpdateHospitalId != ''">
last_update_hospital_id = #{lastUpdateHospitalId,jdbcType=VARCHAR},
</if>
<if test="status != null and status >= 0">
status = #{status,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<delete id="deleteBabyPatientExtendEarScreen" parameterType="java.lang.String">
delete from baby_patient_extend_ear_screen where id = #{id,jdbcType=VARCHAR}
</delete>
<select id="getBabyPatientExtendEarScreen" resultMap="BabyPatientExtendEarScreenResultMap"
parameterType="java.lang.String">
select id,baby_id,screen_type,check_hospital_id,screen_date,high_risk_cause,oae_left,oae_right,aabr_left,aabr_right,gjb2_del_35,gjb2_del_176,gjb2_del_235,gjb2_del_299,gjb3_slc26a4_538,gjb3_slc26a4_2168,gjb3_slc26a4_ivs7,process_option_type,process_option_desc,guid_opinion,check_doctor_id,referral_date,create_date,create_user_id,create_hospital_id,last_update_date,last_update_user_id,last_update_hospital_id,status
from baby_patient_extend_ear_screen where id = #{id,jdbcType=VARCHAR}
</select>
<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="BabyPatientExtendEarScreenCondition">
<where>
1 = 1
<if test="id != null and id != ''">
and id = #{id,jdbcType=VARCHAR}
</if>
<if test="babyId != null and babyId != ''">
and baby_id = #{babyId,jdbcType=VARCHAR}
</if>
<if test="babyIds != null ">
and baby_id not in
<foreach item="item" index="index" collection="babyIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="screenType != null and screenType >= 0">
and screen_type = #{screenType,jdbcType=INTEGER}
</if>
<if test="checkHospitalIds != null ">
and check_hospital_id in
<foreach item="item" index="index" collection="checkHospitalIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="checkHospitalId != null and checkHospitalId != ''">
and check_hospital_id = #{checkHospitalId,jdbcType=VARCHAR}
</if>
<if test="screenDate != null">
and screen_date = #{screenDate,jdbcType=TIMESTAMP}
</if>
<if test="highRiskCause != null and highRiskCause >= 0">
and high_risk_cause = #{highRiskCause,jdbcType=INTEGER}
</if>
<if test="oaeLeft != null and oaeLeft >= 0">
and oae_left = #{oaeLeft,jdbcType=INTEGER}
</if>
<if test="oaeRight != null and oaeRight >= 0">
and oae_right = #{oaeRight,jdbcType=INTEGER}
</if>
<if test="aabrLeft != null and aabrLeft >= 0">
and aabr_left = #{aabrLeft,jdbcType=INTEGER}
</if>
<if test="aabrRight != null and aabrRight >= 0">
and aabr_right = #{aabrRight,jdbcType=INTEGER}
</if>
<if test="gjb2Del35 != null and gjb2Del35 >= 0">
and gjb2_del_35 = #{gjb2Del35,jdbcType=INTEGER}
</if>
<if test="gjb2Del176 != null and gjb2Del176 >= 0">
and gjb2_del_176 = #{gjb2Del176,jdbcType=INTEGER}
</if>
<if test="gjb2Del235 != null and gjb2Del235 >= 0">
and gjb2_del_235 = #{gjb2Del235,jdbcType=INTEGER}
</if>
<if test="gjb2Del299 != null and gjb2Del299 >= 0">
and gjb2_del_299 = #{gjb2Del299,jdbcType=INTEGER}
</if>
<if test="gjb3Slc26a4538 != null and gjb3Slc26a4538 >= 0">
and gjb3_slc26a4_538 = #{gjb3Slc26a4538,jdbcType=INTEGER}
</if>
<if test="gjb3Slc26a42168 != null and gjb3Slc26a42168 >= 0">
and gjb3_slc26a4_2168 = #{gjb3Slc26a42168,jdbcType=INTEGER}
</if>
<if test="gjb3Slc26a4Ivs7 != null and gjb3Slc26a4Ivs7 >= 0">
and gjb3_slc26a4_ivs7 = #{gjb3Slc26a4Ivs7,jdbcType=INTEGER}
</if>
<if test="processOptionType != null and processOptionType >= 0">
and process_option_type = #{processOptionType,jdbcType=INTEGER}
</if>
<if test="processOptionDesc != null and processOptionDesc != ''">
and process_option_desc = #{processOptionDesc,jdbcType=VARCHAR}
</if>
<if test="guidOpinion != null and guidOpinion != ''">
and guid_opinion = #{guidOpinion,jdbcType=VARCHAR}
</if>
<if test="checkDoctorId != null and checkDoctorId != ''">
and check_doctor_id = #{checkDoctorId,jdbcType=VARCHAR}
</if>
<if test="referralDate != null">
and referral_date = #{referralDate,jdbcType=TIMESTAMP}
</if>
<if test="createDate != null">
and create_date = #{createDate,jdbcType=TIMESTAMP}
</if>
<if test="createUserId != null and createUserId != ''">
and create_user_id = #{createUserId,jdbcType=VARCHAR}
</if>
<if test="createHospitalId != null and createHospitalId != ''">
and create_hospital_id = #{createHospitalId,jdbcType=VARCHAR}
</if>
<if test="lastUpdateDate != null">
and last_update_date = #{lastUpdateDate,jdbcType=TIMESTAMP}
</if>
<if test="lastUpdateUserId != null and lastUpdateUserId != ''">
and last_update_user_id = #{lastUpdateUserId,jdbcType=VARCHAR}
</if>
<if test="lastUpdateHospitalId != null and lastUpdateHospitalId != ''">
and last_update_hospital_id = #{lastUpdateHospitalId,jdbcType=VARCHAR}
</if>
<if test="status != null and status >= 0">
and status = #{status,jdbcType=INTEGER}
</if>
</where>
</sql>
<select id="queryBabyPatientExtendEarScreen" resultMap="BabyPatientExtendEarScreenResultMap"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarScreenQuery">
select
id,baby_id,screen_type,check_hospital_id,screen_date,high_risk_cause,oae_left,oae_right,aabr_left,aabr_right,gjb2_del_35,gjb2_del_176,gjb2_del_235,gjb2_del_299,gjb3_slc26a4_538,gjb3_slc26a4_2168,gjb3_slc26a4_ivs7,process_option_type,process_option_desc,guid_opinion,check_doctor_id,referral_date,create_date,create_user_id,create_hospital_id,last_update_date,last_update_user_id,last_update_hospital_id,status
from baby_patient_extend_ear_screen
<include refid="BabyPatientExtendEarScreenCondition"/>
<include refid="orderAndLimit"/>
</select>
<select id="notAuscultationBabyPatientExtendEarScreen" resultMap="BabyPatientExtendEarScreenResultMap"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarScreenQuery">
select
id,baby_id,screen_type,check_hospital_id,screen_date,high_risk_cause,oae_left,oae_right,aabr_left,aabr_right,gjb2_del_35,gjb2_del_176,gjb2_del_235,gjb2_del_299,gjb3_slc26a4_538,gjb3_slc26a4_2168,gjb3_slc26a4_ivs7,process_option_type,process_option_desc,guid_opinion,check_doctor_id,referral_date,create_date,create_user_id,create_hospital_id,last_update_date,last_update_user_id,last_update_hospital_id,status
from baby_patient_extend_ear_screen
<include refid="BabyPatientExtendEarScreenCondition"/>
<include refid="orderAndLimit"/>
</select>
<select id="queryBabyPatientExtendEarScreenCount" resultType="int"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarScreenQuery">
select count(1) from baby_patient_extend_ear_screen
<include refid="BabyPatientExtendEarScreenCondition"/>
</select>
<select id="queryScrBabyIds" parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarScreenQuery" resultType="String">
select DISTINCT baby_id from baby_patient_extend_ear_screen sc
<where>
<if test="checkHospitalIds!=null">
and sc.check_hospital_id in (
<foreach item="hsId" collection="checkHospitalIds" separator=",">
#{hsId}
</foreach>
)
</if>
/*根据儿童id进行查询*/
<if test="babyIds!=null">
and sc.baby_id in (
<foreach item="bId" collection="babyIds" separator=",">
#{bId}
</foreach>
)
</if>
ORDER BY sc.create_date DESC
</where>
</select>
</mapper>