health_parent/health_hosp/target/classes/mapper/hospital/YcHospitalMapper.xml

113 lines
4.9 KiB
XML
Raw Normal View History

2024-07-03 19:49:48 +08:00
<?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="cn.card.health.mapper.hospital.YcHospitalMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="YcHospital" id="YcHospitalResult">
<result property="hospid" column="hospid"/>
<result property="hospname" column="hospname"/>
<result property="wechathospid" column="wechathospid"/>
<result property="hospcode" column="hospcode"/>
<result property="delFlag" column="del_flag"/>
<result property="createtime" column="createtime"/>
<result property="createby" column="createby"/>
<result property="updatetime" column="updatetime"/>
<result property="updateby" column="updateby"/>
</resultMap>
<sql id="selectYcHospitalVo">
select
hospid,
hospname,
wechathospid,
hospcode,
del_flag,
createtime,
createby,
updatetime,
updateby
from yc_hospital
</sql>
<select id="selectListYcHospital" parameterType="YcHospital" resultMap="YcHospitalResult">
<include refid="selectYcHospitalVo"/>
<where>
<if test="hospid != null">and hospid=#{hospid}</if>
<if test="hospname != null">and hospname=#{hospname}</if>
<if test="wechathospid != null">and wechathospid=#{wechathospid}</if>
<if test="hospcode != null">and hospcode=#{hospcode}</if>
<if test="delFlag != null">and del_flag=#{delFlag}</if>
<if test="createtime != null">and createtime=#{createtime}</if>
<if test="createby != null">and createby=#{createby}</if>
<if test="updatetime != null">and updatetime=#{updatetime}</if>
<if test="updateby != null">and updateby=#{updateby}</if>
</where>
</select>
<select id="selectYcHospital" parameterType="YcHospital" resultMap="YcHospitalResult">
<include refid="selectYcHospitalVo"/>
<where>
<if test="hospid != null">and hospid=#{hospid}</if>
<if test="hospname != null">and hospname=#{hospname}</if>
<if test="wechathospid != null">and wechathospid=#{wechathospid}</if>
<if test="hospcode != null">and hospcode=#{hospcode}</if>
<if test="delFlag != null">and del_flag=#{delFlag}</if>
<if test="createtime != null">and createtime=#{createtime}</if>
<if test="createby != null">and createby=#{createby}</if>
<if test="updatetime != null">and updatetime=#{updatetime}</if>
<if test="updateby != null">and updateby=#{updateby}</if>
</where>
</select>
<select id="selectYcHospitalById" parameterType="Long" resultMap="YcHospitalResult">
<include refid="selectYcHospitalVo"/>
where hospid = #{hospid}
</select>
<insert id="insertYcHospital" parameterType="YcHospital" useGeneratedKeys="true" keyProperty="hospid">
insert into yc_hospital
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="hospid != null">hospid,</if>
<if test="hospname != null">hospname,</if>
<if test="wechathospid != null">wechathospid,</if>
<if test="hospcode != null">hospcode,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createtime != null">createtime,</if>
<if test="createby != null">createby,</if>
<if test="updatetime != null">updatetime,</if>
<if test="updateby != null">updateby,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="hospid != null">#{hospid},</if>
<if test="hospname != null">#{hospname},</if>
<if test="wechathospid != null">#{wechathospid},</if>
<if test="hospcode != null">#{hospcode},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createtime != null">#{createtime},</if>
<if test="createby != null">#{createby},</if>
<if test="updatetime != null">#{updatetime},</if>
<if test="updateby != null">#{updateby},</if>
</trim>
</insert>
<update id="updateYcHospital" parameterType="YcHospital">
update yc_hospital
<set>
<if test="hospid != null">hospid = #{hospid},</if>
<if test="hospname != null">hospname = #{hospname},</if>
<if test="wechathospid != null">wechathospid = #{wechathospid},</if>
<if test="hospcode != null">hospcode = #{hospcode},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createtime != null">createtime = #{createtime},</if>
<if test="createby != null">createby = #{createby},</if>
<if test="updatetime != null">updatetime = #{updatetime},</if>
<if test="updateby != null">updateby = #{updateby},</if>
</set>
where hospid = #{hospid}
</update>
<delete id="deleteYcHospitalById" parameterType="Long">
update sys_dept set del_flag = '2' where hospid = #{hospid}
</delete>
</mapper>