|
|
@@ -0,0 +1,129 @@
|
|
|
+<?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.jjt.dyeing.mapper.DyeingDeviceMapper">
|
|
|
+
|
|
|
+ <resultMap type="DyeingDevice" id="DyeingDeviceResult">
|
|
|
+ <result property="deviceId" column="DEVICE_ID" />
|
|
|
+ <result property="wsName" column="WS_NAME" />
|
|
|
+ <result property="line" column="LINE" />
|
|
|
+ <result property="typeId" column="TYPE_ID" />
|
|
|
+ <result property="typeName" column="TYPE_NAME" />
|
|
|
+ <result property="deviceCode" column="DEVICE_CODE" />
|
|
|
+ <result property="deviceName" column="DEVICE_NAME" />
|
|
|
+ <result property="devicePath" column="DEVICE_PATH" />
|
|
|
+ <result property="lengthExp" column="LENGTH_EXP" />
|
|
|
+ <result property="statusExp" column="STATUS_EXP" />
|
|
|
+ <result property="speedExp" column="SPEED_EXP" />
|
|
|
+ <result property="tmpExp" column="TMP_EXP" />
|
|
|
+ <result property="energyExp" column="ENERGY_EXP" />
|
|
|
+ <result property="ampExp" column="AMP_EXP" />
|
|
|
+ <result property="createdBy" column="CREATED_BY" />
|
|
|
+ <result property="createdTime" column="CREATED_TIME" />
|
|
|
+ <result property="updatedBy" column="UPDATED_BY" />
|
|
|
+ <result property="updatedTime" column="UPDATED_TIME" />
|
|
|
+ <result property="remark" column="REMARK" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectDyeingDeviceVo">
|
|
|
+ select DEVICE_ID, WS_NAME, LINE, TYPE_ID, TYPE_NAME, DEVICE_CODE, DEVICE_NAME, DEVICE_PATH, LENGTH_EXP, STATUS_EXP, SPEED_EXP, TMP_EXP, ENERGY_EXP, AMP_EXP, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK from DYEING_DEVICE
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectDyeingDeviceList" parameterType="DyeingDevice" resultMap="DyeingDeviceResult">
|
|
|
+ <include refid="selectDyeingDeviceVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="wsName != null and wsName != ''"> and WS_NAME like concat('%', #{wsName}, '%')</if>
|
|
|
+ <if test="line != null and line != ''"> and LINE = #{line}</if>
|
|
|
+ <if test="typeId != null "> and TYPE_ID = #{typeId}</if>
|
|
|
+ <if test="typeName != null and typeName != ''"> and TYPE_NAME like concat('%', #{typeName}, '%')</if>
|
|
|
+ <if test="deviceCode != null and deviceCode != ''"> and DEVICE_CODE = #{deviceCode}</if>
|
|
|
+ <if test="deviceName != null and deviceName != ''"> and DEVICE_NAME like concat('%', #{deviceName}, '%')</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDyeingDeviceByDeviceId" parameterType="Long" resultMap="DyeingDeviceResult">
|
|
|
+ <include refid="selectDyeingDeviceVo"/>
|
|
|
+ where DEVICE_ID = #{deviceId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertDyeingDevice" parameterType="DyeingDevice" useGeneratedKeys="true" keyProperty="deviceId">
|
|
|
+ insert into DYEING_DEVICE
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="wsName != null">WS_NAME,</if>
|
|
|
+ <if test="line != null">LINE,</if>
|
|
|
+ <if test="typeId != null">TYPE_ID,</if>
|
|
|
+ <if test="typeName != null">TYPE_NAME,</if>
|
|
|
+ <if test="deviceCode != null">DEVICE_CODE,</if>
|
|
|
+ <if test="deviceName != null">DEVICE_NAME,</if>
|
|
|
+ <if test="devicePath != null">DEVICE_PATH,</if>
|
|
|
+ <if test="lengthExp != null">LENGTH_EXP,</if>
|
|
|
+ <if test="statusExp != null">STATUS_EXP,</if>
|
|
|
+ <if test="speedExp != null">SPEED_EXP,</if>
|
|
|
+ <if test="tmpExp != null">TMP_EXP,</if>
|
|
|
+ <if test="energyExp != null">ENERGY_EXP,</if>
|
|
|
+ <if test="ampExp != null">AMP_EXP,</if>
|
|
|
+ <if test="createdBy != null">CREATED_BY,</if>
|
|
|
+ <if test="createdTime != null">CREATED_TIME,</if>
|
|
|
+ <if test="updatedBy != null">UPDATED_BY,</if>
|
|
|
+ <if test="updatedTime != null">UPDATED_TIME,</if>
|
|
|
+ <if test="remark != null">REMARK,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="wsName != null">#{wsName},</if>
|
|
|
+ <if test="line != null">#{line},</if>
|
|
|
+ <if test="typeId != null">#{typeId},</if>
|
|
|
+ <if test="typeName != null">#{typeName},</if>
|
|
|
+ <if test="deviceCode != null">#{deviceCode},</if>
|
|
|
+ <if test="deviceName != null">#{deviceName},</if>
|
|
|
+ <if test="devicePath != null">#{devicePath},</if>
|
|
|
+ <if test="lengthExp != null">#{lengthExp},</if>
|
|
|
+ <if test="statusExp != null">#{statusExp},</if>
|
|
|
+ <if test="speedExp != null">#{speedExp},</if>
|
|
|
+ <if test="tmpExp != null">#{tmpExp},</if>
|
|
|
+ <if test="energyExp != null">#{energyExp},</if>
|
|
|
+ <if test="ampExp != null">#{ampExp},</if>
|
|
|
+ <if test="createdBy != null">#{createdBy},</if>
|
|
|
+ <if test="createdTime != null">#{createdTime},</if>
|
|
|
+ <if test="updatedBy != null">#{updatedBy},</if>
|
|
|
+ <if test="updatedTime != null">#{updatedTime},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateDyeingDevice" parameterType="DyeingDevice">
|
|
|
+ update DYEING_DEVICE
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="wsName != null">WS_NAME = #{wsName},</if>
|
|
|
+ <if test="line != null">LINE = #{line},</if>
|
|
|
+ <if test="typeId != null">TYPE_ID = #{typeId},</if>
|
|
|
+ <if test="typeName != null">TYPE_NAME = #{typeName},</if>
|
|
|
+ <if test="deviceCode != null">DEVICE_CODE = #{deviceCode},</if>
|
|
|
+ <if test="deviceName != null">DEVICE_NAME = #{deviceName},</if>
|
|
|
+ <if test="devicePath != null">DEVICE_PATH = #{devicePath},</if>
|
|
|
+ <if test="lengthExp != null">LENGTH_EXP = #{lengthExp},</if>
|
|
|
+ <if test="statusExp != null">STATUS_EXP = #{statusExp},</if>
|
|
|
+ <if test="speedExp != null">SPEED_EXP = #{speedExp},</if>
|
|
|
+ <if test="tmpExp != null">TMP_EXP = #{tmpExp},</if>
|
|
|
+ <if test="energyExp != null">ENERGY_EXP = #{energyExp},</if>
|
|
|
+ <if test="ampExp != null">AMP_EXP = #{ampExp},</if>
|
|
|
+ <if test="createdBy != null">CREATED_BY = #{createdBy},</if>
|
|
|
+ <if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
|
|
|
+ <if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>
|
|
|
+ <if test="updatedTime != null">UPDATED_TIME = #{updatedTime},</if>
|
|
|
+ <if test="remark != null">REMARK = #{remark},</if>
|
|
|
+ </trim>
|
|
|
+ where DEVICE_ID = #{deviceId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteDyeingDeviceByDeviceId" parameterType="Long">
|
|
|
+ delete from DYEING_DEVICE where DEVICE_ID = #{deviceId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteDyeingDeviceByDeviceIds" parameterType="String">
|
|
|
+ delete from DYEING_DEVICE where DEVICE_ID in
|
|
|
+ <foreach item="deviceId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{deviceId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|