HospitalDoctService.xml 5.63 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
<?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.HospitalDoctServiceMapper">

<resultMap id="HospitalDoctServiceResultMap" type="com.lyms.platform.permission.model.HospitalDoctService">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="hosp_service_id" property="hospServiceId" jdbcType="VARCHAR"/>
<result column="doct_id" property="doctId" jdbcType="VARCHAR"/>
<result column="hosp_id" property="hospId" jdbcType="VARCHAR"/>
<result column="doct_price" property="doctPrice" jdbcType="DECIMAL"/>
<result column="devicePrice" property="devicePrice" jdbcType="DECIMAL"/>
<result column="deviceCon" property="deviceCon" jdbcType="INTEGER"/>
<result column="status" property="status" jdbcType="INTEGER"/>
<result column="sync_status" property="syncStatus" jdbcType="INTEGER"/>
<result column="weekPrice" property="weekPrice" jdbcType="DECIMAL"/>
</resultMap>


<insert id="addHospitalDoctService" parameterType="com.lyms.platform.permission.model.HospitalDoctService">
insert into hospital_doct_service (id,hosp_service_id,doct_id,hosp_id,doct_price,status,sync_status,devicePrice,deviceCon,weekPrice) values
(#{id},#{hospServiceId},#{doctId},#{hospId},#{doctPrice},#{status},#{syncStatus},#{devicePrice},#{deviceCon},#{weekPrice})
</insert>


<update id="updateHospitalDoctService" parameterType="com.lyms.platform.permission.model.HospitalDoctService">
update hospital_doct_service
<set>
<if test="hospServiceId != null and hospServiceId != ''">
hosp_service_id = #{hospServiceId,jdbcType=VARCHAR},
</if>
<if test="doctId != null and doctId != ''">
doct_id = #{doctId,jdbcType=VARCHAR},
</if>
<if test="hospId != null and hospId != ''">
hosp_id = #{hospId,jdbcType=VARCHAR},
</if>
<if test="doctPrice != null">
doct_price = #{doctPrice,jdbcType=DECIMAL},
</if>
<if test="devicePrice != null">
devicePrice = #{devicePrice,jdbcType=DECIMAL},
</if>
<if test="weekPrice != null">
weekPrice = #{weekPrice,jdbcType=DECIMAL},
</if>
<if test="status != null and status >= 0">
status = #{status,jdbcType=INTEGER},
</if>
<if test="deviceCon != null and deviceCon >= 0">
deviceCon = #{deviceCon,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="deleteHospitalDoctService" parameterType="java.lang.String">
delete from hospital_doct_service where id = #{id,jdbcType=VARCHAR}
</delete>


<select id="getHospitalDoctService" resultMap="HospitalDoctServiceResultMap" parameterType="java.lang.String">
select id,hosp_service_id,doct_id,hosp_id,doct_price,status,sync_status
from hospital_doct_service 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="HospitalDoctServiceCondition">
<where>
1 = 1
<if test="id != null and id != ''">
and id = #{id,jdbcType=VARCHAR}
</if>
<if test="hospServiceId != null and hospServiceId != ''">
and hosp_service_id = #{hospServiceId,jdbcType=VARCHAR}
</if>
<if test="doctId != null and doctId != ''">
and doct_id = #{doctId,jdbcType=VARCHAR}
</if>
<if test="hospId != null and hospId != ''">
and hosp_id = #{hospId,jdbcType=VARCHAR}
</if>
<if test="doctPrice != null">
and doct_price = #{doctPrice,jdbcType=DECIMAL}
</if>
<if test="devicePrice != null">
and devicePrice = #{devicePrice,jdbcType=DECIMAL}
</if>
<if test="weekPrice != null">
and weekPrice = #{weekPrice,jdbcType=DECIMAL}
</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>

<if test="deviceCon != null and deviceCon >= 0">
and deviceCon = #{deviceCon,jdbcType=INTEGER}
</if>
</where>
</sql>


<select id="queryHospitalDoctService" resultMap="HospitalDoctServiceResultMap"
parameterType="com.lyms.platform.permission.model.HospitalDoctServiceQuery">
select id,hosp_service_id,doct_id,hosp_id,doct_price,status,sync_status,devicePrice,deviceCon,weekPrice
from hospital_doct_service
<include refid="HospitalDoctServiceCondition"/>
<include refid="orderAndLimit"/>
</select>


<select id="queryHospitalDoctServiceCount" resultType="int"
parameterType="com.lyms.platform.permission.model.HospitalDoctServiceQuery">
select count(1) from hospital_doct_service
<include refid="HospitalDoctServiceCondition"/>
</select>


</mapper>