|
|
@@ -23,59 +23,72 @@
|
|
23
|
23
|
where b."status"=5
|
|
24
|
24
|
GROUP BY dic.NAME_
|
|
25
|
25
|
</select>
|
|
|
26
|
+ <!-- 应用物资大类 -->
|
|
26
|
27
|
<select id="getWzsyqkpm" resultType="com.unis.vis.model.InboundMaterialInfo">
|
|
27
|
28
|
select dic.NAME_ as material_type,SUM(iif.quantity)as quantity,SUM(iif.total_price)as total_price
|
|
28
|
29
|
from outbound_material_info iif
|
|
29
|
|
- left JOIN SYS_TREE_DICT dic on iif.material_type=dic.ID
|
|
30
|
|
- left join outbound_info b ON iif."outbound_id"=B."outbound_id"
|
|
|
30
|
+ left JOIN SYS_TREE_DICT dic on iif.material_type=dic.ID
|
|
|
31
|
+ left join outbound_info b ON iif."outbound_id"=B."outbound_id"
|
|
31
|
32
|
where b."status"=5 and dic.DIFFERENCE_=2
|
|
32
|
33
|
GROUP BY dic.NAME_
|
|
33
|
34
|
</select>
|
|
34
|
|
-
|
|
|
35
|
+ <!-- 物资入库情况 -->
|
|
|
36
|
+ <select id="getInventoryReceiptStatus" resultType="com.unis.vis.model.InboundMaterialInfo">
|
|
|
37
|
+ SELECT std.NAME_ as material_type,
|
|
|
38
|
+ SUM(imi.quantity) as quantity,
|
|
|
39
|
+ SUM(imi.total_price) as total_price
|
|
|
40
|
+ FROM "inbound_material_info" imi
|
|
|
41
|
+ LEFT JOIN "inbound_info" ii ON imi."inbound_id" = ii."inbound_id"
|
|
|
42
|
+ LEFT JOIN "SYS_TREE_DICT" std ON std."id" = ii."material_type"
|
|
|
43
|
+ WHERE ii."status" = 5
|
|
|
44
|
+ AND ii."is_available" = 0
|
|
|
45
|
+ AND ii."material_type" in (SELECT id FROM SYS_TREE_DICT std WHERE std.DIFFERENCE_ = 2)
|
|
|
46
|
+ GROUP BY std.NAME_
|
|
|
47
|
+ </select>
|
|
35
|
48
|
<!-- 出入库记录 -->
|
|
36
|
49
|
<select id="getEnterExitRecords" parameterType="integer" resultType="com.unis.vis.model.OutAndInboundRecord">
|
|
37
|
50
|
SELECT record.type,
|
|
38
|
|
- record.shengName,
|
|
39
|
|
- record.material_name as materialName,
|
|
40
|
|
- record.quantity,
|
|
41
|
|
- record.specs,
|
|
42
|
|
- record.bound_time as boundTime
|
|
|
51
|
+ record.shengName,
|
|
|
52
|
+ record.material_name as materialName,
|
|
|
53
|
+ record.quantity,
|
|
|
54
|
+ record.specs,
|
|
|
55
|
+ record.bound_time as boundTime
|
|
43
|
56
|
FROM (
|
|
44
|
|
- SELECT
|
|
45
|
|
- 1 AS type,
|
|
46
|
|
- null as shengName,
|
|
47
|
|
- std.NAME_ as material_name,
|
|
48
|
|
- ruku.quantity,
|
|
49
|
|
- ruku.specs,
|
|
50
|
|
- ruku.inbound_time AS bound_time
|
|
51
|
|
- FROM "inbound_status" flow
|
|
52
|
|
- LEFT JOIN "inbound_material_info" ruku ON ruku."inbound_id" = flow."inbound_id"
|
|
53
|
|
- LEFT JOIN SYS_TREE_DICT std ON std.id = ruku.material_name
|
|
54
|
|
- WHERE
|
|
55
|
|
- flow.is_invalid = 0
|
|
56
|
|
- AND ruku.is_available = 0
|
|
57
|
|
- <!-- 审核通过的 -->
|
|
58
|
|
- AND flow."status" = 5
|
|
|
57
|
+ SELECT
|
|
|
58
|
+ 1 AS type,
|
|
|
59
|
+ null as shengName,
|
|
|
60
|
+ std.NAME_ as material_name,
|
|
|
61
|
+ ruku.quantity,
|
|
|
62
|
+ ruku.specs,
|
|
|
63
|
+ ruku.inbound_time AS bound_time
|
|
|
64
|
+ FROM "inbound_status" flow
|
|
|
65
|
+ LEFT JOIN "inbound_material_info" ruku ON ruku."inbound_id" = flow."inbound_id"
|
|
|
66
|
+ LEFT JOIN SYS_TREE_DICT std ON std.id = ruku.material_name
|
|
|
67
|
+ WHERE
|
|
|
68
|
+ flow.is_invalid = 0
|
|
|
69
|
+ AND ruku.is_available = 0
|
|
|
70
|
+ <!-- 审核通过的 -->
|
|
|
71
|
+ AND flow."status" = 5
|
|
59
|
72
|
|
|
60
|
|
- UNION ALL
|
|
|
73
|
+ UNION ALL
|
|
61
|
74
|
|
|
62
|
|
- SELECT
|
|
63
|
|
- 2 AS type,
|
|
64
|
|
- dict.DESCRIPTION as shengName,
|
|
65
|
|
- std.NAME_ as material_name,
|
|
66
|
|
- chuku.quantity,
|
|
67
|
|
- chuku.specs,
|
|
68
|
|
- chuku.outbound_time AS bound_time
|
|
69
|
|
- FROM "outbound_status" flow
|
|
70
|
|
- LEFT JOIN "outbound_material_info" chuku ON chuku."outbound_id" = flow."outbound_id"
|
|
71
|
|
- LEFT JOIN SYS_DICT_ITEM dict ON dict.ITEM_VALUE = chuku."province"
|
|
72
|
|
- LEFT JOIN SYS_TREE_DICT std ON std.id = chuku.material_name
|
|
73
|
|
- WHERE
|
|
74
|
|
- flow.is_invalid = 0
|
|
75
|
|
- AND chuku.is_available = 0
|
|
76
|
|
- <!-- 审核通过的 -->
|
|
77
|
|
- AND flow."status" = 5
|
|
78
|
|
- AND dict.DICT_TYPE = 'province_ch'
|
|
|
75
|
+ SELECT
|
|
|
76
|
+ 2 AS type,
|
|
|
77
|
+ dict.DESCRIPTION as shengName,
|
|
|
78
|
+ std.NAME_ as material_name,
|
|
|
79
|
+ chuku.quantity,
|
|
|
80
|
+ chuku.specs,
|
|
|
81
|
+ chuku.outbound_time AS bound_time
|
|
|
82
|
+ FROM "outbound_status" flow
|
|
|
83
|
+ LEFT JOIN "outbound_material_info" chuku ON chuku."outbound_id" = flow."outbound_id"
|
|
|
84
|
+ LEFT JOIN SYS_DICT_ITEM dict ON dict.ITEM_VALUE = chuku."province"
|
|
|
85
|
+ LEFT JOIN SYS_TREE_DICT std ON std.id = chuku.material_name
|
|
|
86
|
+ WHERE
|
|
|
87
|
+ flow.is_invalid = 0
|
|
|
88
|
+ AND chuku.is_available = 0
|
|
|
89
|
+ <!-- 审核通过的 -->
|
|
|
90
|
+ AND flow."status" = 5
|
|
|
91
|
+ AND dict.DICT_TYPE = 'province_ch'
|
|
79
|
92
|
) record
|
|
80
|
93
|
<where>
|
|
81
|
94
|
<if test="type != null and type > 0">
|