HospitalServiceContent.xml 5.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
<?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.HospitalServiceContentMapper">

<resultMap id="HospitalServiceContentResultMap" type="com.lyms.platform.permission.model.HospitalServiceContent">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="hospital_id" property="hospitalId" jdbcType="VARCHAR"/>
<result column="ser_type" property="serType" jdbcType="INTEGER"/>
<result column="ser_types" property="serTypes" jdbcType="VARCHAR"/>
<result column="ser_price" property="serPrice" jdbcType="DECIMAL"/>
<result column="create_date" property="createDate" jdbcType="TIMESTAMP"/>
<result column="create_user" property="createUser" jdbcType="VARCHAR"/>
<result column="status" property="status" jdbcType="INTEGER"/>
</resultMap>


<insert id="addHospitalServiceContent" parameterType="com.lyms.platform.permission.model.HospitalServiceContent">
insert into hospital_service_content (id,hospital_id,ser_type,ser_price,create_date,create_user,status) values (#{id},#{hospitalId},#{serType},#{serPrice},#{createDate},#{createUser},#{status})
</insert>


<update id="updateHospitalServiceContent" parameterType="com.lyms.platform.permission.model.HospitalServiceContent">
update hospital_service_content
<set>
<if test="hospitalId != null and hospitalId != ''">
hospital_id = #{hospitalId,jdbcType=VARCHAR},
</if>
<if test="serType != null and serType >= 0">
ser_type = #{serType,jdbcType=INTEGER},
</if>
<if test="serPrice != null">
ser_price = #{serPrice,jdbcType=DECIMAL},
</if>
<if test="createDate != null">
create_date = #{createDate,jdbcType=TIMESTAMP},
</if>
<if test="createUser != null and createUser != ''">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
<if test="status != null and status >= 0">
status = #{status,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>


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


<select id="getHospitalServiceContent" resultMap="HospitalServiceContentResultMap" parameterType="java.lang.String">
select id,hospital_id,ser_type,ser_price,create_date,create_user,status
from hospital_service_content 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="HospitalServiceContentCondition">
<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="serType != null and serType >= 0">
and ser_type = #{serType,jdbcType=INTEGER}
</if>
<if test="serPrice != null">
and ser_price = #{serPrice,jdbcType=DECIMAL}
</if>
<if test="createDate != null">
and create_date = #{createDate,jdbcType=TIMESTAMP}
</if>
<if test="createUser != null and createUser != ''">
and create_user = #{createUser,jdbcType=VARCHAR}
</if>
<if test="status != null and status >= 0">
and status = #{status,jdbcType=INTEGER}
</if>
</where>
</sql>


<select id="queryGroupHospitalServiceContent" resultMap="HospitalServiceContentResultMap"
parameterType="com.lyms.platform.permission.model.HospitalServiceContentQuery">
select hospital_id,group_concat(ser_type) as ser_types,create_date,create_user from hospital_service_content
<include refid="HospitalServiceContentCondition"/>
group by hospital_id
<include refid="orderAndLimit"/>
</select>

<select id="queryGroupHospitalServiceContentCount" resultType="int"
parameterType="com.lyms.platform.permission.model.HospitalServiceContentQuery">
select count(1) from hospital_service_content
<include refid="HospitalServiceContentCondition"/>
group by hospital_id
</select>


<select id="queryHospitalServiceContent" resultMap="HospitalServiceContentResultMap"
parameterType="com.lyms.platform.permission.model.HospitalServiceContentQuery">
select id,hospital_id,ser_type,ser_price,create_date,create_user,status
from hospital_service_content
<include refid="HospitalServiceContentCondition"/>
<include refid="orderAndLimit"/>
</select>


<select id="queryHospitalServiceContentCount" resultType="int"
parameterType="com.lyms.platform.permission.model.HospitalServiceContentQuery">
select count(1) from hospital_service_content
<include refid="HospitalServiceContentCondition"/>
</select>


</mapper>