PointsMapper.xml
2.5 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
63
64
65
66
67
68
69
70
71
72
73
<?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.config.points.mapper.PointsMapper">
<select id="selectEntity" resultType="com.huaheng.pc.config.points.domain.Points">
SELECT * FROM points where warehouseCode=#{warehouseCode} and goodsShelfNo like CONCAT('%',#{goodsShelfNo},'%')
<if test="isLocked != null and isLocked != '' ">
AND isLocked = #{isLocked}
</if>
</select>
<select id="selectFirstEntity" resultType="com.huaheng.pc.config.points.domain.Points">
SELECT * FROM points
<where>
<if test="warehouseCode != null ">
AND warehouseCode = #{warehouseCode}
</if>
<if test="goodsShelfNo != null ">
AND goodsShelfNo = #{goodsShelfNo}
</if>
<if test="isLocked != null ">
AND isLocked = #{isLocked}
</if>
<if test="intX != null and intX != '' ">
AND intX = #{intX}
</if>
<if test="intY != null and intY!='' ">
AND intY = #{intY}
</if>
<if test="oIntX != null ">
AND oIntX = #{oIntX}
</if>
<if test="oIntY != null ">
AND oIntY = #{oIntY}
</if>
</where>
</select>
<update id="updatePoints">
UPDATE points
<set>
<if test="isLocked != null">
isLocked = #{isLocked, jdbcType=INTEGER},
</if>
<if test="intX != null">
intX = #{intX, jdbcType=VARCHAR},
</if>
<if test="intY != null">
intY = #{intY, jdbcType=VARCHAR},
</if>
<if test="oIntX != null">
oIntX = #{oIntX, jdbcType=VARCHAR},
</if>
<if test="oIntY != null">
oIntY = #{oIntY, jdbcType=VARCHAR},
</if>
<if test="num != null">
num = #{num, jdbcType=INTEGER},
</if>
</set>
where goodsShelfNo=#{goodsShelfNo} and warehouseCode=#{warehouseCode}
</update>
<select id="selectShlfno" resultType="java.util.HashMap">
SELECT goodsShelfNo FROM points where warehouseCode=#{warehouseCode} order by goodsShelfNo asc
</select>
<select id="getFirstEntity" resultType="com.huaheng.pc.config.points.domain.Points">
SELECT * FROM points where isLocked=2 and warehouseCode=#{warehouseCode} order by num asc limit 1
</select>
</mapper>