<?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.smartor.mapper.PatBabyGrowthMapper">
|
|
<resultMap type="com.smartor.domain.PatBabyGrowth" id="PatBabyGrowthResult">
|
<result property="id" column="id"/>
|
<result property="patId" column="pat_id"/>
|
<result property="height" column="height"/>
|
<result property="headCir" column="head_cir"/>
|
<result property="weight" column="weight"/>
|
<result property="age" column="age"/>
|
<result property="name" column="name"/>
|
<result property="deptCode" column="dept_code"/>
|
<result property="deptName" column="dept_name"/>
|
<result property="wardCode" column="ward_code"/>
|
<result property="wardName" column="ward_name"/>
|
<result property="doctor" column="doctor"/>
|
<result property="doctorCode" column="doctor_code"/>
|
<result property="nurse" column="nurse"/>
|
<result property="nurseCode" column="nurse_code"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="createTime" column="create_time"/>
|
<result property="sex" column="sex"/>
|
</resultMap>
|
|
<sql id="selectPatBabyGrowthVo">
|
select id,
|
pat_id,
|
height,
|
sex,
|
head_cir,
|
weight,
|
age,
|
name,
|
dept_code,
|
dept_name,
|
ward_code,
|
ward_name,
|
doctor,
|
doctor_code,
|
nurse,
|
nurse_code,
|
update_time,
|
create_time
|
from pat_baby_growth
|
</sql>
|
|
<select id="selectPatBabyGrowthList" parameterType="com.smartor.domain.PatBabyGrowth"
|
resultMap="PatBabyGrowthResult">
|
<include refid="selectPatBabyGrowthVo"/>
|
<where>
|
del_flag=0
|
<if test="patId != null ">
|
and pat_id = #{patId}
|
</if>
|
<if test="sex != null ">
|
and sex = #{sex}
|
</if>
|
<if test="height != null and height != ''">
|
and height = #{height}
|
</if>
|
<if test="headCir != null and headCir != ''">
|
and head_cir = #{headCir}
|
</if>
|
<if test="weight != null and weight != ''">
|
and weight = #{weight}
|
</if>
|
<if test="age != null ">
|
and age = #{age}
|
</if>
|
<if test="name != null and name != ''">
|
and name like concat('%', #{name}, '%')
|
</if>
|
<if test="deptCode != null and deptCode != ''">
|
and dept_code = #{deptCode}
|
</if>
|
<if test="deptName != null and deptName != ''">
|
and dept_name like concat('%', #{deptName}, '%')
|
</if>
|
<if test="wardCode != null and wardCode != ''">
|
and ward_code = #{wardCode}
|
</if>
|
<if test="wardName != null and wardName != ''">
|
and ward_name like concat('%', #{wardName}, '%')
|
</if>
|
<if test="doctor != null and doctor != ''">
|
and doctor = #{doctor}
|
</if>
|
<if test="doctorCode != null and doctorCode != ''">
|
and doctor_code = #{doctorCode}
|
</if>
|
<if test="nurse != null and nurse != ''">
|
and nurse = #{nurse}
|
</if>
|
<if test="nurseCode != null and nurseCode != ''">
|
and nurse_code = #{nurseCode}
|
</if>
|
</where>
|
order by age
|
</select>
|
|
<select id="selectPatBabyGrowthById" parameterType="Long"
|
resultMap="PatBabyGrowthResult">
|
<include refid="selectPatBabyGrowthVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertPatBabyGrowth" parameterType="com.smartor.domain.PatBabyGrowth">
|
insert into pat_baby_growth
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,
|
</if>
|
<if test="patId != null">pat_id,
|
</if>
|
<if test="height != null">height,
|
</if>
|
<if test="headCir != null">head_cir,
|
</if>
|
<if test="weight != null">weight,
|
</if>
|
<if test="age != null">age,
|
</if>
|
<if test="name != null">name,
|
</if>
|
<if test="deptCode != null">dept_code,
|
</if>
|
<if test="deptName != null">dept_name,
|
</if>
|
<if test="wardCode != null">ward_code,
|
</if>
|
<if test="wardName != null">ward_name,
|
</if>
|
<if test="doctor != null">doctor,
|
</if>
|
<if test="doctorCode != null">doctor_code,
|
</if>
|
<if test="nurse != null">nurse,
|
</if>
|
<if test="nurseCode != null">nurse_code,
|
</if>
|
<if test="updateTime != null">update_time,
|
</if>
|
<if test="createTime != null">create_time,
|
</if>
|
<if test="sex != null">sex,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},
|
</if>
|
<if test="patId != null">#{patId},
|
</if>
|
<if test="height != null">#{height},
|
</if>
|
<if test="headCir != null">#{headCir},
|
</if>
|
<if test="weight != null">#{weight},
|
</if>
|
<if test="age != null">#{age},
|
</if>
|
<if test="name != null">#{name},
|
</if>
|
<if test="deptCode != null">#{deptCode},
|
</if>
|
<if test="deptName != null">#{deptName},
|
</if>
|
<if test="wardCode != null">#{wardCode},
|
</if>
|
<if test="wardName != null">#{wardName},
|
</if>
|
<if test="doctor != null">#{doctor},
|
</if>
|
<if test="doctorCode != null">#{doctorCode},
|
</if>
|
<if test="nurse != null">#{nurse},
|
</if>
|
<if test="nurseCode != null">#{nurseCode},
|
</if>
|
<if test="updateTime != null">#{updateTime},
|
</if>
|
<if test="createTime != null">#{createTime},
|
</if>
|
<if test="sex != null">#{sex},
|
</if>
|
</trim>
|
</insert>
|
|
<update id="updatePatBabyGrowth" parameterType="com.smartor.domain.PatBabyGrowth">
|
update pat_baby_growth
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="patId != null">pat_id =
|
#{patId},
|
</if>
|
<if test="height != null">height =
|
#{height},
|
</if>
|
<if test="headCir != null">head_cir =
|
#{headCir},
|
</if>
|
<if test="weight != null">weight =
|
#{weight},
|
</if>
|
<if test="age != null">age =
|
#{age},
|
</if>
|
<if test="name != null">name =
|
#{name},
|
</if>
|
<if test="deptCode != null">dept_code =
|
#{deptCode},
|
</if>
|
<if test="deptName != null">dept_name =
|
#{deptName},
|
</if>
|
<if test="wardCode != null">ward_code =
|
#{wardCode},
|
</if>
|
<if test="wardName != null">ward_name =
|
#{wardName},
|
</if>
|
<if test="doctor != null">doctor =
|
#{doctor},
|
</if>
|
<if test="doctorCode != null">doctor_code =
|
#{doctorCode},
|
</if>
|
<if test="nurse != null">nurse =
|
#{nurse},
|
</if>
|
<if test="nurseCode != null">nurse_code =
|
#{nurseCode},
|
</if>
|
<if test="updateTime != null">update_time =
|
#{updateTime},
|
</if>
|
<if test="createTime != null">create_time =
|
#{createTime},
|
</if>
|
<if test="sex != null">sex =
|
#{sex},
|
</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<update id="deletePatBabyGrowthById" parameterType="Long">
|
update pat_baby_growth
|
<trim prefix="SET" suffixOverrides=",">
|
del_flag =1
|
</trim>
|
where id = #{id}
|
</update>
|
|
<update id="deletePatBabyGrowthByIds" parameterType="String">
|
update pat_baby_growth
|
<trim prefix="SET" suffixOverrides=",">
|
del_flag =1
|
</trim>
|
where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</update>
|
|
|
</mapper>
|