<?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.ruoyi.system.mapper.TbHospDataMapper">
|
|
<resultMap type="TbHospData" id="TbHospDataResult">
|
<id property="hospId" column="hosp_id" />
|
<result property="legacyHospId" column="legacy_hosp_id" />
|
<result property="hospName" column="hosp_name" />
|
<result property="hospCityId" column="hosp_city_id" />
|
<result property="hospShort" column="hosp_short" />
|
<result property="hopsProvince" column="hops_province" />
|
<result property="hopsCity" column="hops_city" />
|
<result property="hopsArea" column="hops_area" />
|
<result property="hospAddress" column="hosp_address" />
|
<result property="hospTel" column="hosp_tel" />
|
<result property="hospUnitId" column="hosp_unit_id" />
|
<result property="hospState" column="hosp_state" />
|
<result property="hospOaId" column="hosp_oa_id" />
|
<result property="hospIntroducerId" column="hosp_introducer_id" />
|
<result property="hospIntroducerDate" column="hosp_introducer_date" />
|
<result property="hospLevel" column="hosp_level" />
|
<result property="status" column="status" />
|
<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" />
|
</resultMap>
|
|
<sql id="selectTbHospDataVo">
|
select hosp_id, legacy_hosp_id, hosp_name, hosp_city_id, hosp_short,
|
hops_province, hops_city, hops_area, hosp_address, hosp_tel,
|
hosp_unit_id, hosp_state, hosp_oa_id, hosp_introducer_id,
|
hosp_introducer_date, hosp_level, status, remark,
|
create_by, create_time, update_by, update_time
|
from tb_hosp_data
|
</sql>
|
|
<select id="selectTbHospDataList" parameterType="TbHospData" resultMap="TbHospDataResult">
|
<include refid="selectTbHospDataVo"/>
|
<where>
|
<if test="legacyHospId != null">
|
and legacy_hosp_id = #{legacyHospId}
|
</if>
|
<if test="hospName != null and hospName != ''">
|
and hosp_name like concat('%', #{hospName}, '%')
|
</if>
|
<if test="hopsProvince != null and hopsProvince != ''">
|
and hops_province like concat('%', #{hopsProvince}, '%')
|
</if>
|
<if test="hopsCity != null and hopsCity != ''">
|
and hops_city like concat('%', #{hopsCity}, '%')
|
</if>
|
<if test="hopsArea != null and hopsArea != ''">
|
and hops_area like concat('%', #{hopsArea}, '%')
|
</if>
|
<if test="status != null and status != ''">
|
and status = #{status}
|
</if>
|
</where>
|
order by hosp_id desc
|
</select>
|
|
<select id="selectTbHospDataById" parameterType="Long" resultMap="TbHospDataResult">
|
<include refid="selectTbHospDataVo"/>
|
where hosp_id = #{hospId}
|
</select>
|
|
<select id="selectTbHospDataByLegacyId" parameterType="Integer" resultMap="TbHospDataResult">
|
<include refid="selectTbHospDataVo"/>
|
where legacy_hosp_id = #{legacyHospId}
|
</select>
|
|
<insert id="insertTbHospData" parameterType="TbHospData" useGeneratedKeys="true" keyProperty="hospId">
|
insert into tb_hosp_data(
|
<if test="legacyHospId != null">legacy_hosp_id,</if>
|
<if test="hospName != null and hospName != ''">hosp_name,</if>
|
<if test="hospCityId != null">hosp_city_id,</if>
|
<if test="hospShort != null">hosp_short,</if>
|
<if test="hopsProvince != null">hops_province,</if>
|
<if test="hopsCity != null">hops_city,</if>
|
<if test="hopsArea != null">hops_area,</if>
|
<if test="hospAddress != null">hosp_address,</if>
|
<if test="hospTel != null">hosp_tel,</if>
|
<if test="hospUnitId != null">hosp_unit_id,</if>
|
<if test="hospState != null">hosp_state,</if>
|
<if test="hospOaId != null">hosp_oa_id,</if>
|
<if test="hospIntroducerId != null">hosp_introducer_id,</if>
|
<if test="hospIntroducerDate != null">hosp_introducer_date,</if>
|
<if test="hospLevel != null">hosp_level,</if>
|
<if test="status != null">status,</if>
|
<if test="remark != null">remark,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
create_time
|
)values(
|
<if test="legacyHospId != null">#{legacyHospId},</if>
|
<if test="hospName != null and hospName != ''">#{hospName},</if>
|
<if test="hospCityId != null">#{hospCityId},</if>
|
<if test="hospShort != null">#{hospShort},</if>
|
<if test="hopsProvince != null">#{hopsProvince},</if>
|
<if test="hopsCity != null">#{hopsCity},</if>
|
<if test="hopsArea != null">#{hopsArea},</if>
|
<if test="hospAddress != null">#{hospAddress},</if>
|
<if test="hospTel != null">#{hospTel},</if>
|
<if test="hospUnitId != null">#{hospUnitId},</if>
|
<if test="hospState != null">#{hospState},</if>
|
<if test="hospOaId != null">#{hospOaId},</if>
|
<if test="hospIntroducerId != null">#{hospIntroducerId},</if>
|
<if test="hospIntroducerDate != null">#{hospIntroducerDate},</if>
|
<if test="hospLevel != null">#{hospLevel},</if>
|
<if test="status != null">#{status},</if>
|
<if test="remark != null">#{remark},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
sysdate()
|
)
|
</insert>
|
|
<update id="updateTbHospData" parameterType="TbHospData">
|
update tb_hosp_data
|
<set>
|
<if test="legacyHospId != null">legacy_hosp_id = #{legacyHospId},</if>
|
<if test="hospName != null and hospName != ''">hosp_name = #{hospName},</if>
|
<if test="hospCityId != null">hosp_city_id = #{hospCityId},</if>
|
<if test="hospShort != null">hosp_short = #{hospShort},</if>
|
<if test="hopsProvince != null">hops_province = #{hopsProvince},</if>
|
<if test="hopsCity != null">hops_city = #{hopsCity},</if>
|
<if test="hopsArea != null">hops_area = #{hopsArea},</if>
|
<if test="hospAddress != null">hosp_address = #{hospAddress},</if>
|
<if test="hospTel != null">hosp_tel = #{hospTel},</if>
|
<if test="hospUnitId != null">hosp_unit_id = #{hospUnitId},</if>
|
<if test="hospState != null">hosp_state = #{hospState},</if>
|
<if test="hospOaId != null">hosp_oa_id = #{hospOaId},</if>
|
<if test="hospIntroducerId != null">hosp_introducer_id = #{hospIntroducerId},</if>
|
<if test="hospIntroducerDate != null">hosp_introducer_date = #{hospIntroducerDate},</if>
|
<if test="hospLevel != null">hosp_level = #{hospLevel},</if>
|
<if test="status != null">status = #{status},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
update_time = sysdate()
|
</set>
|
where hosp_id = #{hospId}
|
</update>
|
|
<delete id="deleteTbHospDataById" parameterType="Long">
|
delete from tb_hosp_data where hosp_id = #{hospId}
|
</delete>
|
|
<delete id="deleteTbHospDataByIds" parameterType="Long">
|
delete from tb_hosp_data where hosp_id in
|
<foreach collection="array" item="hospId" open="(" separator="," close=")">
|
#{hospId}
|
</foreach>
|
</delete>
|
|
</mapper>
|