<?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="VARCHAR"/>
<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="abr_left" property="abrLeft" jdbcType="INTEGER"/>
<result column="abr_right" property="abrRight" 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="rrna_1494" property="rrna1494" jdbcType="INTEGER"/>
<result column="rrna_1555" property="rrna1555" 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="next_check_time" property="nextCheckTime" jdbcType="TIMESTAMP"/>
<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"/>
<result column="scr_ispass" property="scrIspass" jdbcType="INTEGER"/>
<result column="pid" property="pid" jdbcType="VARCHAR"/>
<result column="motherGjb2Del35" property="motherGjb2Del35" jdbcType="INTEGER"/>
<result column="motherGjb2Del176" property="motherGjb2Del176" jdbcType="INTEGER"/>
<result column="motherGjb2Del235" property="motherGjb2Del235" jdbcType="INTEGER"/>
<result column="motherGjb2Del299" property="motherGjb2Del299" jdbcType="INTEGER"/>
<result column="motherGjb3Slc26a4538" property="motherGjb3Slc26a4538" jdbcType="INTEGER"/>
<result column="motherGjb3Slc26a42168" property="motherGjb3Slc26a42168" jdbcType="INTEGER"/>
<result column="motherGjb3Slc26a4Ivs7" property="motherGjb3Slc26a4Ivs7" jdbcType="INTEGER"/>
<result column="motherRrna1494" property="motherRrna1494" jdbcType="INTEGER"/>
<result column="motherRrna1555" property="motherRrna1555" jdbcType="INTEGER"/>
<result column="doctorSign" property="doctorSign" jdbcType="VARCHAR"/>
<result column="patientSign" property="patientSign" jdbcType="VARCHAR"/>
</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,abr_left,abr_right,gjb2_del_35,gjb2_del_176,gjb2_del_235,gjb2_del_299,gjb3_slc26a4_538,gjb3_slc26a4_2168,gjb3_slc26a4_ivs7,rrna_1494,rrna_1555,process_option_type,process_option_desc,guid_opinion,check_doctor_id,referral_date,create_date,create_user_id,create_hospital_id,next_check_time,last_update_date,last_update_user_id,last_update_hospital_id,status,scr_ispass,pid,motherGjb2Del35,motherGjb2Del176,motherGjb2Del235,motherGjb2Del299,motherGjb3Slc26a4538,motherGjb3Slc26a42168,motherGjb3Slc26a4Ivs7,motherRrna1494,motherRrna1555,doctorSign,patientSign) values (#{id},#{babyId},#{screenType},#{checkHospitalId},#{screenDate},#{highRiskCause},#{oaeLeft},#{oaeRight},#{aabrLeft},#{aabrRight},#{abrLeft},#{abrRight},#{gjb2Del35},#{gjb2Del176},#{gjb2Del235},#{gjb2Del299},#{gjb3Slc26a4538},#{gjb3Slc26a42168},#{gjb3Slc26a4Ivs7},#{rrna1494},#{rrna1555},#{processOptionType},#{processOptionDesc},#{guidOpinion},#{checkDoctorId},#{referralDate},#{createDate},#{createUserId},#{createHospitalId},#{nextCheckTime},#{lastUpdateDate},#{lastUpdateUserId},#{lastUpdateHospitalId},#{status},#{scrIspass},#{pid},#{motherGjb2Del35},#{motherGjb2Del176},#{motherGjb2Del235},#{motherGjb2Del299},#{motherGjb3Slc26a4538},#{motherGjb3Slc26a42168},#{motherGjb3Slc26a4Ivs7},#{motherRrna1494},#{motherRrna1555},#{doctorSign},#{patientSign})
</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 != ''">
high_risk_cause = #{highRiskCause,jdbcType=VARCHAR},
</if>
<if test="oaeLeft != null">
oae_left = #{oaeLeft,jdbcType=INTEGER},
</if>
<if test="oaeRight != null">
oae_right = #{oaeRight,jdbcType=INTEGER},
</if>
<if test="aabrLeft != null">
aabr_left = #{aabrLeft,jdbcType=INTEGER},
</if>
<if test="aabrRight != null">
aabr_right = #{aabrRight,jdbcType=INTEGER},
</if>
<if test="abrLeft != null">
abr_left = #{abrLeft,jdbcType=INTEGER},
</if>
<if test="abrRight != null">
abr_right = #{abrRight,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="rrna1494 != null and rrna1494 >= 0">
rrna_1494 = #{rrna1494,jdbcType=INTEGER},
</if>
<if test="rrna1555 != null and rrna1555 >= 0">
rrna_1555 = #{rrna1555,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="nextCheckTime != null">
next_check_time = #{nextCheckTime,jdbcType=TIMESTAMP},
</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>
<if test="scrIspass != null and scrIspass >= 0">
scr_ispass = #{scrIspass,jdbcType=INTEGER},
</if>
<if test="pid != null and pid != ''">
pid = #{scrIspass,jdbcType=VARCHAR},
</if>
<if test="motherGjb2Del35 != null and motherGjb2Del35 >= 0">
motherGjb2Del35 = #{motherGjb2Del35,jdbcType=INTEGER},
</if>
<if test="motherGjb2Del176 != null and motherGjb2Del176 >= 0">
motherGjb2Del176 = #{motherGjb2Del176,jdbcType=INTEGER},
</if>
<if test="motherGjb2Del235 != null and motherGjb2Del235 >= 0">
motherGjb2Del235 = #{motherGjb2Del235,jdbcType=INTEGER},
</if>
<if test="motherGjb2Del299 != null and motherGjb2Del299 >= 0">
motherGjb2Del299 = #{motherGjb2Del299,jdbcType=INTEGER},
</if>
<if test="motherGjb3Slc26a4538 != null and motherGjb3Slc26a4538 >= 0">
motherGjb3Slc26a4538 = #{motherGjb3Slc26a4538,jdbcType=INTEGER},
</if>
<if test="motherGjb3Slc26a42168 != null and motherGjb3Slc26a42168 >= 0">
motherGjb3Slc26a42168 = #{motherGjb3Slc26a42168,jdbcType=INTEGER},
</if>
<if test="motherGjb3Slc26a4Ivs7 != null and motherGjb3Slc26a4Ivs7 >= 0">
motherGjb3Slc26a4Ivs7 = #{motherGjb3Slc26a4Ivs7,jdbcType=INTEGER},
</if>
<if test="motherRrna1494 != null and motherRrna1494 >= 0">
motherRrna1494 = #{motherRrna1494,jdbcType=INTEGER},
</if>
<if test="motherRrna1555 != null and motherRrna1555 >= 0">
motherRrna1555 = #{motherRrna1555,jdbcType=INTEGER},
</if>
<if test="doctorSign != null and doctorSign != ''">
doctorSign = #{doctorSign,jdbcType=VARCHAR},
</if>
<if test="patientSign != null and patientSign != ''">
patientSign = #{patientSign,jdbcType=VARCHAR},
</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,abr_left,abr_right,gjb2_del_35,gjb2_del_176,gjb2_del_235,gjb2_del_299,gjb3_slc26a4_538,gjb3_slc26a4_2168,gjb3_slc26a4_ivs7,rrna_1494,rrna_1555,process_option_type,process_option_desc,guid_opinion,check_doctor_id,referral_date,create_date,create_user_id,create_hospital_id,next_check_time,last_update_date,last_update_user_id,last_update_hospital_id,status,scr_ispass,pid,motherGjb2Del35,
motherGjb2Del176,
motherGjb2Del235,
motherGjb2Del299,
motherGjb3Slc26a4538,
motherGjb3Slc26a42168,
motherGjb3Slc26a4Ivs7,
motherRrna1494,
motherRrna1555,
doctorSign,
patientSign
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 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 != ''">
and high_risk_cause = #{highRiskCause,jdbcType=VARCHAR}
</if>
<if test="oaeLeft != null">
and oae_left = #{oaeLeft,jdbcType=INTEGER}
</if>
<if test="oaeRight != null">
and oae_right = #{oaeRight,jdbcType=INTEGER}
</if>
<if test="aabrLeft != null">
and aabr_left = #{aabrLeft,jdbcType=INTEGER}
</if>
<if test="aabrRight != null">
and aabr_right = #{aabrRight,jdbcType=INTEGER}
</if>
<if test="abrLeft != null">
and abr_left = #{abrLeft,jdbcType=INTEGER}
</if>
<if test="abrRight != null">
and abr_right = #{abrRight,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="nextCheckTime != null">
and next_check_time = #{nextCheckTime,jdbcType=TIMESTAMP}
</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>
<if test="scrIspass != null and scrIspass >= 0">
and scr_ispass = #{scrIspass,jdbcType=INTEGER}
</if>
<if test="pid != null and pid != ''">
and pid = #{pid,jdbcType=VARCHAR}
</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,abr_left,abr_right,gjb2_del_35,gjb2_del_176,gjb2_del_235,gjb2_del_299,gjb3_slc26a4_538,gjb3_slc26a4_2168,gjb3_slc26a4_ivs7,rrna_1494,rrna_1555,process_option_type,process_option_desc,guid_opinion,check_doctor_id,referral_date,create_date,create_user_id,create_hospital_id,last_update_date,next_check_time,last_update_user_id,last_update_hospital_id,status,scr_ispass,pid
from baby_patient_extend_ear_screen
<include refid="BabyPatientExtendEarScreenCondition"/>
<include refid="orderAndLimit"/>
</select>
<select id="queryEarScreenList" 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,abr_left,abr_right,gjb2_del_35,gjb2_del_176,gjb2_del_235,gjb2_del_299,gjb3_slc26a4_538,gjb3_slc26a4_2168,gjb3_slc26a4_ivs7,rrna_1494,rrna_1555,process_option_type,process_option_desc,guid_opinion,check_doctor_id,referral_date,create_date,create_user_id,create_hospital_id,last_update_date,next_check_time,last_update_user_id,last_update_hospital_id,status,scr_ispass,pid
from baby_patient_extend_ear_screen
<where>
status = 0
<if test="srcStartTime!=null">
AND
<![CDATA[
DATEDIFF(#{srcStartTime},screen_date) <=0
]]>
</if>
<if test="srcEndTime!=null">
and
<![CDATA[
DATEDIFF(#{srcEndTime},screen_date) >=0
]]>
</if>
<if test="screenType!=null and screenType >=0">
and screen_type = #{screenType}
</if>
<if test="checkDoctorId!=null and checkDoctorId != ''">
and check_doctor_id = #{checkDoctorId}
</if>
<if test="pid!=null and pid != ''">
and pid = #{pid}
</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="babyIds!=null">
and baby_id in (
<foreach item="babyId" collection="babyIds" separator=",">
#{babyId}
</foreach>
)
</if>
<if test="scrIspass != null and srcSkill==null and leftRight == null">
and scr_ispass = #{scrIspass,jdbcType=INTEGER}
</if>
<if test="srcSkill != null and srcSkill == 1">
<if test="scrIspass != null and scrIspass ==1">
and(
oae_left =1
and oae_right = 1
)
</if>
<if test="scrIspass != null and scrIspass ==2">
and(
oae_left =-1
and oae_right = -1
)
</if>
<if test="scrIspass == null">
and(
oae_left is not null
or oae_right is not null
)
</if>
</if>
<if test="srcSkill != null and srcSkill == 2">
<if test="scrIspass != null and scrIspass ==1">
and(
aabr_left =1
and aabr_right = 1
)
</if>
<if test="scrIspass != null and scrIspass ==2">
and(
aabr_left =-1
and aabr_right = -1
)
</if>
<if test="scrIspass == null">
and(
aabr_left is not null
or aabr_right is not null
)
</if>
</if>
<if test="srcSkill != null and srcSkill == 3">
<if test="scrIspass != null and scrIspass ==1">
and(
abr_left =1
and abr_right = 1
)
</if>
<if test="scrIspass != null and scrIspass ==2">
and(
abr_left =-1
and abr_right = -1
)
</if>
<if test="scrIspass == null">
and(
abr_left is not null
or abr_right is not null
)
</if>
</if>
<if test="leftRight!= null and leftRight == 1">
<if test="scrIspass != null and scrIspass ==1">
and(
oae_left =1
and aabr_left = 1
and abr_left = 1
)
and (oae_right =-1
OR aabr_right = -1
OR abr_right = -1
)
</if>
<if test="scrIspass != null and scrIspass ==2">
and(
oae_left =-1
OR aabr_left = -1
OR abr_left = -1
)
and (oae_right =1
and aabr_right = 1
and abr_right = 1
)
</if>
<if test="scrIspass == null">
and(
oae_left is not null
or aabr_left is not null
or abr_left is not null
)
</if>
</if>
<if test="leftRight!= null and leftRight == 2">
<if test="scrIspass != null and scrIspass ==1">
and(
oae_right =1
and aabr_right = 1
and abr_right = 1
)
and(
oae_left =-1
OR aabr_left = -1
OR abr_left = -1
)
</if>
<if test="scrIspass != null and scrIspass ==2">
and(
oae_right =-1
OR aabr_right = -1
OR abr_right = -1
)
and(
oae_left =1
and aabr_left = 1
and abr_left = 1
)
</if>
<if test="scrIspass == null">
and(
oae_right is not null
or aabr_right is not null
or abr_right is not null
)
</if>
</if>
<if test="leftRight!= null and leftRight == 3">
<if test="scrIspass != null and scrIspass ==1">
and(
oae_left =1
and aabr_left = 1
and abr_left = 1
and oae_right =1
and aabr_right = 1
and abr_right = 1
)
</if>
<if test="scrIspass != null and scrIspass ==2">
and (oae_left =-1
OR aabr_left = -1
OR abr_left = -1)
and (oae_right =-1
OR aabr_right = -1
OR abr_right = -1
)
</if>
<if test="scrIspass == null">
and(
oae_left is not null
or aabr_left is not null
or abr_left is not null
or oae_right is not null
or aabr_right is not null
or abr_right is not null
)
</if>
</if>
<if test="nextStartTime!=null">
AND
<![CDATA[
DATEDIFF(#{nextStartTime},next_check_time) <=0
]]>
</if>
<if test="nextEndTime!=null">
and
<![CDATA[
DATEDIFF(#{nextEndTime},next_check_time) >=0
]]>
</if>
<if test="status != null and status >= 0">
and status = #{status,jdbcType=INTEGER}
</if>
</where>
<include refid="orderAndLimit"/>
</select>
<select id="queryEarScreenListCount" resultType="int"
parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarScreenQuery">
select count(1) from baby_patient_extend_ear_screen
<where>
status = 0
<if test="srcStartTime!=null">
AND
<![CDATA[
DATEDIFF(#{srcStartTime},screen_date) <=0
]]>
</if>
<if test="srcEndTime!=null">
and
<![CDATA[
DATEDIFF(#{srcEndTime},screen_date) >=0
]]>
</if>
<if test="screenType!=null and screenType >=0">
and screen_type = #{screenType}
</if>
<if test="checkDoctorId!=null and checkDoctorId != ''">
and check_doctor_id = #{checkDoctorId}
</if>
<if test="pid!=null and pid != ''">
and pid = #{pid}
</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="babyIds!=null">
and baby_id in (
<foreach item="babyId" collection="babyIds" separator=",">
#{babyId}
</foreach>
)
</if>
<if test="scrIspass != null and srcSkill==null and leftRight == null">
and scr_ispass = #{scrIspass,jdbcType=INTEGER}
</if>
<if test="srcSkill != null and srcSkill == 1">
<if test="scrIspass != null and scrIspass ==1">
and(
oae_left =1
and oae_right = 1
)
</if>
<if test="scrIspass != null and scrIspass ==2">
and(
oae_left =-1
and oae_right = -1
)
</if>
<if test="scrIspass == null">
and(
oae_left is not null
or oae_right is not null
)
</if>
</if>
<if test="srcSkill != null and srcSkill == 2">
<if test="scrIspass != null and scrIspass ==1">
and(
aabr_left =1
and aabr_right = 1
)
</if>
<if test="scrIspass != null and scrIspass ==2">
and(
aabr_left =-1
and aabr_right = -1
)
</if>
<if test="scrIspass == null">
and(
aabr_left is not null
or aabr_right is not null
)
</if>
</if>
<if test="leftRight!= null and leftRight == 1">
<if test="scrIspass != null and scrIspass ==1">
and(
oae_left =1
and aabr_left = 1
)
</if>
<if test="scrIspass != null and scrIspass ==2">
and(
oae_left =-1
and aabr_left = -1
)
</if>
<if test="scrIspass == null">
and(
oae_left is not null
or aabr_left is not null
)
</if>
</if>
<if test="leftRight!= null and leftRight == 2">
<if test="scrIspass != null and scrIspass ==1">
and(
oae_right =1
and aabr_right = 1
)
</if>
<if test="scrIspass != null and scrIspass ==2">
and(
oae_right =-1
and aabr_right = -1
)
</if>
<if test="scrIspass == null">
and(
oae_right is not null
or aabr_right is not null
)
</if>
</if>
<if test="nextStartTime!=null">
AND
<![CDATA[
DATEDIFF(#{nextStartTime},next_check_time) <=0
]]>
</if>
<if test="nextEndTime!=null">
and
<![CDATA[
DATEDIFF(#{nextEndTime},next_check_time) >=0
]]>
</if>
<if test="status != null and status >= 0">
and status = #{status,jdbcType=INTEGER}
</if>
</where>
</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,abr_left,abr_right,gjb2_del_35,gjb2_del_176,gjb2_del_235,gjb2_del_299,gjb3_slc26a4_538,gjb3_slc26a4_2168,gjb3_slc26a4_ivs7,rrna_1494,rrna_1555,process_option_type,process_option_desc,guid_opinion,check_doctor_id,referral_date,create_date,create_user_id,create_hospital_id,last_update_date,next_check_time,last_update_user_id,last_update_hospital_id,status,scr_ispass,pid
from baby_patient_extend_ear_screen
<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 != ''">
and high_risk_cause = #{highRiskCause,jdbcType=VARCHAR}
</if>
<if test="oaeLeft != null">
and oae_left = #{oaeLeft,jdbcType=INTEGER}
</if>
<if test="oaeRight != null">
and oae_right = #{oaeRight,jdbcType=INTEGER}
</if>
<if test="aabrLeft != null">
and aabr_left = #{aabrLeft,jdbcType=INTEGER}
</if>
<if test="aabrRight != null">
and aabr_right = #{aabrRight,jdbcType=INTEGER}
</if>
<if test="abrLeft != null">
and abr_left = #{abrLeft,jdbcType=INTEGER}
</if>
<if test="abrRight != null">
and abr_right = #{abrRight,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="nextCheckTime != null">
and next_check_time = #{nextCheckTime,jdbcType=TIMESTAMP}
</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="pid != null and pid != ''">
and pid = #{pid,jdbcType=VARCHAR}
</if>
<if test="status != null and status >= 0">
and status = #{status,jdbcType=INTEGER}
</if>
<if test="scrIspass != null and scrIspass >= 0">
and scr_ispass = #{scrIspass,jdbcType=INTEGER}
</if>
</where>
<include refid="orderAndLimit"/>
</select>
<select id="dubiousScreen" 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,abr_left,abr_right,gjb2_del_35,gjb2_del_176,gjb2_del_235,gjb2_del_299,gjb3_slc26a4_538,gjb3_slc26a4_2168,gjb3_slc26a4_ivs7,rrna_1494,rrna_1555,process_option_type,process_option_desc,guid_opinion,check_doctor_id,referral_date,create_date,create_user_id,create_hospital_id,last_update_date,next_check_time,last_update_user_id,last_update_hospital_id,status,scr_ispass,pid
from baby_patient_extend_ear_screen
<where>
scr_ispass = 2
<if test="screenStartDate!=null">
and
<![CDATA[
DATEDIFF(#{screenStartDate},screen_date)<=0
]]>
</if>
<if test="screenEndDate!=null">
AND
<![CDATA[
DATEDIFF(#{screenEndDate},screen_date) >=0
]]>
</if>
<if test="checkDoctorId!=null and checkDoctorId != ''">
and check_doctor_id = #{checkDoctorId}
</if>
<if test="status != null and status >= 0">
and status = #{status,jdbcType=INTEGER}
</if>
<if test="pid!=null and pid != ''">
and pid = #{pid}
</if>
<if test="checkHospitalId != null and checkHospitalId != ''">
and check_hospital_id = #{checkHospitalId}
</if>
<if test="babyIds!=null">
and baby_id in (
<foreach item="babyId" collection="babyIds" separator=",">
#{babyId}
</foreach>
)
</if>
GROUP BY baby_id
</where>
</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>
1=1
<if test="checkHospitalIds!=null">
and sc.check_hospital_id in (
<foreach item="hsId" collection="checkHospitalIds" separator=",">
#{hsId}
</foreach>
)
</if>
<if test="checkHospitalId != null and checkHospitalId != ''">
and check_hospital_id = #{checkHospitalId,jdbcType=VARCHAR}
</if>
<if test="babyIds!=null">
and sc.baby_id in (
<foreach item="bId" collection="babyIds" separator=",">
#{bId}
</foreach>
)
</if>
and scr_ispass = 2
and screen_type = 2
</where>
</select>
</mapper>