142 lines
5.7 KiB
XML
142 lines
5.7 KiB
XML
|
|
<?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.xhpc.workorder.mapper.XhpcStationDeviceMapper">
|
||
|
|
<resultMap id="BaseResultMap" type="com.xhpc.workorder.domain.XhpcStationDeviceDomain">
|
||
|
|
<id column="device_id" jdbcType="INTEGER" property="deviceId" />
|
||
|
|
<result column="device_name" jdbcType="VARCHAR" property="deviceName" />
|
||
|
|
<result column="device_type" jdbcType="VARCHAR" property="deviceType" />
|
||
|
|
<result column="station_id" jdbcType="BIGINT" property="stationId" />
|
||
|
|
<result column="parent_device_id" jdbcType="BIGINT" property="parentDeviceId" />
|
||
|
|
<result column="serial_number" jdbcType="VARCHAR" property="serialNumber" />
|
||
|
|
<result column="status" jdbcType="SMALLINT" property="status" />
|
||
|
|
<result column="del_flag" jdbcType="SMALLINT" property="delFlag" />
|
||
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||
|
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||
|
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||
|
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||
|
|
</resultMap>
|
||
|
|
<sql id="Base_Column_List">
|
||
|
|
device_id, device_name, device_type, station_id, parent_device_id, serial_number,
|
||
|
|
`status`, del_flag, create_time, create_by, update_time, update_by
|
||
|
|
</sql>
|
||
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||
|
|
select
|
||
|
|
<include refid="Base_Column_List" />
|
||
|
|
from xhpc_station_device
|
||
|
|
where device_id = #{deviceId,jdbcType=INTEGER}
|
||
|
|
</select>
|
||
|
|
<update id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||
|
|
update xhpc_station_device set del_flag = 2
|
||
|
|
where device_id = #{deviceId,jdbcType=INTEGER}
|
||
|
|
</update>
|
||
|
|
<insert id="insert" keyColumn="device_id" keyProperty="deviceId" parameterType="com.xhpc.workorder.domain.XhpcStationDeviceDomain" useGeneratedKeys="true">
|
||
|
|
insert into xhpc_station_device (device_name, device_type, station_id,
|
||
|
|
parent_device_id, serial_number, `status`,
|
||
|
|
del_flag, create_time, create_by,
|
||
|
|
update_time, update_by)
|
||
|
|
values (#{deviceName,jdbcType=VARCHAR}, #{deviceType,jdbcType=VARCHAR}, #{stationId,jdbcType=BIGINT},
|
||
|
|
#{parentDeviceId,jdbcType=BIGINT}, #{serialNumber,jdbcType=VARCHAR}, #{status,jdbcType=SMALLINT},
|
||
|
|
0, SYSDATE(), #{createBy,jdbcType=VARCHAR}, SYSDATE(), #{updateBy,jdbcType=VARCHAR})
|
||
|
|
</insert>
|
||
|
|
<insert id="insertSelective" keyColumn="device_id" keyProperty="deviceId" parameterType="com.xhpc.workorder.domain.XhpcStationDeviceDomain" useGeneratedKeys="true">
|
||
|
|
insert into xhpc_station_device
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="deviceName != null">
|
||
|
|
device_name,
|
||
|
|
</if>
|
||
|
|
<if test="deviceType != null">
|
||
|
|
device_type,
|
||
|
|
</if>
|
||
|
|
<if test="stationId != null">
|
||
|
|
station_id,
|
||
|
|
</if>
|
||
|
|
<if test="parentDeviceId != null">
|
||
|
|
parent_device_id,
|
||
|
|
</if>
|
||
|
|
<if test="serialNumber != null">
|
||
|
|
serial_number,
|
||
|
|
</if>
|
||
|
|
<if test="status != null">
|
||
|
|
`status`,
|
||
|
|
</if>
|
||
|
|
del_flag,
|
||
|
|
create_time,
|
||
|
|
<if test="createBy != null">
|
||
|
|
create_by,
|
||
|
|
</if>
|
||
|
|
update_time,
|
||
|
|
<if test="updateBy != null">
|
||
|
|
update_by,
|
||
|
|
</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="deviceName != null">
|
||
|
|
#{deviceName,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="deviceType != null">
|
||
|
|
#{deviceType,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="stationId != null">
|
||
|
|
#{stationId,jdbcType=BIGINT},
|
||
|
|
</if>
|
||
|
|
<if test="parentDeviceId != null">
|
||
|
|
#{parentDeviceId,jdbcType=BIGINT},
|
||
|
|
</if>
|
||
|
|
<if test="serialNumber != null">
|
||
|
|
#{serialNumber,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="status != null">
|
||
|
|
#{status,jdbcType=SMALLINT},
|
||
|
|
</if>
|
||
|
|
0,
|
||
|
|
sysdate(),
|
||
|
|
<if test="createBy != null">
|
||
|
|
#{createBy,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
sysdate(),
|
||
|
|
<if test="updateBy != null">
|
||
|
|
#{updateBy,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.xhpc.workorder.domain.XhpcStationDeviceDomain">
|
||
|
|
update xhpc_station_device
|
||
|
|
<set>
|
||
|
|
<if test="deviceName != null">
|
||
|
|
device_name = #{deviceName,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="deviceType != null">
|
||
|
|
device_type = #{deviceType,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="stationId != null">
|
||
|
|
station_id = #{stationId,jdbcType=BIGINT},
|
||
|
|
</if>
|
||
|
|
<if test="parentDeviceId != null">
|
||
|
|
parent_device_id = #{parentDeviceId,jdbcType=BIGINT},
|
||
|
|
</if>
|
||
|
|
<if test="serialNumber != null">
|
||
|
|
serial_number = #{serialNumber,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="status != null">
|
||
|
|
`status` = #{status,jdbcType=SMALLINT},
|
||
|
|
</if>
|
||
|
|
update_time = sysdate(),
|
||
|
|
<if test="updateBy != null">
|
||
|
|
update_by = #{updateBy,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
</set>
|
||
|
|
where device_id = #{deviceId,jdbcType=INTEGER}
|
||
|
|
</update>
|
||
|
|
<update id="updateByPrimaryKey" parameterType="com.xhpc.workorder.domain.XhpcStationDeviceDomain">
|
||
|
|
update xhpc_station_device
|
||
|
|
set device_name = #{deviceName,jdbcType=VARCHAR},
|
||
|
|
device_type = #{deviceType,jdbcType=VARCHAR},
|
||
|
|
station_id = #{stationId,jdbcType=BIGINT},
|
||
|
|
parent_device_id = #{parentDeviceId,jdbcType=BIGINT},
|
||
|
|
serial_number = #{serialNumber,jdbcType=VARCHAR},
|
||
|
|
`status` = #{status,jdbcType=SMALLINT},
|
||
|
|
update_time = sysdate(),
|
||
|
|
update_by = #{updateBy,jdbcType=VARCHAR}
|
||
|
|
where device_id = #{deviceId,jdbcType=INTEGER}
|
||
|
|
</update>
|
||
|
|
</mapper>
|