AgvPortCsMapper.xml
2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?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>