MasterCheckItem.xml 2.96 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
<?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.MasterCheckItemMapper">

<resultMap id="CheckItemMap" type="com.lyms.platform.permission.model.CheckItem">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="project" property="project" jdbcType="VARCHAR"/>
<result column="project_info" property="projectInfo" jdbcType="VARCHAR"/>
<result column="check_attention" property="checkAttention" jdbcType="VARCHAR"/>
<result column="hospital_id" property="hospitalId" jdbcType="VARCHAR"/>
<result column="type" property="type" jdbcType="INTEGER"/>
</resultMap>
<select id="getCheckItemList" resultMap="CheckItemMap" parameterType="java.util.Map">
SELECT id,project,type,project_info,check_attention,hospital_id FROM lyms_week_project
where 1=1
<if test="type != null and type >= 0">
and type = #{type,jdbcType=INTEGER}
</if>
<if test="hospitalId != null and hospitalId != ''">
and hospital_id = #{hospitalId,jdbcType=VARCHAR}
</if>
</select>

<select id="addCheckItem" parameterType="com.lyms.platform.permission.model.CheckItem">
INSERT INTO lyms_week_project(project,project_info,check_attention,hospital_id,type)
VALUES (#{project},#{projectInfo},#{checkAttention},#{hospitalId},#{type})
</select>

<select id="getOne" resultType="java.lang.String" parameterType="java.lang.Integer">
SELECT project FROM lyms_week_project WHERE id=#{id,jdbcType=INTEGER}
</select>

<select id="xcxGetCheckItemList" resultMap="CheckItemMap" parameterType="java.lang.Integer">
SELECT id,project,project_info,check_attention,hospital_id FROM lyms_week_project WHERE id=#{id,jdbcType=INTEGER}
</select>

<update id="updateCheckItem" parameterType="com.lyms.platform.permission.model.CheckItem" >
update lyms_week_project
<set>
<if test="project != null and project != ''">
project = #{project,jdbcType=VARCHAR},
</if>
<if test="projectInfo != null and projectInfo != ''">
project_info = #{projectInfo,jdbcType=VARCHAR},
</if>
<if test="checkAttention != null and checkAttention != ''">
check_attention = #{checkAttention,jdbcType=VARCHAR},
</if>
<if test="hospitalId != null and hospitalId != ''">
hospital_id = #{hospitalId,jdbcType=VARCHAR},
</if>
<if test="type != null and type >= 0">
type = #{type,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>

<delete id="deleteCheckItem" parameterType="java.lang.Integer">
delete from lyms_week_project where id = #{id,jdbcType=INTEGER}
</delete>

</mapper>