<?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.PostpartumFollowMakeMapper">
<resultMap id="PostpartumFollowMakeResultMap" type="com.lyms.platform.permission.model.PostpartumFollowMake">
<id column="id" property="id" jdbcType="VARCHAR" />
<result column="hospital_id" property="hospitalId" jdbcType="VARCHAR" />
<result column="delivery_date" property="deliveryDate" jdbcType="TIMESTAMP" />
<result column="deliver_id" property="deliverId" jdbcType="VARCHAR" />
<result column="parentId" property="parentid" jdbcType="VARCHAR" />
<result column="pid" property="pid" jdbcType="VARCHAR" />
<result column="contact_result" property="contactResult" jdbcType="INTEGER" />
<result column="make_type" property="makeType" jdbcType="INTEGER" />
<result column="make_remark" property="makeRemark" jdbcType="VARCHAR" />
<result column="make_create_user" property="makeCreateUser" jdbcType="VARCHAR" />
<result column="make_create_date" property="makeCreateDate" jdbcType="TIMESTAMP" />
<result column="contact_reason" property="contactReason" jdbcType="INTEGER" />
<result column="make_visit_date" property="makeVisitDate" jdbcType="TIMESTAMP" />
<result column="visit_result" property="visitResult" jdbcType="INTEGER" />
<result column="visit_reason" property="visitReason" jdbcType="INTEGER" />
<result column="visit_affirm" property="visitAffirm" jdbcType="INTEGER" />
<result column="visit_date" property="visitDate" jdbcType="TIMESTAMP" />
<result column="visit_doctor" property="visitDoctor" jdbcType="VARCHAR" />
<result column="visit_status" property="visitStatus" jdbcType="INTEGER" />
<result column="visit_remark" property="visitRemark" jdbcType="VARCHAR" />
<result column="visit_create_user" property="visitCreateUser" jdbcType="VARCHAR" />
<result column="visit_create_date" property="visitCreateDate" jdbcType="TIMESTAMP" />
<result column="next_visit_date" property="nextVisitDate" jdbcType="TIMESTAMP" />
<result column="is_close" property="isClose" jdbcType="INTEGER" />
</resultMap>
<insert id="addPostpartumFollowMake" parameterType="com.lyms.platform.permission.model.PostpartumFollowMake">
insert into postpartum_follow_make (id,hospital_id,delivery_date,deliver_id,parentId,pid,contact_result,make_type,make_remark,make_create_user,make_create_date,contact_reason,make_visit_date,visit_result,visit_reason,visit_affirm,visit_date,visit_doctor,visit_status,visit_remark,visit_create_user,visit_create_date,next_visit_date,is_close) values (#{id},#{hospitalId},#{deliveryDate},#{deliverId},#{parentid},#{pid},#{contactResult},#{makeType},#{makeRemark},#{makeCreateUser},#{makeCreateDate},#{contactReason},#{makeVisitDate},#{visitResult},#{visitReason},#{visitAffirm},#{visitDate},#{visitDoctor},#{visitStatus},#{visitRemark},#{visitCreateUser},#{visitCreateDate},#{nextVisitDate},#{isClose})
</insert>
<update id="updatePostpartumFollowMake" parameterType="com.lyms.platform.permission.model.PostpartumFollowMake">
update postpartum_follow_make <set><if test="hospitalId != null and hospitalId != ''">
hospital_id = #{hospitalId,jdbcType=VARCHAR},
</if>
<if test="deliveryDate != null">
delivery_date = #{deliveryDate,jdbcType=TIMESTAMP},
</if>
<if test="deliverId != null and deliverId != ''">
deliver_id = #{deliverId,jdbcType=VARCHAR},
</if>
<if test="parentid != null and parentid != ''">
parentId = #{parentid,jdbcType=VARCHAR},
</if>
<if test="pid != null and pid != ''">
pid = #{pid,jdbcType=VARCHAR},
</if>
<if test="contactResult != null and contactResult >= 0">
contact_result = #{contactResult,jdbcType=INTEGER},
</if>
<if test="makeType != null and makeType >= 0">
make_type = #{makeType,jdbcType=INTEGER},
</if>
<if test="makeRemark != null and makeRemark != ''">
make_remark = #{makeRemark,jdbcType=VARCHAR},
</if>
<if test="makeCreateUser != null and makeCreateUser != ''">
make_create_user = #{makeCreateUser,jdbcType=VARCHAR},
</if>
<if test="makeCreateDate != null">
make_create_date = #{makeCreateDate,jdbcType=TIMESTAMP},
</if>
<if test="contactReason != null and contactReason >= 0">
contact_reason = #{contactReason,jdbcType=INTEGER},
</if>
<if test="makeVisitDate != null">
make_visit_date = #{makeVisitDate,jdbcType=TIMESTAMP},
</if>
<if test="visitResult != null and visitResult >= 0">
visit_result = #{visitResult,jdbcType=INTEGER},
</if>
<if test="visitReason != null and visitReason >= 0">
visit_reason = #{visitReason,jdbcType=INTEGER},
</if>
<if test="visitAffirm != null and visitAffirm >= 0">
visit_affirm = #{visitAffirm,jdbcType=INTEGER},
</if>
<if test="visitDate != null">
visit_date = #{visitDate,jdbcType=TIMESTAMP},
</if>
<if test="visitDoctor != null and visitDoctor != ''">
visit_doctor = #{visitDoctor,jdbcType=VARCHAR},
</if>
<if test="visitStatus != null and visitStatus >= 0">
visit_status = #{visitStatus,jdbcType=INTEGER},
</if>
<if test="visitRemark != null and visitRemark != ''">
visit_remark = #{visitRemark,jdbcType=VARCHAR},
</if>
<if test="visitCreateUser != null and visitCreateUser != ''">
visit_create_user = #{visitCreateUser,jdbcType=VARCHAR},
</if>
<if test="visitCreateDate != null">
visit_create_date = #{visitCreateDate,jdbcType=TIMESTAMP},
</if>
<if test="nextVisitDate != null">
next_visit_date = #{nextVisitDate,jdbcType=TIMESTAMP},
</if>
<if test="isClose != null and isClose >= 0">
is_close = #{isClose,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<delete id="deletePostpartumFollowMake" parameterType="java.lang.String">
delete from postpartum_follow_make where id = #{id,jdbcType=VARCHAR}
</delete>
<select id="getPostpartumFollowMake" resultMap="PostpartumFollowMakeResultMap" parameterType="java.lang.String">
select id,hospital_id,delivery_date,deliver_id,parentId,pid,contact_result,make_type,make_remark,make_create_user,make_create_date,contact_reason,make_visit_date,visit_result,visit_reason,visit_affirm,visit_date,visit_doctor,visit_status,visit_remark,visit_create_user,visit_create_date,next_visit_date,is_close
from postpartum_follow_make 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="PostpartumFollowMakeCondition">
<where>
1 = 1
<if test="id != null and id != ''">
and id = #{id,jdbcType=VARCHAR}
</if>
<if test="hospitalId != null and hospitalId != ''">
and hospital_id = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="deliveryDate != null">
and delivery_date = #{deliveryDate,jdbcType=TIMESTAMP}
</if>
<if test="deliverId != null and deliverId != ''">
and deliver_id = #{deliverId,jdbcType=VARCHAR}
</if>
<if test="parentid != null and parentid != ''">
and parentId = #{parentid,jdbcType=VARCHAR}
</if>
<if test="pid != null and pid != ''">
and pid = #{pid,jdbcType=VARCHAR}
</if>
<if test="contactResult != null and contactResult >= 0">
and contact_result = #{contactResult,jdbcType=INTEGER}
</if>
<if test="makeType != null and makeType >= 0">
and make_type = #{makeType,jdbcType=INTEGER}
</if>
<if test="makeRemark != null and makeRemark != ''">
and make_remark = #{makeRemark,jdbcType=VARCHAR}
</if>
<if test="makeCreateUser != null and makeCreateUser != ''">
and make_create_user = #{makeCreateUser,jdbcType=VARCHAR}
</if>
<if test="makeCreateDate != null">
and make_create_date = #{makeCreateDate,jdbcType=TIMESTAMP}
</if>
<if test="contactReason != null and contactReason >= 0">
and contact_reason = #{contactReason,jdbcType=INTEGER}
</if>
<if test="makeVisitDate != null">
and make_visit_date = #{makeVisitDate,jdbcType=TIMESTAMP}
</if>
<if test="visitResult != null and visitResult >= 0">
and visit_result = #{visitResult,jdbcType=INTEGER}
</if>
<if test="visitReason != null and visitReason >= 0">
and visit_reason = #{visitReason,jdbcType=INTEGER}
</if>
<if test="visitAffirm != null and visitAffirm >= 0">
and visit_affirm = #{visitAffirm,jdbcType=INTEGER}
</if>
<if test="visitDate != null">
and visit_date = #{visitDate,jdbcType=TIMESTAMP}
</if>
<if test="visitDoctor != null and visitDoctor != ''">
and visit_doctor = #{visitDoctor,jdbcType=VARCHAR}
</if>
<if test="visitStatus != null and visitStatus >= 0">
and visit_status = #{visitStatus,jdbcType=INTEGER}
</if>
<if test="visitRemark != null and visitRemark != ''">
and visit_remark = #{visitRemark,jdbcType=VARCHAR}
</if>
<if test="visitCreateUser != null and visitCreateUser != ''">
and visit_create_user = #{visitCreateUser,jdbcType=VARCHAR}
</if>
<if test="visitCreateDate != null">
and visit_create_date = #{visitCreateDate,jdbcType=TIMESTAMP}
</if>
<if test="nextVisitDate != null">
and next_visit_date = #{nextVisitDate,jdbcType=TIMESTAMP}
</if>
<if test="isClose != null and isClose >= 0">
and is_close = #{isClose,jdbcType=INTEGER}
</if>
</where>
</sql>
<select id="queryPostpartumFollowMake" resultMap="PostpartumFollowMakeResultMap" parameterType="com.lyms.platform.permission.model.PostpartumFollowMakeQuery">
select id,hospital_id,delivery_date,deliver_id,parentId,pid,contact_result,make_type,make_remark,make_create_user,make_create_date,contact_reason,make_visit_date,visit_result,visit_reason,visit_affirm,visit_date,visit_doctor,visit_status,visit_remark,visit_create_user,visit_create_date,next_visit_date,is_close
from postpartum_follow_make
<include refid="PostpartumFollowMakeCondition" />
<include refid="orderAndLimit" />
</select>
<select id="queryPostpartumFollowMakeCount" resultType="int" parameterType="com.lyms.platform.permission.model.PostpartumFollowMakeQuery">
select count(1) from postpartum_follow_make
<include refid="PostpartumFollowMakeCondition" />
</select>
</mapper>