| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?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.fs.his.mapper.FsHospitalMapper">
- <resultMap type="FsHospital" id="FsHospitalResult">
- <result property="hospitalId" column="hospital_id" />
- <result property="hospitalName" column="hospital_name" />
- <result property="hospitalType" column="hospital_type" />
- <result property="hospitalLevel" column="hospital_level" />
- <result property="descs" column="descs" />
- <result property="imgUrl" column="img_url" />
- <result property="cityIds" column="city_ids" />
- <result property="province" column="province" />
- <result property="city" column="city" />
- <result property="district" column="district" />
- <result property="address" column="address" />
- <result property="lng" column="lng" />
- <result property="lat" column="lat" />
- <result property="status" column="status" />
- <result property="remark" column="remark" />
- <result property="sealUrl" column="seal_url" />
- <result property="phone" column="phone" />
- </resultMap>
- <sql id="selectFsHospitalVo">
- select hospital_id, hospital_name, hospital_type, hospital_level, descs, img_url, city_ids, province, city, district, address, lng, lat, status, remark, seal_url, phone from fs_hospital
- </sql>
- <select id="selectFsHospitalList" parameterType="FsHospital" resultMap="FsHospitalResult">
- <include refid="selectFsHospitalVo"/>
- <where>
- <if test="hospitalName != null and hospitalName != ''"> and hospital_name like concat('%', #{hospitalName}, '%')</if>
- <if test="hospitalType != null "> and hospital_type = #{hospitalType}</if>
- <if test="hospitalLevel != null "> and hospital_level = #{hospitalLevel}</if>
- <if test="descs != null and descs != ''"> and descs = #{descs}</if>
- <if test="imgUrl != null and imgUrl != ''"> and img_url = #{imgUrl}</if>
- <if test="cityIds != null and cityIds != ''"> and city_ids = #{cityIds}</if>
- <if test="province != null and province != ''"> and province = #{province}</if>
- <if test="city != null and city != ''"> and city = #{city}</if>
- <if test="district != null and district != ''"> and district = #{district}</if>
- <if test="address != null and address != ''"> and address = #{address}</if>
- <if test="lng != null and lng != ''"> and lng = #{lng}</if>
- <if test="lat != null and lat != ''"> and lat = #{lat}</if>
- <if test="status != null "> and status = #{status}</if>
- <if test="sealUrl != null and sealUrl != ''"> and seal_url = #{sealUrl}</if>
- <if test="phone != null and phone != ''"> and phone = #{phone}</if>
- </where>
- ORDER BY hospital_id DESC
- </select>
- <select id="selectFsHospitalByHospitalId" parameterType="Long" resultMap="FsHospitalResult">
- <include refid="selectFsHospitalVo"/>
- where hospital_id = #{hospitalId}
- </select>
- <insert id="insertFsHospital" parameterType="FsHospital" useGeneratedKeys="true" keyProperty="hospitalId">
- insert into fs_hospital
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="hospitalName != null">hospital_name,</if>
- <if test="hospitalType != null">hospital_type,</if>
- <if test="hospitalLevel != null">hospital_level,</if>
- <if test="descs != null">descs,</if>
- <if test="imgUrl != null">img_url,</if>
- <if test="cityIds != null">city_ids,</if>
- <if test="province != null">province,</if>
- <if test="city != null">city,</if>
- <if test="district != null">district,</if>
- <if test="address != null">address,</if>
- <if test="lng != null">lng,</if>
- <if test="lat != null">lat,</if>
- <if test="status != null">status,</if>
- <if test="remark != null">remark,</if>
- <if test="sealUrl != null">seal_url,</if>
- <if test="phone != null">phone,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="hospitalName != null">#{hospitalName},</if>
- <if test="hospitalType != null">#{hospitalType},</if>
- <if test="hospitalLevel != null">#{hospitalLevel},</if>
- <if test="descs != null">#{descs},</if>
- <if test="imgUrl != null">#{imgUrl},</if>
- <if test="cityIds != null">#{cityIds},</if>
- <if test="province != null">#{province},</if>
- <if test="city != null">#{city},</if>
- <if test="district != null">#{district},</if>
- <if test="address != null">#{address},</if>
- <if test="lng != null">#{lng},</if>
- <if test="lat != null">#{lat},</if>
- <if test="status != null">#{status},</if>
- <if test="remark != null">#{remark},</if>
- <if test="sealUrl != null">#{sealUrl},</if>
- <if test="phone != null">#{phone},</if>
- </trim>
- </insert>
- <update id="updateFsHospital" parameterType="FsHospital">
- update fs_hospital
- <trim prefix="SET" suffixOverrides=",">
- <if test="hospitalName != null">hospital_name = #{hospitalName},</if>
- <if test="hospitalType != null">hospital_type = #{hospitalType},</if>
- <if test="hospitalLevel != null">hospital_level = #{hospitalLevel},</if>
- <if test="descs != null">descs = #{descs},</if>
- <if test="imgUrl != null">img_url = #{imgUrl},</if>
- <if test="cityIds != null">city_ids = #{cityIds},</if>
- <if test="province != null">province = #{province},</if>
- <if test="city != null">city = #{city},</if>
- <if test="district != null">district = #{district},</if>
- <if test="address != null">address = #{address},</if>
- <if test="lng != null">lng = #{lng},</if>
- <if test="lat != null">lat = #{lat},</if>
- <if test="status != null">status = #{status},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="sealUrl != null">seal_url = #{sealUrl},</if>
- <if test="phone != null">phone = #{phone},</if>
- </trim>
- where hospital_id = #{hospitalId}
- </update>
- <delete id="deleteFsHospitalByHospitalId" parameterType="Long">
- delete from fs_hospital where hospital_id = #{hospitalId}
- </delete>
- <delete id="deleteFsHospitalByHospitalIds" parameterType="String">
- delete from fs_hospital where hospital_id in
- <foreach item="hospitalId" collection="array" open="(" separator="," close=")">
- #{hospitalId}
- </foreach>
- </delete>
- </mapper>
|