PostDischargePatientManage/postdischarge-manage/src/main/resources/mapper/manage/projectdevice/ProjectDeviceMapper.xml

179 lines
9.7 KiB
XML
Raw Normal View History

2024-03-05 17:30:49 +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="com.xinelu.manage.mapper.projectdevice.ProjectDeviceMapper">
<resultMap id="BaseResultMap" type="com.xinelu.manage.domain.projectdevice.ProjectDevice">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="patientId" column="patient_id" jdbcType="BIGINT"/>
<result property="patientName" column="patient_name" jdbcType="VARCHAR"/>
<result property="cardNo" column="card_no" jdbcType="VARCHAR"/>
<result property="deviceType" column="device_type" jdbcType="VARCHAR"/>
<result property="deviceName" column="device_name" jdbcType="VARCHAR"/>
<result property="deviceCode" column="device_code" jdbcType="VARCHAR"/>
<result property="deviceStatus" column="device_status" jdbcType="VARCHAR"/>
<result property="deviceRemark" column="device_remark" jdbcType="VARCHAR"/>
<result property="deviceBindTime" column="device_bind_time" jdbcType="TIMESTAMP"/>
<result property="deviceUnbindTime" column="device_unbind_time" jdbcType="TIMESTAMP"/>
<result property="deviceIp" column="device_ip" jdbcType="VARCHAR"/>
<result property="devicePort" column="device_port" jdbcType="INTEGER"/>
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id,patient_id,patient_name,
card_no,device_type,device_name,
device_code,device_status,device_remark,
device_bind_time,device_unbind_time,device_ip,
device_port,create_by,create_time,
update_by,update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from project_device
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from project_device
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.xinelu.manage.domain.projectdevice.ProjectDevice" useGeneratedKeys="true">
insert into project_device
( id,patient_id,patient_name
,card_no,device_type,device_name
,device_code,device_status,device_remark
,device_bind_time,device_unbind_time,device_ip
,device_port,create_by,create_time
,update_by,update_time)
values (#{id,jdbcType=BIGINT},#{patientId,jdbcType=BIGINT},#{patientName,jdbcType=VARCHAR}
,#{cardNo,jdbcType=VARCHAR},#{deviceType,jdbcType=VARCHAR},#{deviceName,jdbcType=VARCHAR}
,#{deviceCode,jdbcType=VARCHAR},#{deviceStatus,jdbcType=VARCHAR},#{deviceRemark,jdbcType=VARCHAR}
,#{deviceBindTime,jdbcType=TIMESTAMP},#{deviceUnbindTime,jdbcType=TIMESTAMP},#{deviceIp,jdbcType=VARCHAR}
,#{devicePort,jdbcType=INTEGER},#{createBy,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP}
,#{updateBy,jdbcType=VARCHAR},#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.xinelu.manage.domain.projectdevice.ProjectDevice" useGeneratedKeys="true">
insert into project_device
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="patientId != null">patient_id,</if>
<if test="patientName != null">patient_name,</if>
<if test="cardNo != null">card_no,</if>
<if test="deviceType != null">device_type,</if>
<if test="deviceName != null">device_name,</if>
<if test="deviceCode != null">device_code,</if>
<if test="deviceStatus != null">device_status,</if>
<if test="deviceRemark != null">device_remark,</if>
<if test="deviceBindTime != null">device_bind_time,</if>
<if test="deviceUnbindTime != null">device_unbind_time,</if>
<if test="deviceIp != null">device_ip,</if>
<if test="devicePort != null">device_port,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id,jdbcType=BIGINT},</if>
<if test="patientId != null">#{patientId,jdbcType=BIGINT},</if>
<if test="patientName != null">#{patientName,jdbcType=VARCHAR},</if>
<if test="cardNo != null">#{cardNo,jdbcType=VARCHAR},</if>
<if test="deviceType != null">#{deviceType,jdbcType=VARCHAR},</if>
<if test="deviceName != null">#{deviceName,jdbcType=VARCHAR},</if>
<if test="deviceCode != null">#{deviceCode,jdbcType=VARCHAR},</if>
<if test="deviceStatus != null">#{deviceStatus,jdbcType=VARCHAR},</if>
<if test="deviceRemark != null">#{deviceRemark,jdbcType=VARCHAR},</if>
<if test="deviceBindTime != null">#{deviceBindTime,jdbcType=TIMESTAMP},</if>
<if test="deviceUnbindTime != null">#{deviceUnbindTime,jdbcType=TIMESTAMP},</if>
<if test="deviceIp != null">#{deviceIp,jdbcType=VARCHAR},</if>
<if test="devicePort != null">#{devicePort,jdbcType=INTEGER},</if>
<if test="createBy != null">#{createBy,jdbcType=VARCHAR},</if>
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
<if test="updateBy != null">#{updateBy,jdbcType=VARCHAR},</if>
<if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.xinelu.manage.domain.projectdevice.ProjectDevice">
update project_device
<set>
<if test="patientId != null">
patient_id = #{patientId,jdbcType=BIGINT},
</if>
<if test="patientName != null">
patient_name = #{patientName,jdbcType=VARCHAR},
</if>
<if test="cardNo != null">
card_no = #{cardNo,jdbcType=VARCHAR},
</if>
<if test="deviceType != null">
device_type = #{deviceType,jdbcType=VARCHAR},
</if>
<if test="deviceName != null">
device_name = #{deviceName,jdbcType=VARCHAR},
</if>
<if test="deviceCode != null">
device_code = #{deviceCode,jdbcType=VARCHAR},
</if>
<if test="deviceStatus != null">
device_status = #{deviceStatus,jdbcType=VARCHAR},
</if>
<if test="deviceRemark != null">
device_remark = #{deviceRemark,jdbcType=VARCHAR},
</if>
<if test="deviceBindTime != null">
device_bind_time = #{deviceBindTime,jdbcType=TIMESTAMP},
</if>
<if test="deviceUnbindTime != null">
device_unbind_time = #{deviceUnbindTime,jdbcType=TIMESTAMP},
</if>
<if test="deviceIp != null">
device_ip = #{deviceIp,jdbcType=VARCHAR},
</if>
<if test="devicePort != null">
device_port = #{devicePort,jdbcType=INTEGER},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.xinelu.manage.domain.projectdevice.ProjectDevice">
update project_device
set
patient_id = #{patientId,jdbcType=BIGINT},
patient_name = #{patientName,jdbcType=VARCHAR},
card_no = #{cardNo,jdbcType=VARCHAR},
device_type = #{deviceType,jdbcType=VARCHAR},
device_name = #{deviceName,jdbcType=VARCHAR},
device_code = #{deviceCode,jdbcType=VARCHAR},
device_status = #{deviceStatus,jdbcType=VARCHAR},
device_remark = #{deviceRemark,jdbcType=VARCHAR},
device_bind_time = #{deviceBindTime,jdbcType=TIMESTAMP},
device_unbind_time = #{deviceUnbindTime,jdbcType=TIMESTAMP},
device_ip = #{deviceIp,jdbcType=VARCHAR},
device_port = #{devicePort,jdbcType=INTEGER},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>