<?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.ltkj.hosp.mapper.DictHospMapper">
|
|
<resultMap type="DictHosp" id="DictHospResult">
|
<result property="hospAreaId" column="hosp_area_id"/>
|
<result property="hospAreaName" column="hosp_area_name"/>
|
<result property="hospid" column="hospId"/>
|
<result property="hospName" column="hosp_name"/>
|
<result property="code" column="code"/>
|
<result property="wbm" column="wbm"/>
|
<result property="spell" column="spell"/>
|
<result property="areaid" column="areaId"/>
|
<result property="areaName" column="area_name"/>
|
<result property="mainHospArea" column="main_hosp_area"/>
|
<result property="principal" column="principal"/>
|
<result property="phone" column="phone"/>
|
<result property="plaitBed" column="plait_bed"/>
|
<result property="openBed" column="open_bed"/>
|
<result property="buildDate" column="build_date"/>
|
<result property="remark" column="remark"/>
|
<result property="createBy" column="create_by"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateBy" column="update_by"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="orderNum" column="order_num"/>
|
<result property="effective" column="effective"/>
|
<result property="createByName" column="create_by_name"/>
|
<result property="updateByName" column="update_by_name"/>
|
<result property="imgbase64" column="imgBase64"/>
|
<result property="deleted" column="deleted"/>
|
</resultMap>
|
|
<sql id="selectDictHospVo">
|
select hosp_area_id,
|
hosp_area_name,
|
hospId,
|
hosp_name,
|
code,
|
wbm,
|
spell,
|
areaId,
|
area_name,
|
main_hosp_area,
|
principal,
|
phone,
|
plait_bed,
|
open_bed,
|
build_date,
|
remark,
|
create_by,
|
create_time,
|
update_by,
|
update_time,
|
order_num,
|
effective,
|
create_by_name,
|
update_by_name,
|
imgBase64,
|
deleted
|
from dict_hosp
|
</sql>
|
|
<select id="selectDictHospList" parameterType="DictHosp" resultMap="DictHospResult">
|
<include refid="selectDictHospVo"/>
|
<where>
|
<if test="hospAreaName != null and hospAreaName != ''">and hosp_area_name like concat('%', #{hospAreaName},
|
'%')
|
</if>
|
<if test="hospid != null and hospid != ''">and hospId = #{hospid}</if>
|
<if test="hospName != null and hospName != ''">and hosp_name like concat('%', #{hospName}, '%')</if>
|
<if test="code != null and code != ''">and code = #{code}</if>
|
<if test="areaid != null and areaid != ''">and areaId = #{areaid}</if>
|
<if test="areaName != null and areaName != ''">and area_name like concat('%', #{areaName}, '%')</if>
|
<if test="mainHospArea != null and mainHospArea != ''">and main_hosp_area = #{mainHospArea}</if>
|
<if test="principal != null and principal != ''">and principal = #{principal}</if>
|
<if test="plaitBed != null ">and plait_bed = #{plaitBed}</if>
|
<if test="openBed != null ">and open_bed = #{openBed}</if>
|
<if test="orderNum != null ">and order_num = #{orderNum}</if>
|
</where>
|
</select>
|
|
<select id="selectDictHospByHospAreaId" parameterType="String" resultMap="DictHospResult">
|
<include refid="selectDictHospVo"/>
|
where hosp_area_id = #{hospAreaId}
|
</select>
|
|
<insert id="insertDictHosp" parameterType="DictHosp">
|
insert into dict_hosp
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="hospAreaId != null">hosp_area_id,</if>
|
<if test="hospAreaName != null and hospAreaName != ''">hosp_area_name,</if>
|
<if test="hospid != null and hospid != ''">hospId,</if>
|
<if test="hospName != null and hospName != ''">hosp_name,</if>
|
<if test="code != null and code != ''">code,</if>
|
<if test="wbm != null">wbm,</if>
|
<if test="spell != null">spell,</if>
|
<if test="areaid != null">areaId,</if>
|
<if test="areaName != null">area_name,</if>
|
<if test="mainHospArea != null and mainHospArea != ''">main_hosp_area,</if>
|
<if test="principal != null">principal,</if>
|
<if test="phone != null">phone,</if>
|
<if test="plaitBed != null">plait_bed,</if>
|
<if test="openBed != null">open_bed,</if>
|
<if test="buildDate != null">build_date,</if>
|
<if test="remark != null">remark,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateBy != null">update_by,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="orderNum != null">order_num,</if>
|
<if test="effective != null and effective != ''">effective,</if>
|
<if test="createByName != null and createByName != ''">create_by_name,</if>
|
<if test="updateByName != null and updateByName != ''">update_by_name,</if>
|
<if test="imgbase64 != null">imgBase64,</if>
|
<if test="deleted != null">deleted,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="hospAreaId != null">#{hospAreaId},</if>
|
<if test="hospAreaName != null and hospAreaName != ''">#{hospAreaName},</if>
|
<if test="hospid != null and hospid != ''">#{hospid},</if>
|
<if test="hospName != null and hospName != ''">#{hospName},</if>
|
<if test="code != null and code != ''">#{code},</if>
|
<if test="wbm != null">#{wbm},</if>
|
<if test="spell != null">#{spell},</if>
|
<if test="areaid != null">#{areaid},</if>
|
<if test="areaName != null">#{areaName},</if>
|
<if test="mainHospArea != null and mainHospArea != ''">#{mainHospArea},</if>
|
<if test="principal != null">#{principal},</if>
|
<if test="phone != null">#{phone},</if>
|
<if test="plaitBed != null">#{plaitBed},</if>
|
<if test="openBed != null">#{openBed},</if>
|
<if test="buildDate != null">#{buildDate},</if>
|
<if test="remark != null">#{remark},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="orderNum != null">#{orderNum},</if>
|
<if test="effective != null and effective != ''">#{effective},</if>
|
<if test="createByName != null and createByName != ''">#{createByName},</if>
|
<if test="updateByName != null and updateByName != ''">#{updateByName},</if>
|
<if test="imgbase64 != null">#{imgbase64},</if>
|
<if test="deleted != null">#{deleted},</if>
|
</trim>
|
</insert>
|
|
<update id="updateDictHosp" parameterType="DictHosp">
|
update dict_hosp
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="hospAreaName != null and hospAreaName != ''">hosp_area_name = #{hospAreaName},</if>
|
<if test="hospid != null and hospid != ''">hospId = #{hospid},</if>
|
<if test="hospName != null and hospName != ''">hosp_name = #{hospName},</if>
|
<if test="code != null and code != ''">code = #{code},</if>
|
<if test="wbm != null">wbm = #{wbm},</if>
|
<if test="spell != null">spell = #{spell},</if>
|
<if test="areaid != null">areaId = #{areaid},</if>
|
<if test="areaName != null">area_name = #{areaName},</if>
|
<if test="mainHospArea != null and mainHospArea != ''">main_hosp_area = #{mainHospArea},</if>
|
<if test="principal != null">principal = #{principal},</if>
|
<if test="phone != null">phone = #{phone},</if>
|
<if test="plaitBed != null">plait_bed = #{plaitBed},</if>
|
<if test="openBed != null">open_bed = #{openBed},</if>
|
<if test="buildDate != null">build_date = #{buildDate},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
<if test="effective != null and effective != ''">effective = #{effective},</if>
|
<if test="createByName != null and createByName != ''">create_by_name = #{createByName},</if>
|
<if test="updateByName != null and updateByName != ''">update_by_name = #{updateByName},</if>
|
<if test="imgbase64 != null">imgBase64 = #{imgbase64},</if>
|
<if test="deleted != null">deleted = #{deleted},</if>
|
</trim>
|
where hosp_area_id = #{hospAreaId}
|
</update>
|
|
<delete id="deleteDictHospByHospAreaId" parameterType="String">
|
delete
|
from dict_hosp
|
where hosp_area_id = #{hospAreaId}
|
</delete>
|
|
<delete id="deleteDictHospByHospAreaIds" parameterType="String">
|
delete from dict_hosp where hosp_area_id in
|
<foreach item="hospAreaId" collection="array" open="(" separator="," close=")">
|
#{hospAreaId}
|
</foreach>
|
</delete>
|
</mapper>
|