PatientMarkHospitalLog.xml 6.42 KB
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
<?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.PatientMarkHospitalLogMapper">

<resultMap id="PatientMarkHospitalLogResultMap" type="com.lyms.platform.permission.model.PatientMarkHospitalLog">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="patient_make_hos_id" property="patientMakeHosId" jdbcType="VARCHAR"/>
<result column="patient_id" property="patientId" jdbcType="VARCHAR"/>
<result column="rem_result" property="remResult" jdbcType="INTEGER"/>
<result column="make_date" property="makeDate" jdbcType="TIMESTAMP"/>
<result column="make_failure" property="makeFailure" jdbcType="INTEGER"/>
<result column="make_remark" property="makeRemark" jdbcType="VARCHAR"/>
<result column="marke_doctor" property="markeDoctor" jdbcType="VARCHAR"/>
<result column="marke_date" property="markeDate" jdbcType="TIMESTAMP"/>
<result column="marke_type" property="markeType" jdbcType="INTEGER"/>
<result column="hospital_id" property="hospitalId" jdbcType="VARCHAR"/>
</resultMap>


<insert id="addPatientMarkHospitalLog" parameterType="com.lyms.platform.permission.model.PatientMarkHospitalLog">
insert into patient_mark_hospital_log (id,patient_make_hos_id,patient_id,rem_result,make_date,make_failure,make_remark,marke_doctor,marke_date,marke_type,hospital_id) values (#{id},#{patientMakeHosId},#{patientId},#{remResult},#{makeDate},#{makeFailure},#{makeRemark},#{markeDoctor},#{markeDate},#{markeType},#{hospitalId})
</insert>


<update id="updatePatientMarkHospitalLog" parameterType="com.lyms.platform.permission.model.PatientMarkHospitalLog">
update patient_mark_hospital_log
<set>
<if test="patientMakeHosId != null and patientMakeHosId != ''">
patient_make_hos_id = #{patientMakeHosId,jdbcType=VARCHAR},
</if>
<if test="patientId != null and patientId != ''">
patient_id = #{patientId,jdbcType=VARCHAR},
</if>
<if test="remResult != null and remResult >= 0">
rem_result = #{remResult,jdbcType=INTEGER},
</if>
<if test="makeDate != null">
make_date = #{makeDate,jdbcType=TIMESTAMP},
</if>
<if test="makeFailure != null and makeFailure >= 0">
make_failure = #{makeFailure,jdbcType=INTEGER},
</if>
<if test="makeRemark != null and makeRemark != ''">
make_remark = #{makeRemark,jdbcType=VARCHAR},
</if>
<if test="markeDoctor != null and markeDoctor != ''">
marke_doctor = #{markeDoctor,jdbcType=VARCHAR},
</if>
<if test="markeDate != null">
marke_date = #{markeDate,jdbcType=TIMESTAMP},
</if>
<if test="markeType != null and markeType >= 0">
marke_type = #{markeType,jdbcType=INTEGER},
</if>
<if test="hospitalId != null and hospitalId != ''">
hospital_id = #{hospitalId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>


<delete id="deletePatientMarkHospitalLog" parameterType="java.lang.String">
delete from patient_mark_hospital_log where id = #{id,jdbcType=VARCHAR}
</delete>


<select id="getPatientMarkHospitalLog" resultMap="PatientMarkHospitalLogResultMap" parameterType="java.lang.String">
select id,patient_make_hos_id,patient_id,rem_result,make_date,make_failure,make_remark,marke_doctor,marke_date,marke_type,hospital_id
from patient_mark_hospital_log 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="PatientMarkHospitalLogCondition">
<where>
1 = 1
<if test="id != null and id != ''">
and id = #{id,jdbcType=VARCHAR}
</if>
<if test="patientMakeHosId != null and patientMakeHosId != ''">
and patient_make_hos_id = #{patientMakeHosId,jdbcType=VARCHAR}
</if>
<if test="patientId != null and patientId != ''">
and patient_id = #{patientId,jdbcType=VARCHAR}
</if>
<if test="remResult != null and remResult >= 0">
and rem_result = #{remResult,jdbcType=INTEGER}
</if>
<if test="makeDate != null">
and make_date = #{makeDate,jdbcType=TIMESTAMP}
</if>
<if test="makeFailure != null and makeFailure >= 0">
and make_failure = #{makeFailure,jdbcType=INTEGER}
</if>
<if test="makeRemark != null and makeRemark != ''">
and make_remark = #{makeRemark,jdbcType=VARCHAR}
</if>
<if test="markeDoctor != null and markeDoctor != ''">
and marke_doctor = #{markeDoctor,jdbcType=VARCHAR}
</if>
<if test="markeDate != null">
and marke_date = #{markeDate,jdbcType=TIMESTAMP}
</if>
<if test="markeType != null and markeType >= 0">
and marke_type = #{markeType,jdbcType=INTEGER}
</if>
<if test="hospitalId != null and hospitalId != ''">
and hospital_id = #{hospitalId,jdbcType=VARCHAR}
</if>
</where>
</sql>


<select id="queryPatientMarkHospitalLog" resultMap="PatientMarkHospitalLogResultMap"
parameterType="com.lyms.platform.permission.model.PatientMarkHospitalLogQuery">
select
id,patient_make_hos_id,patient_id,rem_result,make_date,make_failure,make_remark,marke_doctor,marke_date,marke_type,hospital_id
from patient_mark_hospital_log
<include refid="PatientMarkHospitalLogCondition"/>
<include refid="orderAndLimit"/>
</select>


<select id="queryPatientMarkHospitalLogCount" resultType="int"
parameterType="com.lyms.platform.permission.model.PatientMarkHospitalLogQuery">
select count(1) from patient_mark_hospital_log
<include refid="PatientMarkHospitalLogCondition"/>
</select>


</mapper>