HighriskChangeHospital.xml 10.2 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
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
<?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.HighriskChangeHospitalMapper">

<resultMap id="HighriskChangeHospitalResultMap" type="com.lyms.platform.permission.model.HighriskChangeHospital">
<id column="ID" property="id" jdbcType="VARCHAR"/>
<result column="TARGET_TYPE" property="targetType" jdbcType="INTEGER"/>
<result column="TARGET_ID" property="targetId" jdbcType="VARCHAR"/>
<result column="OUT_ORGID" property="outOrgid" jdbcType="VARCHAR"/>
<result column="INTO_ORGID" property="intoOrgid" jdbcType="VARCHAR"/>
<result column="DESCRIPTION" property="description" jdbcType="VARCHAR"/>
<result column="MUSTDESC" property="mustdesc" jdbcType="VARCHAR"/>
<result column="RISK" property="risk" jdbcType="VARCHAR"/>
<result column="CHANGEWAY" property="changeway" jdbcType="VARCHAR"/>
<result column="APPLY_DOCTORID" property="applyDoctorid" jdbcType="VARCHAR"/>
<result column="CREATE_ID" property="createId" jdbcType="VARCHAR"/>
<result column="CHANGE_TYPE" property="changeType" jdbcType="INTEGER"/>
<result column="STATUS" property="status" jdbcType="INTEGER"/>
<result column="CREATE_TIME" property="createTime" jdbcType="TIMESTAMP"/>
<result column="RECEIVE_TIME" property="receiveTime" jdbcType="TIMESTAMP"/>
<result column="RECEIVE_DOCTORID" property="receiveDoctorid" jdbcType="VARCHAR"/>
<result column="SCRREEN_ID" property="scrreenId" jdbcType="VARCHAR"/>
<result column="pid" property="pid" jdbcType="VARCHAR"/>
</resultMap>


<insert id="addHighriskChangeHospital" parameterType="com.lyms.platform.permission.model.HighriskChangeHospital">
insert into HIGHRISK_CHANGE_HOSPITAL (ID,TARGET_TYPE,TARGET_ID,OUT_ORGID,INTO_ORGID,DESCRIPTION,MUSTDESC,RISK,CHANGEWAY,APPLY_DOCTORID,CREATE_ID,CHANGE_TYPE,STATUS,CREATE_TIME,RECEIVE_TIME,RECEIVE_DOCTORID,SCRREEN_ID,pid) values (#{id},#{targetType},#{targetId},#{outOrgid},#{intoOrgid},#{description},#{mustdesc},#{risk},#{changeway},#{applyDoctorid},#{createId},#{changeType},#{status},#{createTime},#{receiveTime},#{receiveDoctorid},#{scrreenId},#{pid})
</insert>


<update id="updateHighriskChangeHospital" parameterType="com.lyms.platform.permission.model.HighriskChangeHospital">
update HIGHRISK_CHANGE_HOSPITAL
<set>
<if test="targetType != null and targetType >= 0">
TARGET_TYPE = #{targetType,jdbcType=INTEGER},
</if>
<if test="targetId != null and targetId != ''">
TARGET_ID = #{targetId,jdbcType=VARCHAR},
</if>
<if test="outOrgid != null and outOrgid != ''">
OUT_ORGID = #{outOrgid,jdbcType=VARCHAR},
</if>
<if test="intoOrgid != null and intoOrgid != ''">
INTO_ORGID = #{intoOrgid,jdbcType=VARCHAR},
</if>
<if test="description != null and description != ''">
DESCRIPTION = #{description,jdbcType=VARCHAR},
</if>
<if test="mustdesc != null and mustdesc != ''">
MUSTDESC = #{mustdesc,jdbcType=VARCHAR},
</if>
<if test="risk != null and risk != ''">
RISK = #{risk,jdbcType=VARCHAR},
</if>
<if test="changeway != null and changeway != ''">
CHANGEWAY = #{changeway,jdbcType=VARCHAR},
</if>
<if test="applyDoctorid != null and applyDoctorid != ''">
APPLY_DOCTORID = #{applyDoctorid,jdbcType=VARCHAR},
</if>
<if test="createId != null and createId != ''">
CREATE_ID = #{createId,jdbcType=VARCHAR},
</if>
<if test="changeType != null and changeType >= 0">
CHANGE_TYPE = #{changeType,jdbcType=INTEGER},
</if>
<if test="status != null and status >= 0">
STATUS = #{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="receiveTime != null">
RECEIVE_TIME = #{receiveTime,jdbcType=TIMESTAMP},
</if>
<if test="receiveDoctorid != null and receiveDoctorid != ''">
RECEIVE_DOCTORID = #{receiveDoctorid,jdbcType=VARCHAR},
</if>
<if test="scrreenId != null and scrreenId != ''">
SCRREEN_ID = #{scrreenId,jdbcType=VARCHAR},
</if>
<if test="pid != null and pid != ''">
pid = #{pid,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>


<select id="getHighriskChangeHospital" resultMap="HighriskChangeHospitalResultMap" parameterType="java.lang.String">
select ID,TARGET_TYPE,TARGET_ID,OUT_ORGID,INTO_ORGID,DESCRIPTION,MUSTDESC,RISK,CHANGEWAY,APPLY_DOCTORID,CREATE_ID,CHANGE_TYPE,STATUS,CREATE_TIME,RECEIVE_TIME,RECEIVE_DOCTORID,SCRREEN_ID,pid
from HIGHRISK_CHANGE_HOSPITAL 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="HighriskChangeHospitalCondition">
<where>
1 = 1
<if test="id != null and id != ''">
and ID = #{id,jdbcType=VARCHAR}
</if>
<if test="targetType != null and targetType >= 0">
and TARGET_TYPE = #{targetType,jdbcType=INTEGER}
</if>
<if test="babyIds!=null">
and TARGET_ID in (
<foreach item="bId" collection="babyIds" separator=",">
#{bId}
</foreach>
)
</if>
<if test="hospitalIds!=null">
and INTO_ORGID in (
<foreach item="item" collection="hospitalIds" separator=",">
#{item}
</foreach>
)
</if>
<if test="intoOrgidArry!=null">
and INTO_ORGID in (
<foreach item="item" collection="intoOrgidArry" separator=",">
#{item}
</foreach>
)
</if>
<if test="outOrgidArry!=null">
and OUT_ORGID in (
<foreach item="item" collection="outOrgidArry" separator=",">
#{item}
</foreach>
)
</if>
<if test="targetId != null and targetId != ''">
and TARGET_ID = #{targetId,jdbcType=VARCHAR}
</if>
<if test="outOrgid != null and outOrgid != ''">
and OUT_ORGID = #{outOrgid,jdbcType=VARCHAR}
</if>
<if test="intoOrgid != null and intoOrgid != ''">
and INTO_ORGID = #{intoOrgid,jdbcType=VARCHAR}
</if>
<if test="description != null and description != ''">
and DESCRIPTION = #{description,jdbcType=VARCHAR}
</if>
<if test="mustdesc != null and mustdesc != ''">
and MUSTDESC = #{mustdesc,jdbcType=VARCHAR}
</if>
<if test="risk != null and risk != ''">
and RISK = #{risk,jdbcType=VARCHAR}
</if>
<if test="changeway != null and changeway != ''">
and CHANGEWAY = #{changeway,jdbcType=VARCHAR}
</if>
<if test="applyDoctorid != null and applyDoctorid != ''">
and APPLY_DOCTORID = #{applyDoctorid,jdbcType=VARCHAR}
</if>
<if test="createId != null and createId != ''">
and CREATE_ID = #{createId,jdbcType=VARCHAR}
</if>
<if test="changeType != null and changeType >= 0">
and CHANGE_TYPE = #{changeType,jdbcType=INTEGER}
</if>
<if test="status != null and status >= 0">
and STATUS = #{status,jdbcType=INTEGER}
</if>
<if test="createTime != null">
and CREATE_TIME = #{createTime,jdbcType=TIMESTAMP}
</if>
<if test="createStartTime != null and createStartTime != ''">
AND
<![CDATA[
DATEDIFF(#{createStartTime},CREATE_TIME)<=0
]]>
</if>
<if test="createEndTime != null and createEndTime != ''">
AND
<![CDATA[
DATEDIFF(#{createEndTime},CREATE_TIME)>=0
]]>
</if>

<if test="receiveTime != null">
and RECEIVE_TIME = #{receiveTime,jdbcType=TIMESTAMP}
</if>
<if test="receiveDoctorid != null and receiveDoctorid != ''">
and RECEIVE_DOCTORID = #{receiveDoctorid,jdbcType=VARCHAR}
</if>
<if test="scrreenId != null and scrreenId != ''">
and SCRREEN_ID = #{scrreenId,jdbcType=VARCHAR}
</if>
<if test="pid != null and pid != ''">
and pid = #{pid,jdbcType=VARCHAR}
</if>
</where>
</sql>


<select id="queryHighriskChangeHospital" resultMap="HighriskChangeHospitalResultMap"
parameterType="com.lyms.platform.permission.model.HighriskChangeHospitalQuery">
select
ID,TARGET_TYPE,TARGET_ID,OUT_ORGID,INTO_ORGID,DESCRIPTION,MUSTDESC,RISK,CHANGEWAY,APPLY_DOCTORID,CREATE_ID,CHANGE_TYPE,STATUS,CREATE_TIME,RECEIVE_TIME,RECEIVE_DOCTORID,SCRREEN_ID,pid
from HIGHRISK_CHANGE_HOSPITAL
<include refid="HighriskChangeHospitalCondition"/>
<include refid="orderAndLimit"/>
</select>


<select id="queryHighriskChangeHospitalCount" resultType="int"
parameterType="com.lyms.platform.permission.model.HighriskChangeHospitalQuery">
select count(1) from HIGHRISK_CHANGE_HOSPITAL
<include refid="HighriskChangeHospitalCondition"/>
</select>


</mapper>