<?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.BabyAutismPrimaryScreeningMapper">
<resultMap id="BabyAutismPrimaryScreeningMap" type="com.lyms.platform.pojo.BabyAutismPrimaryScreening">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="created" column="created" jdbcType="VARCHAR"/>
<result property="modified" column="modified" jdbcType="VARCHAR"/>
<result property="yn" column="yn" jdbcType="INTEGER"/>
<result property="operaterId" column="operater_id" jdbcType="VARCHAR"/>
<result property="hospitalId" column="hospital_id" jdbcType="VARCHAR"/>
<result property="babyId" column="baby_id" jdbcType="VARCHAR"/>
<result property="babyBuildDate" column="baby_build_date" jdbcType="VARCHAR"/>
<result property="babyName" column="baby_name" jdbcType="VARCHAR"/>
<result property="babySex" column="baby_sex" jdbcType="INTEGER"/>
<result property="babyMName" column="baby_m_name" jdbcType="VARCHAR"/>
<result property="babyFName" column="baby_f_name" jdbcType="VARCHAR"/>
<result property="babyMPhone" column="baby_m_phone" jdbcType="VARCHAR"/>
<result property="babyFPhone" column="baby_f_phone" jdbcType="VARCHAR"/>
<result property="babyMCertNo" column="baby_m_cert_no" jdbcType="VARCHAR"/>
<result property="babyFCertNo" column="baby_f_cert_no" jdbcType="VARCHAR"/>
<result property="pid" column="pid" jdbcType="VARCHAR"/>
<result property="checkMonthAge" column="check_month_age" jdbcType="VARCHAR"/>
<result property="checkMonthId" column="check_month_id" jdbcType="VARCHAR"/>
<result property="birth" column="birth" jdbcType="VARCHAR"/>
<result property="checkTime" column="check_time" jdbcType="VARCHAR"/>
<result property="nextCheckTime" column="next_check_time" jdbcType="VARCHAR"/>
<result property="doctor" column="check_doctor" jdbcType="VARCHAR"/>
<result property="doctorSign" column="doctor_sign" jdbcType="VARCHAR"/>
<result property="patientSign" column="patient_sign" jdbcType="VARCHAR"/>
<result property="guidanceOpinions" column="guidance_opinions" jdbcType="VARCHAR"/>
<result property="handleOpinions" column="handle_opinions" jdbcType="VARCHAR"/>
<result property="warningSignstring" column="warning_signs" jdbcType="VARCHAR"/>
<result property="languageSocialstirng" column="language_social" jdbcType="VARCHAR"/>
<result property="global" column="preliminary_screening_results" jdbcType="VARCHAR"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="BabyAutismPrimaryScreeningMap">
select
id, created, modified, yn, operater_id, hospital_id, baby_id, baby_build_date, baby_name, baby_sex, baby_m_name, baby_f_name, baby_m_phone, baby_f_phone, baby_m_cert_no, baby_f_cert_no, pid, check_month_age, check_month_id, birth, check_time, next_check_time, check_doctor, doctor_sign, patient_sign, guidance_opinions, handle_opinions, warning_signs, language_social, preliminary_screening_results
from baby_autism_primary_screening
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="BabyAutismPrimaryScreeningMap">
select
id, created, modified, yn, operater_id, hospital_id, baby_id, baby_build_date, baby_name, baby_sex, baby_m_name, baby_f_name, baby_m_phone, baby_f_phone, baby_m_cert_no, baby_f_cert_no, pid, check_month_age, check_month_id, birth, check_time, next_check_time, check_doctor, doctor_sign, patient_sign, guidance_opinions, handle_opinions, warning_signs, language_social, preliminary_screening_results
from baby_autism_primary_screening
<where>
<if test="id != null and id != ''">
and id = #{id}
</if>
<if test="created != null and created != ''">
and created = #{created}
</if>
<if test="modified != null and modified != ''">
and modified = #{modified}
</if>
<if test="yn != null">
and yn = #{yn}
</if>
<if test="operaterId != null and operaterId != ''">
and operater_id = #{operaterId}
</if>
<if test="hospitalId != null and hospitalId != ''">
and hospital_id = #{hospitalId}
</if>
<if test="babyId != null and babyId != ''">
and baby_id = #{babyId}
</if>
<if test="babyBuildDate != null and babyBuildDate != ''">
and baby_build_date = #{babyBuildDate}
</if>
<if test="babyName != null and babyName != ''">
and baby_name = #{babyName}
</if>
<if test="babySex != null">
and baby_sex = #{babySex}
</if>
<if test="babyMName != null and babyMName != ''">
and baby_m_name = #{babyMName}
</if>
<if test="babyFName != null and babyFName != ''">
and baby_f_name = #{babyFName}
</if>
<if test="babyMPhone != null and babyMPhone != ''">
and baby_m_phone = #{babyMPhone}
</if>
<if test="babyFPhone != null and babyFPhone != ''">
and baby_f_phone = #{babyFPhone}
</if>
<if test="babyMCertNo != null and babyMCertNo != ''">
and baby_m_cert_no = #{babyMCertNo}
</if>
<if test="babyFCertNo != null and babyFCertNo != ''">
and baby_f_cert_no = #{babyFCertNo}
</if>
<if test="pid != null and pid != ''">
and pid = #{pid}
</if>
<if test="checkMonthAge != null and checkMonthAge != ''">
and check_month_age = #{checkMonthAge}
</if>
<if test="checkMonthId != null and checkMonthId != ''">
and check_month_id = #{checkMonthId}
</if>
<if test="birth != null and birth != ''">
and birth = #{birth}
</if>
<if test="checkTime != null and checkTime != ''">
and check_time = #{checkTime}
</if>
<if test="nextCheckTime != null and nextCheckTime != ''">
and next_check_time = #{nextCheckTime}
</if>
<if test="doctor != null and doctor != ''">
and check_doctor = #{doctor}
</if>
<if test="doctorSign != null and doctorSign != ''">
and doctor_sign = #{doctorSign}
</if>
<if test="patientSign != null and patientSign != ''">
and patient_sign = #{patientSign}
</if>
<if test="guidanceOpinions != null and guidanceOpinions != ''">
and guidance_opinions = #{guidanceOpinions}
</if>
<if test="handleOpinions != null and handleOpinions != ''">
and handle_opinions = #{handleOpinions}
</if>
<if test="warningSignstring != null and warningSignstring != ''">
and warning_signs = #{warningSignstring}
</if>
<if test="languageSocialstirng != null and languageSocialstirng != ''">
and language_social = #{languageSocialstirng}
</if>
<if test="global != null and global != ''">
and preliminary_screening_results = #{global}
</if>
</where>
limit #{pageable.offset}, #{pageable.pageSize}
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from baby_autism_primary_screening
<where>
<if test="id != null and id != ''">
and id = #{id}
</if>
<if test="created != null and created != ''">
and created = #{created}
</if>
<if test="modified != null and modified != ''">
and modified = #{modified}
</if>
<if test="yn != null">
and yn = #{yn}
</if>
<if test="operaterId != null and operaterId != ''">
and operater_id = #{operaterId}
</if>
<if test="hospitalId != null and hospitalId != ''">
and hospital_id = #{hospitalId}
</if>
<if test="babyId != null and babyId != ''">
and baby_id = #{babyId}
</if>
<if test="babyBuildDate != null and babyBuildDate != ''">
and baby_build_date = #{babyBuildDate}
</if>
<if test="babyName != null and babyName != ''">
and baby_name = #{babyName}
</if>
<if test="babySex != null">
and baby_sex = #{babySex}
</if>
<if test="babyMName != null and babyMName != ''">
and baby_m_name = #{babyMName}
</if>
<if test="babyFName != null and babyFName != ''">
and baby_f_name = #{babyFName}
</if>
<if test="babyMPhone != null and babyMPhone != ''">
and baby_m_phone = #{babyMPhone}
</if>
<if test="babyFPhone != null and babyFPhone != ''">
and baby_f_phone = #{babyFPhone}
</if>
<if test="babyMCertNo != null and babyMCertNo != ''">
and baby_m_cert_no = #{babyMCertNo}
</if>
<if test="babyFCertNo != null and babyFCertNo != ''">
and baby_f_cert_no = #{babyFCertNo}
</if>
<if test="pid != null and pid != ''">
and pid = #{pid}
</if>
<if test="checkMonthAge != null and checkMonthAge != ''">
and check_month_age = #{checkMonthAge}
</if>
<if test="checkMonthId != null and checkMonthId != ''">
and check_month_id = #{checkMonthId}
</if>
<if test="birth != null and birth != ''">
and birth = #{birth}
</if>
<if test="checkTime != null and checkTime != ''">
and check_time = #{checkTime}
</if>
<if test="nextCheckTime != null and nextCheckTime != ''">
and next_check_time = #{nextCheckTime}
</if>
<if test="doctor != null and doctor != ''">
and check_doctor = #{doctor}
</if>
<if test="doctorSign != null and doctorSign != ''">
and doctor_sign = #{doctorSign}
</if>
<if test="patientSign != null and patientSign != ''">
and patient_sign = #{patientSign}
</if>
<if test="guidanceOpinions != null and guidanceOpinions != ''">
and guidance_opinions = #{guidanceOpinions}
</if>
<if test="handleOpinions != null and handleOpinions != ''">
and handle_opinions = #{handleOpinions}
</if>
<if test="warningSignstring != null and warningSignstring != ''">
and warning_signs = #{warningSignstring}
</if>
<if test="languageSocialstirng != null and languageSocialstirng != ''">
and language_social = #{languageSocialstirng}
</if>
<if test="global != null and global != ''">
and preliminary_screening_results = #{global}
</if>
</where>
</select>
<select id="queryListByBabyId" resultMap="BabyAutismPrimaryScreeningMap">
select
id, created, modified, yn, operater_id, hospital_id, baby_id, baby_build_date, baby_name, baby_sex, baby_m_name, baby_f_name, baby_m_phone, baby_f_phone, baby_m_cert_no, baby_f_cert_no, pid, check_month_age, check_month_id, birth, check_time, next_check_time, check_doctor, doctor_sign, patient_sign, guidance_opinions, handle_opinions, warning_signs, language_social, preliminary_screening_results
from baby_autism_primary_screening
<where>
and baby_id = #{id}
</where>
order by check_time
</select>
<!--新增所有列-->
<insert id="insert" >
insert into baby_autism_primary_screening(id,created, modified, yn, operater_id, hospital_id, baby_id, baby_build_date, baby_name, baby_sex, baby_m_name, baby_f_name, baby_m_phone, baby_f_phone, baby_m_cert_no, baby_f_cert_no, pid, check_month_age, check_month_id, birth, check_time, next_check_time, check_doctor, doctor_sign, patient_sign, guidance_opinions, handle_opinions, warning_signs, language_social, preliminary_screening_results)
values (#{id},#{created}, #{modified}, #{yn}, #{operaterId}, #{hospitalId}, #{babyId}, #{babyBuildDate}, #{babyName}, #{babySex}, #{babyMName}, #{babyFName}, #{babyMPhone}, #{babyFPhone}, #{babyMCertNo}, #{babyFCertNo}, #{pid}, #{checkMonthAge}, #{checkMonthId}, #{birth}, #{checkTime}, #{nextCheckTime}, #{doctor}, #{doctorSign}, #{patientSign}, #{guidanceOpinions}, #{handleOpinions}, #{warningSignstring}, #{languageSocialstirng}, #{global})
</insert>
<insert id="insertBatch" >
<selectKey order="AFTER" keyProperty="id" resultType="java.lang.Integer"> SELECT LAST_INSERT_ID() </selectKey>
insert into baby_autism_primary_screening(id,created, modified, yn, operater_id, hospital_id, baby_id, baby_build_date, baby_name, baby_sex, baby_m_name, baby_f_name, baby_m_phone, baby_f_phone, baby_m_cert_no, baby_f_cert_no, pid, check_month_age, check_month_id, birth, check_time, next_check_time, check_doctor, doctor_sign, patient_sign, guidance_opinions, handle_opinions, warning_signs, language_social, preliminary_screening_results)
values
<foreach collection="entities" item="entity" separator=",">
(#{id},#{entity.created}, #{entity.modified}, #{entity.yn}, #{entity.operaterId}, #{entity.hospitalId}, #{entity.babyId}, #{entity.babyBuildDate}, #{entity.babyName}, #{entity.babySex}, #{entity.babyMName}, #{entity.babyFName}, #{entity.babyMPhone}, #{entity.babyFPhone}, #{entity.babyMCertNo}, #{entity.babyFCertNo}, #{entity.pid}, #{entity.checkMonthAge}, #{entity.checkMonthId}, #{entity.birth}, #{entity.checkTime}, #{entity.nextCheckTime}, #{entity.doctor}, #{entity.doctorSign}, #{entity.patientSign}, #{entity.guidanceOpinions}, #{entity.handleOpinions}, #{entity.warningSignstring}, #{entity.languageSocialstirng}, #{entity.global})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" >
insert into baby_autism_primary_screening(id,created, modified, yn, operater_id, hospital_id, baby_id, baby_build_date, baby_name, baby_sex, baby_m_name, baby_f_name, baby_m_phone, baby_f_phone, baby_m_cert_no, baby_f_cert_no, pid, check_month_age, check_month_id, birth, check_time, next_check_time, check_doctor, doctor_sign, patient_sign, guidance_opinions, handle_opinions, warning_signs, language_social, preliminary_screening_results)
values
<foreach collection="entities" item="entity" separator=",">
(#{id},#{entity.created}, #{entity.modified}, #{entity.yn}, #{entity.operaterId}, #{entity.hospitalId}, #{entity.babyId}, #{entity.babyBuildDate}, #{entity.babyName}, #{entity.babySex}, #{entity.babyMName}, #{entity.babyFName}, #{entity.babyMPhone}, #{entity.babyFPhone}, #{entity.babyMCertNo}, #{entity.babyFCertNo}, #{entity.pid}, #{entity.checkMonthAge}, #{entity.checkMonthId}, #{entity.birth}, #{entity.checkTime}, #{entity.nextCheckTime}, #{entity.doctor}, #{entity.doctorSign}, #{entity.patientSign}, #{entity.guidanceOpinions}, #{entity.handleOpinions}, #{entity.warningSignstring}, #{entity.languageSocialstirng}, #{entity.global})
</foreach>
on duplicate key update
created = values(created),
modified = values(modified),
yn = values(yn),
operater_id = values(operater_id),
hospital_id = values(hospital_id),
baby_id = values(baby_id),
baby_build_date = values(baby_build_date),
baby_name = values(baby_name),
baby_sex = values(baby_sex),
baby_m_name = values(baby_m_name),
baby_f_name = values(baby_f_name),
baby_m_phone = values(baby_m_phone),
baby_f_phone = values(baby_f_phone),
baby_m_cert_no = values(baby_m_cert_no),
baby_f_cert_no = values(baby_f_cert_no),
pid = values(pid),
check_month_age = values(check_month_age),
check_month_id = values(check_month_id),
birth = values(birth),
check_time = values(check_time),
next_check_time = values(next_check_time),
check_doctor = values(check_doctor),
doctor_sign = values(doctor_sign),
patient_sign = values(patient_sign),
guidance_opinions = values(guidance_opinions),
handle_opinions = values(handle_opinions),
warning_signs = values(warning_signs),
language_social = values(language_social),
preliminary_screening_results = values(preliminary_screening_results)
</insert>
<!--通过主键修改数据-->
<update id="update">
update baby_autism_primary_screening
<set>
<if test="created != null ">
created = #{created},
</if>
<if test="modified != null">
modified = #{modified},
</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="babyBuildDate != null ">
baby_build_date = #{babyBuildDate},
</if>
<if test="babyName != null ">
baby_name = #{babyName},
</if>
<if test="babySex != null">
baby_sex = #{babySex},
</if>
<if test="babyMName != null ">
baby_m_name = #{babyMName},
</if>
<if test="babyFName != null ">
baby_f_name = #{babyFName},
</if>
<if test="babyMPhone != null ">
baby_m_phone = #{babyMPhone},
</if>
<if test="babyFPhone != null ">
baby_f_phone = #{babyFPhone},
</if>
<if test="babyMCertNo != null ">
baby_m_cert_no = #{babyMCertNo},
</if>
<if test="babyFCertNo != null ">
baby_f_cert_no = #{babyFCertNo},
</if>
<if test="pid != null and pid != ''">
pid = #{pid},
</if>
<if test="checkMonthAge != null and checkMonthAge != ''">
check_month_age = #{checkMonthAge},
</if>
<if test="checkMonthId != null and checkMonthId != ''">
check_month_id = #{checkMonthId},
</if>
<if test="birth != null and birth != ''">
birth = #{birth},
</if>
<if test="checkTime != null ">
check_time = #{checkTime},
</if>
<if test="nextCheckTime != null ">
next_check_time = #{nextCheckTime},
</if>
<if test="doctor != null and doctor != ''">
check_doctor = #{doctor},
</if>
<if test="doctorSign != null and doctorSign != ''">
doctor_sign = #{doctorSign},
</if>
<if test="patientSign != null and patientSign != ''">
patient_sign = #{patientSign},
</if>
<if test="guidanceOpinions != null and guidanceOpinions != ''">
guidance_opinions = #{guidanceOpinions},
</if>
<if test="handleOpinions != null and handleOpinions != ''">
handle_opinions = #{handleOpinions},
</if>
<if test="warningSignstring != null and warningSignstring != ''">
warning_signs = #{warningSignstring},
</if>
<if test="languageSocialstirng != null and languageSocialstirng != ''">
language_social = #{languageSocialstirng},
</if>
<if test="global != null and global != ''">
preliminary_screening_results = #{global},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from baby_autism_primary_screening where id = #{id}
</delete>
</mapper>