小车充电任务
This commit is contained in:
127
ruoyi-admin/src/main/resources/mapper/device/DeviceCdzMapper.xml
Normal file
127
ruoyi-admin/src/main/resources/mapper/device/DeviceCdzMapper.xml
Normal file
@@ -0,0 +1,127 @@
|
||||
<?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.cdz.mapper.DeviceCdzMapper">
|
||||
|
||||
<resultMap type="DeviceCdz" id="DeviceCdzResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="ip" column="ip" />
|
||||
<result property="port" column="port" />
|
||||
<result property="plcDbReadAddress" column="plc_db_read_address" />
|
||||
<result property="plcDbWriteAddress" column="plc_db_write_address" />
|
||||
<result property="rwh" column="rwh" />
|
||||
<result property="status" column="status" />
|
||||
<result property="xtxh" column="xtxh" />
|
||||
<result property="szcs" column="szcs" />
|
||||
<result property="model" column="model" />
|
||||
<result property="siteId" column="site_id" />
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="spare2" column="spare2" />
|
||||
<result property="spare3" column="spare3" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeviceCdzVo">
|
||||
select id, name, ip, port, plc_db_read_address, plc_db_write_address, rwh, status, xtxh, szcs, model, site_id, spare1, spare2, spare3 from device_cdz
|
||||
</sql>
|
||||
|
||||
<select id="selectDeviceCdzList" parameterType="DeviceCdz" resultMap="DeviceCdzResult">
|
||||
<include refid="selectDeviceCdzVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="ip != null and ip != ''"> and ip = #{ip}</if>
|
||||
<if test="port != null and port != ''"> and port = #{port}</if>
|
||||
<if test="plcDbReadAddress != null and plcDbReadAddress != ''"> and plc_db_read_address = #{plcDbReadAddress}</if>
|
||||
<if test="plcDbWriteAddress != null and plcDbWriteAddress != ''"> and plc_db_write_address = #{plcDbWriteAddress}</if>
|
||||
<if test="rwh != null "> and rwh = #{rwh}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="xtxh != null "> and xtxh = #{xtxh}</if>
|
||||
<if test="szcs != null "> and szcs = #{szcs}</if>
|
||||
<if test="model != null "> and model = #{model}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
||||
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
|
||||
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDeviceCdzById" parameterType="Long" resultMap="DeviceCdzResult">
|
||||
<include refid="selectDeviceCdzVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectDeviceCdzListNoSRgvId" resultMap="DeviceCdzResult">
|
||||
<include refid="selectDeviceCdzVo"/>
|
||||
where spare1 is null
|
||||
</select>
|
||||
|
||||
<insert id="insertDeviceCdz" parameterType="DeviceCdz">
|
||||
insert into device_cdz
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="ip != null">ip,</if>
|
||||
<if test="port != null">port,</if>
|
||||
<if test="plcDbReadAddress != null">plc_db_read_address,</if>
|
||||
<if test="plcDbWriteAddress != null">plc_db_write_address,</if>
|
||||
<if test="rwh != null">rwh,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="xtxh != null">xtxh,</if>
|
||||
<if test="szcs != null">szcs,</if>
|
||||
<if test="model != null">model,</if>
|
||||
<if test="siteId != null">site_id,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
<if test="spare3 != null">spare3,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="ip != null">#{ip},</if>
|
||||
<if test="port != null">#{port},</if>
|
||||
<if test="plcDbReadAddress != null">#{plcDbReadAddress},</if>
|
||||
<if test="plcDbWriteAddress != null">#{plcDbWriteAddress},</if>
|
||||
<if test="rwh != null">#{rwh},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="xtxh != null">#{xtxh},</if>
|
||||
<if test="szcs != null">#{szcs},</if>
|
||||
<if test="model != null">#{model},</if>
|
||||
<if test="siteId != null">#{siteId},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
<if test="spare3 != null">#{spare3},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDeviceCdz" parameterType="DeviceCdz">
|
||||
update device_cdz
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="ip != null">ip = #{ip},</if>
|
||||
<if test="port != null">port = #{port},</if>
|
||||
<if test="plcDbReadAddress != null">plc_db_read_address = #{plcDbReadAddress},</if>
|
||||
<if test="plcDbWriteAddress != null">plc_db_write_address = #{plcDbWriteAddress},</if>
|
||||
<if test="rwh != null">rwh = #{rwh},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="xtxh != null">xtxh = #{xtxh},</if>
|
||||
<if test="szcs != null">szcs = #{szcs},</if>
|
||||
<if test="model != null">model = #{model},</if>
|
||||
<if test="siteId != null">site_id = #{siteId},</if>
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
<if test="spare3 != null">spare3 = #{spare3},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDeviceCdzById" parameterType="Long">
|
||||
delete from device_cdz where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDeviceCdzByIds" parameterType="String">
|
||||
delete from device_cdz where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user