HospitalCheckItemConf.xml 3.97 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
<?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.HospitalCheckItemConfMapper">

<resultMap id="HospitalCheckItemConfMap" type="com.lyms.platform.pojo.HospitalCheckItemConf">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="hospital_id" property="hospitalId" jdbcType="INTEGER"/>
<result column="start_week" property="startWeek" jdbcType="INTEGER"/>
<result column="end_week" property="endWeek" jdbcType="INTEGER"/>
<result column="need_check_item" property="needCheckItem" jdbcType="VARCHAR"/>
<result column="backup_check_item" property="backupCheckItem" jdbcType="VARCHAR"/>
<result column="yn" property="yn" jdbcType="INTEGER"/>
<result column="type" property="type" jdbcType="INTEGER"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
</resultMap>


<insert id="addHospitalCheckItemConf" parameterType="com.lyms.platform.pojo.HospitalCheckItemConf">
insert into hosptial_check_itme_conf
(hospital_id,start_week,end_week,need_check_item,backup_check_item,yn,type
,create_time,update_time) values
(#{hospitalId},#{startWeek},#{endWeek},
#{needCheckItem},#{backupCheckItem},#{yn},#{type},#{createTime},#{updateTime})
</insert>

<select id="selectHospitalCheckItemConfList" parameterType="com.lyms.platform.query.HospitalCheckItemConfQuery"
resultMap="HospitalCheckItemConfMap">
SELECT id,hospital_id,start_week,end_week,need_check_item,backup_check_item,yn,type
,create_time,update_time from hosptial_check_itme_conf
<include refid="HospitalCheckItemConfCondition"/>
<include refid="orderAndLimit"/>
</select>


<update id="updateHospitalCheckItemConf" parameterType="com.lyms.platform.pojo.HospitalCheckItemConf">
update hosptial_check_itme_conf
<set>
need_check_item = #{needCheckItem,jdbcType=VARCHAR},
backup_check_item = #{backupCheckItem,jdbcType=VARCHAR},
<if test="startWeek != null">
start_week = #{startWeek,jdbcType=INTEGER},
</if>
<if test="endWeek != null">
end_week = #{endWeek,jdbcType=INTEGER},
</if>
<if test="yn != null ">
yn = #{yn,jdbcType=INTEGER},
</if>
<if test="type != null ">
type = #{type,jdbcType=INTEGER},
</if>
<if test="updateTime != null ">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>

</set>
where id = #{id,jdbcType=INTEGER}
</update>


<sql id="HospitalCheckItemConfCondition">
<where>
1 = 1
<if test="id != null and id >= 0">
and id = #{id,jdbcType=INTEGER}
</if>
<if test="hospitalId != null">
and hospital_id = #{hospitalId,jdbcType=INTEGER}
</if>
<if test="yn != null and yn >= 0">
and yn = #{yn,jdbcType=INTEGER}
</if>
<if test="type != null ">
and type = #{type,jdbcType=INTEGER}
</if>

<if test="startWeek != null and startWeek >= 0">
<![CDATA[ and start_week >= #{startWeek,jdbcType=INTEGER} ]]>
</if>
<if test="endWeek != null and endWeek >= 0">
<![CDATA[ and end_week <= #{endWeek,jdbcType=INTEGER} ]]>
</if>


</where>
</sql>

<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>

</mapper>