<?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.business.mapper.TConveyorStatusMapper">
    
    <resultMap type="TConveyorStatus" id="TConveyorStatusResult">
        <result property="converyorId"    column="CONVERYOR_ID"    />
        <result property="opttype"    column="OPTTYPE"    />
        <result property="storageId"    column="STORAGE_ID"    />
        <result property="decId"    column="DEC_ID"    />
        <result property="autoMode"    column="AUTO_MODE"    />
        <result property="manualMode"    column="MANUAL_MODE"    />
        <result property="alarmmode"    column="AlarmMode"    />
        <result property="loadmode"    column="LoadMode"    />
        <result property="oversize"    column="OverSize"    />
        <result property="outenable"    column="OutEnable"    />
        <result property="inenable"    column="InEnable"    />
        <result property="remark"    column="Remark"    />
        <result property="plcid"    column="PlcID"    />
        <result property="mode"    column="Mode"    />
        <result property="ledip"    column="Ledip"    />
        <result property="ledtype"    column="ledtype"    />
        <result property="pcip"    column="pcIp"    />
        <result property="desciption"    column="desciption"    />
        <result property="writemode"    column="writeMode"    />
        <result property="hgh"    column="hgh"    />
        <result property="row"    column="row1"    />
        <result property="cln"    column="cln"    />
        <result property="layer"    column="layer"    />
        <result property="plcitem"    column="plcitem"    />
        <result property="error"    column="error"    />
        <result property="linkid"    column="LinkId"    />
        <result property="pickingid"    column="pickingid"    />
        <result property="pickingct"    column="pickingct"    />
        <result property="wgh"    column="wgh"    />
        <result property="cloc"    column="cloc"    />
        <result property="movests"    column="MoveSts"    />
        <result property="sts"    column="sts"    />
        <result property="startcyid"    column="startCyId"    />
        <result property="locid"    column="locid"    />
        <result property="rkwgh"    column="rkwgh"    />
        <result property="endrk"    column="endrk"    />
        <result property="barcode"    column="barcode"    />
    </resultMap>

    <sql id="selectTConveyorStatusVo">
        select CONVERYOR_ID, OPTTYPE, STORAGE_ID, DEC_ID, AUTO_MODE, MANUAL_MODE, AlarmMode, LoadMode, OverSize, OutEnable, InEnable, Remark, PlcID, Mode, Ledip, ledtype, pcIp, desciption, writeMode, hgh, row1, cln, layer, plcitem, error, LinkId, pickingid, pickingct, wgh, cloc, MoveSts, sts, startCyId, locid, rkwgh, endrk, barcode from t_conveyor_status
    </sql>

    <select id="selectTConveyorStatusList" parameterType="TConveyorStatus" resultMap="TConveyorStatusResult">
        <include refid="selectTConveyorStatusVo"/>
        <where>  
            <if test="opttype != null  and opttype != ''"> and OPTTYPE = #{opttype}</if>
            <if test="storageId != null  and storageId != ''"> and STORAGE_ID = #{storageId}</if>
            <if test="decId != null  and decId != ''"> and DEC_ID = #{decId}</if>
            <if test="autoMode != null  and autoMode != ''"> and AUTO_MODE = #{autoMode}</if>
            <if test="manualMode != null  and manualMode != ''"> and MANUAL_MODE = #{manualMode}</if>
            <if test="alarmmode != null  and alarmmode != ''"> and AlarmMode = #{alarmmode}</if>
            <if test="loadmode != null  and loadmode != ''"> and LoadMode = #{loadmode}</if>
            <if test="oversize != null  and oversize != ''"> and OverSize = #{oversize}</if>
            <if test="outenable != null  and outenable != ''"> and OutEnable = #{outenable}</if>
            <if test="inenable != null  and inenable != ''"> and InEnable = #{inenable}</if>
            <if test="remark != null  and remark != ''"> and Remark = #{remark}</if>
            <if test="plcid != null "> and PlcID = #{plcid}</if>
            <if test="mode != null  and mode != ''"> and Mode = #{mode}</if>
            <if test="ledip != null  and ledip != ''"> and Ledip = #{ledip}</if>
            <if test="ledtype != null  and ledtype != ''"> and ledtype = #{ledtype}</if>
            <if test="pcip != null  and pcip != ''"> and pcIp = #{pcip}</if>
            <if test="desciption != null  and desciption != ''"> and desciption = #{desciption}</if>
            <if test="writemode != null  and writemode != ''"> and writeMode = #{writemode}</if>
            <if test="hgh != null  and hgh != ''"> and hgh = #{hgh}</if>
            <if test="row != null  and row != ''"> and row1 = #{row}</if>
            <if test="cln != null  and cln != ''"> and cln = #{cln}</if>
            <if test="layer != null  and layer != ''"> and layer = #{layer}</if>
            <if test="plcitem != null  and plcitem != ''"> and plcitem = #{plcitem}</if>
            <if test="error != null  and error != ''"> and error = #{error}</if>
            <if test="linkid != null  and linkid != ''"> and LinkId = #{linkid}</if>
            <if test="pickingid != null  and pickingid != ''"> and pickingid = #{pickingid}</if>
            <if test="pickingct != null  and pickingct != ''"> and pickingct = #{pickingct}</if>
            <if test="wgh != null  and wgh != ''"> and wgh = #{wgh}</if>
            <if test="cloc != null  and cloc != ''"> and cloc = #{cloc}</if>
            <if test="movests != null  and movests != ''"> and MoveSts = #{movests}</if>
            <if test="sts != null  and sts != ''"> and sts = #{sts}</if>
            <if test="startcyid != null  and startcyid != ''"> and startCyId = #{startcyid}</if>
            <if test="locid != null  and locid != ''"> and locid = #{locid}</if>
            <if test="rkwgh != null  and rkwgh != ''"> and rkwgh = #{rkwgh}</if>
            <if test="endrk != null  and endrk != ''"> and endrk = #{endrk}</if>
            <if test="barcode != null  and barcode != ''"> and barcode = #{barcode}</if>
        </where>
    </select>
    
    <select id="selectTConveyorStatusByConveryorId" parameterType="String" resultMap="TConveyorStatusResult">
        <include refid="selectTConveyorStatusVo"/>
        where CONVERYOR_ID = #{converyorId}
    </select>
        
    <insert id="insertTConveyorStatus" parameterType="TConveyorStatus">
        insert into t_conveyor_status
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="converyorId != null">CONVERYOR_ID,</if>
            <if test="opttype != null">OPTTYPE,</if>
            <if test="storageId != null">STORAGE_ID,</if>
            <if test="decId != null">DEC_ID,</if>
            <if test="autoMode != null">AUTO_MODE,</if>
            <if test="manualMode != null">MANUAL_MODE,</if>
            <if test="alarmmode != null">AlarmMode,</if>
            <if test="loadmode != null">LoadMode,</if>
            <if test="oversize != null">OverSize,</if>
            <if test="outenable != null">OutEnable,</if>
            <if test="inenable != null">InEnable,</if>
            <if test="remark != null">Remark,</if>
            <if test="plcid != null">PlcID,</if>
            <if test="mode != null">Mode,</if>
            <if test="ledip != null">Ledip,</if>
            <if test="ledtype != null and ledtype != ''">ledtype,</if>
            <if test="pcip != null and pcip != ''">pcIp,</if>
            <if test="desciption != null">desciption,</if>
            <if test="writemode != null">writeMode,</if>
            <if test="hgh != null">hgh,</if>
            <if test="row != null">row1,</if>
            <if test="cln != null">cln,</if>
            <if test="layer != null">layer,</if>
            <if test="plcitem != null">plcitem,</if>
            <if test="error != null">error,</if>
            <if test="linkid != null">LinkId,</if>
            <if test="pickingid != null">pickingid,</if>
            <if test="pickingct != null">pickingct,</if>
            <if test="wgh != null">wgh,</if>
            <if test="cloc != null">cloc,</if>
            <if test="movests != null">MoveSts,</if>
            <if test="sts != null">sts,</if>
            <if test="startcyid != null">startCyId,</if>
            <if test="locid != null">locid,</if>
            <if test="rkwgh != null">rkwgh,</if>
            <if test="endrk != null">endrk,</if>
            <if test="barcode != null">barcode,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="converyorId != null">#{converyorId},</if>
            <if test="opttype != null">#{opttype},</if>
            <if test="storageId != null">#{storageId},</if>
            <if test="decId != null">#{decId},</if>
            <if test="autoMode != null">#{autoMode},</if>
            <if test="manualMode != null">#{manualMode},</if>
            <if test="alarmmode != null">#{alarmmode},</if>
            <if test="loadmode != null">#{loadmode},</if>
            <if test="oversize != null">#{oversize},</if>
            <if test="outenable != null">#{outenable},</if>
            <if test="inenable != null">#{inenable},</if>
            <if test="remark != null">#{remark},</if>
            <if test="plcid != null">#{plcid},</if>
            <if test="mode != null">#{mode},</if>
            <if test="ledip != null">#{ledip},</if>
            <if test="ledtype != null and ledtype != ''">#{ledtype},</if>
            <if test="pcip != null and pcip != ''">#{pcip},</if>
            <if test="desciption != null">#{desciption},</if>
            <if test="writemode != null">#{writemode},</if>
            <if test="hgh != null">#{hgh},</if>
            <if test="row != null">#{row},</if>
            <if test="cln != null">#{cln},</if>
            <if test="layer != null">#{layer},</if>
            <if test="plcitem != null">#{plcitem},</if>
            <if test="error != null">#{error},</if>
            <if test="linkid != null">#{linkid},</if>
            <if test="pickingid != null">#{pickingid},</if>
            <if test="pickingct != null">#{pickingct},</if>
            <if test="wgh != null">#{wgh},</if>
            <if test="cloc != null">#{cloc},</if>
            <if test="movests != null">#{movests},</if>
            <if test="sts != null">#{sts},</if>
            <if test="startcyid != null">#{startcyid},</if>
            <if test="locid != null">#{locid},</if>
            <if test="rkwgh != null">#{rkwgh},</if>
            <if test="endrk != null">#{endrk},</if>
            <if test="barcode != null">#{barcode},</if>
         </trim>
    </insert>

    <update id="updateTConveyorStatus" parameterType="TConveyorStatus">
        update t_conveyor_status
        <trim prefix="SET" suffixOverrides=",">
            <if test="opttype != null">OPTTYPE = #{opttype},</if>
            <if test="storageId != null">STORAGE_ID = #{storageId},</if>
            <if test="decId != null">DEC_ID = #{decId},</if>
            <if test="autoMode != null">AUTO_MODE = #{autoMode},</if>
            <if test="manualMode != null">MANUAL_MODE = #{manualMode},</if>
            <if test="alarmmode != null">AlarmMode = #{alarmmode},</if>
            <if test="loadmode != null">LoadMode = #{loadmode},</if>
            <if test="oversize != null">OverSize = #{oversize},</if>
            <if test="outenable != null">OutEnable = #{outenable},</if>
            <if test="inenable != null">InEnable = #{inenable},</if>
            <if test="remark != null">Remark = #{remark},</if>
            <if test="plcid != null">PlcID = #{plcid},</if>
            <if test="mode != null">Mode = #{mode},</if>
            <if test="ledip != null">Ledip = #{ledip},</if>
            <if test="ledtype != null and ledtype != ''">ledtype = #{ledtype},</if>
            <if test="pcip != null and pcip != ''">pcIp = #{pcip},</if>
            <if test="desciption != null">desciption = #{desciption},</if>
            <if test="writemode != null">writeMode = #{writemode},</if>
            <if test="hgh != null">hgh = #{hgh},</if>
            <if test="row != null">row1 = #{row},</if>
            <if test="cln != null">cln = #{cln},</if>
            <if test="layer != null">layer = #{layer},</if>
            <if test="plcitem != null">plcitem = #{plcitem},</if>
            <if test="error != null">error = #{error},</if>
            <if test="linkid != null">LinkId = #{linkid},</if>
            <if test="pickingid != null">pickingid = #{pickingid},</if>
            <if test="pickingct != null">pickingct = #{pickingct},</if>
            <if test="wgh != null">wgh = #{wgh},</if>
            <if test="cloc != null">cloc = #{cloc},</if>
            <if test="movests != null">MoveSts = #{movests},</if>
            <if test="sts != null">sts = #{sts},</if>
            <if test="startcyid != null">startCyId = #{startcyid},</if>
            <if test="locid != null">locid = #{locid},</if>
            <if test="rkwgh != null">rkwgh = #{rkwgh},</if>
            <if test="endrk != null">endrk = #{endrk},</if>
            <if test="barcode != null">barcode = #{barcode},</if>
        </trim>
        where CONVERYOR_ID = #{converyorId}
    </update>

    <delete id="deleteTConveyorStatusByConveryorId" parameterType="String">
        delete from t_conveyor_status where CONVERYOR_ID = #{converyorId}
    </delete>

    <delete id="deleteTConveyorStatusByConveryorIds" parameterType="String">
        delete from t_conveyor_status where CONVERYOR_ID in 
        <foreach item="converyorId" collection="array" open="(" separator="," close=")">
            #{converyorId}
        </foreach>
    </delete>

</mapper>