122 lines
6.4 KiB
XML
122 lines
6.4 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.ruoyi.device.ssj.mapper.DeviceSsjMapper">
|
|
|
|
<resultMap type="DeviceSsj" id="DeviceSsjResult">
|
|
<result property="id" column="id" />
|
|
<result property="deviceCode " column="device_code " />
|
|
<result property="name " column="name " />
|
|
<result property="type" column="type" />
|
|
<result property="ipAddress" column="ip_address" />
|
|
<result property="plcDbReadAddress" column="plc_db_read_address" />
|
|
<result property="isActive" column="is_active" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="plcDbWriteAddress" column="plc_db_write_address" />
|
|
<result property="rkqq" column="rkqq" />
|
|
<result property="kx" column="kx" />
|
|
<result property="dw" column="dw" />
|
|
<result property="trayCode" column="tray_code" />
|
|
<result property="taskNo" column="task_no" />
|
|
<result property="exception" column="exception" />
|
|
<result property="traySize" column="tray_size" />
|
|
<result property="allowPut" column="allow_put" />
|
|
</resultMap>
|
|
|
|
<sql id="selectDeviceSsjVo">
|
|
select id, device_code , name , type, ip_address, plc_db_read_address, is_active, create_time, plc_db_write_address, rkqq, kx, dw, tray_code, task_no,exception,tray_size,allow_put from device_ssj
|
|
</sql>
|
|
|
|
<select id="selectDeviceSsjList" parameterType="DeviceSsj" resultMap="DeviceSsjResult">
|
|
<include refid="selectDeviceSsjVo"/>
|
|
<where>
|
|
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode }</if>
|
|
<if test="name != null and name != ''"> and name = #{name }</if>
|
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
|
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress}</if>
|
|
<if test="plcDbReadAddress != null and plcDbReadAddress != ''"> and plc_db_read_address = #{plcDbReadAddress}</if>
|
|
<if test="isActive != null and isActive != ''"> and is_active = #{isActive}</if>
|
|
<if test="plcDbWriteAddress != null and plcDbWriteAddress != ''"> and plc_db_write_address = #{plcDbWriteAddress}</if>
|
|
<if test="rkqq != null and rkqq != ''"> and rkqq = #{rkqq}</if>
|
|
<if test="kx != null and kx != ''"> and kx = #{kx}</if>
|
|
<if test="dw != null and dw != ''"> and dw = #{dw}</if>
|
|
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
|
<if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
|
|
<if test="exception != null and exception != ''"> and exception = #{exception}</if>
|
|
<if test="traySize != null and traySize != ''"> and tray_size = #{traySize}</if>
|
|
<if test="allowPut != null and allowPut != ''"> and allow_put = #{allowPut}</if>
|
|
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectDeviceSsjById" parameterType="Long" resultMap="DeviceSsjResult">
|
|
<include refid="selectDeviceSsjVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
<select id="selectSendData" resultMap="DeviceSsjResult">
|
|
select id, device_code , name , type, ip_address, plc_db_read_address, is_active, create_time, plc_db_write_address, rkqq, kx, dw, tray_code, task_no,exception,tray_size,allow_put from device_ssj_test
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertDeviceSsj" parameterType="DeviceSsj" useGeneratedKeys="true" keyProperty="id">
|
|
insert into device_ssj
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="deviceCode != null">device_code ,</if>
|
|
<if test="name != null">name ,</if>
|
|
<if test="type != null">type,</if>
|
|
<if test="ipAddress != null">ip_address,</if>
|
|
<if test="plcDbReadAddress != null">plc_db_read_address,</if>
|
|
<if test="isActive != null">is_active,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="plcDbWriteAddress != null">plc_db_write_address,</if>
|
|
<if test="rkqq != null">rkqq,</if>
|
|
<if test="kx != null">kx,</if>
|
|
<if test="dw != null">dw,</if>
|
|
<if test="trayCode != null">tray_code,</if>
|
|
<if test="taskNo != null">task_no,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="deviceCode != null">#{deviceCode },</if>
|
|
<if test="name != null">#{name },</if>
|
|
<if test="type != null">#{type},</if>
|
|
<if test="ipAddress != null">#{ipAddress},</if>
|
|
<if test="plcDbReadAddress != null">#{plcDbReadAddress},</if>
|
|
<if test="isActive != null">#{isActive},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="plcDbWriteAddress != null">#{plcDbWriteAddress},</if>
|
|
<if test="rkqq != null">#{rkqq},</if>
|
|
<if test="kx != null">#{kx},</if>
|
|
<if test="dw != null">#{dw},</if>
|
|
<if test="trayCode != null">#{trayCode},</if>
|
|
<if test="taskNo != null">#{taskNo},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateDeviceSsj" parameterType="DeviceSsj">
|
|
update device_ssj
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="rkqq != null">rkqq = #{rkqq},</if>
|
|
<if test="kx != null">kx = #{kx},</if>
|
|
<if test="dw != null">dw = #{dw},</if>
|
|
<if test="trayCode != null">tray_code = #{trayCode},</if>
|
|
<if test="taskNo != null">task_no = #{taskNo},</if>
|
|
<if test="exception != null">exception = #{exception},</if>
|
|
<if test="traySize != null">tray_size = #{traySize},</if>
|
|
<if test="allowPut != null">allow_put = #{allowPut},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteDeviceSsjById" parameterType="Long">
|
|
delete from device_ssj where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteDeviceSsjByIds" parameterType="String">
|
|
delete from device_ssj where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|