Quellcode durchsuchen

kcsw 添加多货位累加功能

hanqingsong vor 4 Jahren
Ursprung
Commit
1327288c64

+ 80 - 40
src/main/java/com/chinaitop/depot/intelligent/basicdata/mapper/WareHouseBasicInfoMapper.xml

@@ -3,50 +3,90 @@
3 3
 <mapper namespace="com.chinaitop.depot.intelligent.basicdata.mapper.WareHouseBasicInfoMapper" >
4 4
     <select id="getStorehouseInfo" parameterType="java.util.Map" resultType="java.util.Map">
5 5
         SELECT
6
-          t.*
6
+        tt.storehouse_type,
7
+        tt.storehouse_code,
8
+        tt.storehouse_name,
9
+        tt.design_capacity,
10
+        tt.house_doot_position,
11
+        tt.storehouse_state,
12
+        tt.dutyStoreman,
13
+        tt.lkmc,
14
+        tt.pz,
15
+        tt.hwxz,
16
+        tt.dj,
17
+        FORMAT(SUM(tt.kcsl) / 1000, 4) kcsl,
18
+        tt.rq,
19
+        tt.rcrq,
20
+        tt.cjsj,
21
+        tt.UnitID,
22
+        tt.hwh
7 23
         FROM
8 24
         (
9
-            SELECT
10
-                t2.storehouse_type,
11
-                t2.storehouse_code,
12
-                t2.storehouse_name,
13
-                t2.design_capacity,
14
-                t2.house_doot_position,
15
-                t2.storehouse_state,
16
-                t2.dutyStoreman,
17
-                t1.lkmc,
18
-                t1.pz,
19
-                t1.hwxz,
20
-                t1.dj,
21
-                FORMAT(t1.kcsl/1000,4) kcsl,
22
-                t4.EnumItemName rq,
23
-                DATE_FORMAT(t1.rq, '%Y-%m-%d') AS rcrq,
24
-                DATE_FORMAT(t1.cjsj, '%Y-%m-%d') AS cjsj,
25
-                t1.UnitID
26
-            FROM
27
-              `lsreport_ts`.data_kcgl_kcsw_default AS t1
28
-            LEFT JOIN `depot`.`basic_storehouse` t2 ON t1.UnitID = t2.org_id
29
-            AND t1.ch = t2.storehouse_id
30
-            LEFT JOIN `lsreport_ts`.`data_kcgl_fcbgz_default` t3 ON t2.org_id = t3.UnitID
31
-            AND t2.storehouse_id = t3.ch
32
-            LEFT JOIN `lsreport_ts`.`enumitem` t4 ON t3.scnf = t4.EnumItemId
33
-            <where>
34
-                  t2.del_flag = 1
35
-                <if test="org_id != null">
36
-                  AND t2.org_id = #{org_id}
37
-                </if>
38
-                <if test="library_type != null">
39
-                  AND t2.library_type = #{library_type}
40
-                </if>
41
-                <if test="cfCdoe != null">
42
-                  AND t2.storehouse_code = #{cfCdoe}
43
-                </if>
44
-            </where>
45
-            ORDER BY
46
-              t3.ModifyDate DESC
25
+        SELECT
26
+        t.storehouse_type,
27
+        t.storehouse_code,
28
+        t.storehouse_name,
29
+        t.design_capacity,
30
+        t.house_doot_position,
31
+        t.storehouse_state,
32
+        t.dutyStoreman,
33
+        t.lkmc,
34
+        t.pz,
35
+        t.hwxz,
36
+        t.dj,
37
+        t.kcsl,
38
+        t.rq,
39
+        t.rcrq,
40
+        t.cjsj,
41
+        t.UnitID,
42
+        t.hwh
43
+        FROM
44
+        (
45
+        SELECT
46
+        t2.storehouse_type,
47
+        t2.storehouse_code,
48
+        t2.storehouse_name,
49
+        t2.design_capacity,
50
+        t2.house_doot_position,
51
+        t2.storehouse_state,
52
+        t2.dutyStoreman,
53
+        t1.lkmc,
54
+        t1.pz,
55
+        t1.hwxz,
56
+        t1.dj,
57
+        t1.kcsl kcsl,
58
+        t4.EnumItemName rq,
59
+        DATE_FORMAT(t1.rq, '%Y-%m-%d') AS rcrq,
60
+        DATE_FORMAT(t1.cjsj, '%Y-%m-%d') AS cjsj,
61
+        t1.UnitID,
62
+        t1.hwh
63
+        FROM
64
+        `lsreport_ts`.data_kcgl_kcsw_default AS t1
65
+        INNER JOIN `depot`.`basic_storehouse` t2 ON t1.UnitID = t2.org_id
66
+        AND t1.ch = t2.storehouse_id
67
+        LEFT JOIN `lsreport_ts`.`data_kcgl_fcbgz_default` t3 ON t2.org_id = t3.UnitID
68
+        AND t2.storehouse_id = t3.ch
69
+        LEFT JOIN `lsreport_ts`.`enumitem` t4 ON t3.scnf = t4.EnumItemId
70
+        <where>
71
+            t2.del_flag = 1
72
+            <if test="org_id != null">
73
+                AND t2.org_id = #{org_id}
74
+            </if>
75
+            <if test="library_type != null">
76
+                AND t2.library_type = #{library_type}
77
+            </if>
78
+            <if test="cfCdoe != null">
79
+                AND t2.storehouse_code = #{cfCdoe}
80
+            </if>
81
+        </where>
82
+        ORDER BY
83
+        t3.ModifyDate DESC
47 84
         ) t
48 85
         GROUP BY
49
-          t.storehouse_code
86
+        t.hwh
87
+        ) tt
88
+        GROUP BY
89
+        tt.storehouse_code
50 90
     </select>
51 91
     <select id="getYGInfo" parameterType="java.util.Map" resultType="java.util.Map">
52 92
         SELECT