AgvPortCsMapper.xml 2.38 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.api.acs.mapper.AgvPortCsMapper">

    <resultMap type="com.huaheng.api.acs.domain.AgvPort" id="agvPortResult">
        <result property="id"    column="id"    />
        <result property="code"    column="code"    />
        <result property="name"    column="name"    />
        <result property="workStationId"    column="workStationId"    />
        <result property="area"    column="area"    />
        <result property="containerCode"    column="containerCode"    />
        <result property="type"    column="type"    />
        <result property="status"    column="status"    />
        <result property="created"    column="created"    />
        <result property="createdBy"    column="createdBy"    />
        <result property="lastUpdated"    column="lastUpdated"    />
        <result property="lastUpdatedBy"    column="lastUpdatedBy"    />
    </resultMap>
    <sql id="selectagvPortVo">
        select id, code, name,workStationId, area,containerCode, type, status, created, createdBy, lastUpdated, lastUpdatedBy from agv_port
    </sql>
    <update id="updateStatus">
        UPDATE agv_port set `status`=#{status} WHERE  `code`=#{code}
    </update>

    <update id="setContainerCode">
        UPDATE agv_port set `containerCode`=#{containerCode} WHERE `code`=#{code}
    </update>
    <update id="clearContainerCodeByCode">
        UPDATE agv_port set `containerCode`=null WHERE `code`=#{code}
    </update>
    <select id="getSize2Code" resultType="java.lang.String">
        SELECT code FROM `agv_port` where workStationId=#{workStationId} GROUP BY `code` HAVING COUNT(code)>1
    </select>


    <insert id="addList" parameterType="com.huaheng.api.acs.domain.AgvPort" keyProperty="id" useGeneratedKeys="true" >
        INSERT INTO agv_port(
        code,
        name,
        workStationId,
        area,
        status,
        created,
        type
        )values
        <foreach collection="containers" item="item" index="index" separator=",">
            (
            #{item.code},
            #{item.name},
            #{item.workStationId},
            #{item.area},
            #{item.status},
            #{item.created},
            #{item.type}
            )
        </foreach>
    </insert>

</mapper>