ContainerMapper.xml
2.2 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
<?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.general.container.mapper.ContainerMapper">
<update id="updateStatus">
UPDATE container set `status`=#{status} WHERE warehouseCode=#{warehouseCode} AND `code`=#{code}
</update>
<update id="updateLocationCodeAndStatus">
UPDATE container set `status`=#{status}, locationCode=#{locationCode} WHERE warehouseCode=#{warehouseCode} AND `code`=#{code}
</update>
<select id="getMaxCode" resultType="java.lang.String">
SELECT code FROM container WHERE type = #{type} ORDER BY id DESC LIMIT 1
</select>
<select id="selectContainerCapacity" resultType="com.huaheng.pc.config.containercapacity.domain.ContainerCapacity">
select * from container_capacity where code=#{code} and materialCode=#{materialCode} and warehouseCode=#{warehouseCode}
</select>
<select id="selectFirstContainer" resultType="com.huaheng.pc.general.container.domain.Container">
select * from container where code<>#{containerCode} and code like CONCAT(#{code},'%') and type='A' and status='empty' limit 1
</select>
<select id="selectContainer" resultType="com.huaheng.pc.general.container.domain.Container">
select * from container where code<>#{code} and type=#{type} and status=#{status} limit 1
</select>
<!--<select id="selectContainerList" resultType="com.huaheng.pc.general.container.domain.Container">-->
<!--select * from container where warehouseCode=#{warehouseCode} and type=#{type} and code like CONCAT(#{code},'%')-->
<!--</select>-->
<update id="updateLocationCode">
UPDATE container c inner join location_position l on substr(c.code,5,1)=substr(l.locationCode,9,1) and substr(c.code,6,1)=substr(l.locationCode,12,1) and c.warehouseCode=l.warehouseCode
set c.locationCode=l.locationCode where c.warehouseCode=#{container.warehouseCode} and c.type=#{container.type} and c.code like CONCAT(#{container.code},'%') and l.warehouseCode=#{locationPosition.warehouseCode} and l.intX=#{locationPosition.intX} and l.intY=#{locationPosition.intY}
</update>
</mapper>