AgvTaskMapper.xml 5.91 KB
<?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.huaheng.pc.task.agvTask.mapper.AgvTaskMapper">
    <insert id="insertModel" parameterType="com.huaheng.pc.task.agvTask.domain.AgvTask">
        insert into agvtask
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="interactionId != null">
                interactionId,
            </if>
            <if test="taskHeaderId != null">
                taskHeaderId,
            </if>
            <if test="taskDetailId != null">
                taskDetailId,
            </if>
            <if test="warehouseId != null">
                warehouseId,
            </if>
            <if test="warehouseCode != null">
                warehouseCode,
            </if>
            <if test="companyId != null">
                companyId,
            </if>
            <if test="companyCode != null">
                companyCode,
            </if>
            <if test="taskType != null">
                taskType,
            </if>
            <if test="shelfNo != null">
                shelfNo,
            </if>
            <if test="station != null">
                station,
            </if>
            <if test="fromLocationNo != null">
                fromLocationNo,
            </if>
            <if test="toLocationNo != null">
                toLocationNo,
            </if>
            <if test="orientation != null">
                orientation,
            </if>
            <if test="platform != null">
                platform,
            </if>
            <if test="carNo != null">
                carNo,
            </if>
            <if test="state != null">
                state,
            </if>
        </trim>
        <trim prefix=" values (" suffix=")" suffixOverrides=",">
            <if test="interactionId != null">
                #{interactionId, jdbcType=VARCHAR},
            </if>
            <if test="taskHeaderId != null">
                #{taskHeaderId, jdbcType=INTEGER},
            </if>
            <if test="taskDetailId != null">
                #{taskDetailId, jdbcType=INTEGER},
            </if>
            <if test="warehouseId != null">
                #{warehouseId, jdbcType=INTEGER},
            </if>
            <if test="warehouseCode != null">
                #{warehouseCode, jdbcType=VARCHAR},
            </if>
            <if test="companyId != null">
                #{companyId, jdbcType=INTEGER},
            </if>
            <if test="companyCode != null">
                #{companyCode, jdbcType=VARCHAR},
            </if>
            <if test="taskType != null">
                #{taskType, jdbcType=VARCHAR},
            </if>
            <if test="shelfNo != null">
                #{shelfNo, jdbcType=VARCHAR},
            </if>
            <if test="station != null">
                #{station, jdbcType=VARCHAR},
            </if>
            <if test="fromLocationNo != null">
                #{fromLocationNo, jdbcType=VARCHAR},
            </if>
            <if test="toLocationNo != null">
                #{toLocationNo, jdbcType=VARCHAR},
            </if>
            <if test="orientation != null">
                #{orientation, jdbcType=VARCHAR},
            </if>
            <if test="platform != null">
                #{platform, jdbcType=VARCHAR},
            </if>
            <if test="carNo != null">
                #{carNo, jdbcType=VARCHAR},
            </if>
            <if test="state != null">
                #{state, jdbcType=VARCHAR},
            </if>
        </trim>
    </insert>


    <select id="selectModel" resultType="com.huaheng.pc.task.agvTask.domain.AgvTask">
    select id, interactionId, taskHeaderId,warehouseId,warehouseCode,companyId,companyCode taskDetailId, taskType, shelfNo, station, fromLocationNo, toLocationNo, orientation,platform,carNo, state
    from agvtask
    where taskHeaderId=#{taskHeaderId} and taskDetailId=#{taskDetailId} and taskType=#{taskType}
    </select>


    <update id="updateModel" parameterType="com.huaheng.pc.task.agvTask.domain.AgvTask">
    update agvtask
    <set>
        <if test="interactionId != null">
            interactionId = #{interactionId, jdbcType=VARCHAR},
        </if>
        <if test="taskHeaderId != null">
            taskHeaderId = #{taskHeaderId, jdbcType=INTEGER},
        </if>
        <if test="taskDetailId != null">
            taskDetailId = #{taskDetailId, jdbcType=INTEGER},
        </if>
        <if test="warehouseId != null">
            warehouseId= #{warehouseId, jdbcType=INTEGER},
        </if>
        <if test="warehouseCode != null">
            warehouseCode=#{warehouseCode, jdbcType=VARCHAR},
        </if>
        <if test="companyId != null">
            companyId=#{companyId, jdbcType=INTEGER},
        </if>
        <if test="companyCode != null">
            companyCode=#{companyCode, jdbcType=VARCHAR},
        </if>
        <if test="taskType != null">
            taskType = #{taskType, jdbcType=VARCHAR},
        </if>
        <if test="shelfNo != null">
            shelfNo = #{shelfNo, jdbcType=VARCHAR},
        </if>
        <if test="station != null">
            station = #{station, jdbcType=VARCHAR},
        </if>
        <if test="fromLocationNo != null">
            fromLocationNo = #{fromLocationNo, jdbcType=VARCHAR},
        </if>
        <if test="toLocationNo != null">
            toLocationNo = #{toLocationNo, jdbcType=VARCHAR},
        </if>
        <if test="orientation != null">
            orientation = #{orientation, jdbcType=VARCHAR},
        </if>
        <if test="platform != null">
            platform = #{platform, jdbcType=VARCHAR},
        </if>
        <if test="carNo != null">
            carNo = #{carNo, jdbcType=VARCHAR},
        </if>
        <if test="state != null">
            state = #{state, jdbcType=VARCHAR},
        </if>
    </set>
        WHERE id = #{id,jdbcType=INTEGER}
    </update>
</mapper>