王佳豪
2021-03-10 17ff4e0c0ede8f6cacd88525d1ac7a1cf44eb0af
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
<?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.zy.asrs.mapper.LocNormalMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.asrs.entity.LocNormal">
        <result column="matnr" property="matnr"/>
        <result column="maktx" property="maktx"/>
        <result column="lgnum" property="lgnum"/>
        <result column="type" property="type"/>
        <result column="mnemonic" property="mnemonic"/>
        <result column="supplier" property="supplier"/>
        <result column="warehouse" property="warehouse"/>
        <result column="brand" property="brand"/>
        <result column="anfme" property="anfme"/>
        <result column="bname" property="bname"/>
        <result column="memo" property="memo"/>
        <result column="modi_user" property="modiUser"/>
        <result column="modi_time" property="modiTime"/>
        <result column="appe_user" property="appeUser"/>
        <result column="appe_time" property="appeTime"/>
        <result column="state" property="state"/>
    </resultMap>
 
    <select id="getLocNormalData" resultMap="BaseResultMap">
      select * from asr_loc_normal
    </select>
 
    <!-- 更新平仓物料的数量 -->
    <update id="updateLocNormal">
        update asr_loc_normal set anfme = #{anfme,jdbcType=DECIMAL},
        modi_user = #{modiUser, jdbcType=DECIMAL}, modi_time = #{modiTime, jdbcType=TIMESTAMP}
        where matnr = #{matnr,jdbcType=VARCHAR}
    </update>
 
    <update id="outLocNormal">
        update asr_loc_normal set state = '2',modi_user = #{modiUser, jdbcType=DECIMAL},
        modi_time = #{modiTime, jdbcType=TIMESTAMP} where matnr = #{matnr,jdbcType=VARCHAR}
    </update>
 
    <update id="removeLocNormal">
        update asr_loc_normal set state = '3',modi_user = #{modiUser, jdbcType=DECIMAL},
        modi_time = #{modiTime, jdbcType=TIMESTAMP} where matnr = #{matnr,jdbcType=VARCHAR}
    </update>
 
 
    <insert id="pdaLocNormalIn">
        BEGIN
        <foreach collection="list" item="item" index="index">
            INSERT INTO asr_loc_normal (matnr, maktx, anfme, warehouse, state, appe_user, appe_time)
            VALUES (#{item.matnr,jdbcType=VARCHAR}, #{item.maktx,jdbcType=VARCHAR}, #{item.anfme,jdbcType=DECIMAL},
            #{item.warehouse,jdbcType=VARCHAR}, '1', #{item.appeUser,jdbcType=DECIMAL},
            #{item.appeTime,jdbcType=TIMESTAMP})
        </foreach>
        END;
    </insert>
 
    <insert id="locNormalIn">
        BEGIN
        <foreach collection="list" item="item" index="index">
            INSERT INTO asr_loc_normal (matnr, maktx, anfme, altme, lgnum, type, supplier, brand, warehouse, state,
            appe_user, appe_time)
            VALUES (#{item.matnr,jdbcType=VARCHAR}, #{item.maktx,jdbcType=VARCHAR}, #{item.anfme,jdbcType=DECIMAL},
            #{item.altme,jdbcType=VARCHAR},#{item.lgnum, jdbcType=VARCHAR}, #{item.type, jdbcType=VARCHAR},
            #{item.supplier, jdbcType=VARCHAR},#{item.brand, jdbcType=VARCHAR},
            #{item.warehouse,jdbcType=VARCHAR}, '1', #{item.appeUser,jdbcType=DECIMAL},
            #{item.appeTime,jdbcType=TIMESTAMP})
        </foreach>
        END;
    </insert>
</mapper>