HospitalServiceContent.xml 6.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
  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
<?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"/>
<result column="sync_status" property="syncStatus" jdbcType="INTEGER"/>

<result column="weekPrice" property="weekPrice" jdbcType="DECIMAL"/>
<result column="devicePrice" property="devicePrice" jdbcType="DECIMAL"/>
<result column="deviceCon" property="deviceCon" 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,sync_status,weekPrice,deviceCon,devicePrice) values
(#{id},#{hospitalId},#{serType},#{serPrice},#{createDate},#{createUser},#{status},#{syncStatus},#{weekPrice},#{deviceCon},#{devicePrice})
</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="weekPrice != null">
weekPrice = #{weekPrice,jdbcType=DECIMAL},
</if>
<if test="deviceCon != null and deviceCon >= 0">
deviceCon = #{deviceCon,jdbcType=INTEGER},
</if>
<if test="devicePrice != null">
devicePrice = #{devicePrice,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>
<if test="syncStatus != null and syncStatus >= 0">
sync_status = #{syncStatus,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,sync_status,weekPrice
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="weekPrice != null">
and weekPrice = #{weekPrice,jdbcType=DECIMAL}
</if>
<if test="devicePrice != null">
and devicePrice = #{devicePrice,jdbcType=DECIMAL}
</if>
<if test="deviceCon != null and deviceCon >= 0">
and deviceCon = #{deviceCon,jdbcType=INTEGER}
</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>
<if test="syncStatus != null and syncStatus >= 0">
and sync_status = #{syncStatus,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,sync_status,weekPrice,devicePrice,deviceCon from hospital_service_content
<include refid="HospitalServiceContentCondition"/>
group by hospital_id
<include refid="orderAndLimit"/>
</select>

<select id="queryGroupHospitalServiceContentCount" resultType="INTEGER"
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,sync_status,weekPrice,devicePrice,deviceCon
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>