|
|
@@ -44,4 +44,57 @@
|
|
44
|
44
|
AND ii."material_type" in (SELECT id FROM SYS_TREE_DICT std WHERE std.DIFFERENCE_ = 2)
|
|
45
|
45
|
GROUP BY std.NAME_
|
|
46
|
46
|
</select>
|
|
|
47
|
+ <!-- 出入库记录 -->
|
|
|
48
|
+ <select id="getEnterExitRecords" parameterType="integer" resultType="com.unis.vis.model.OutAndInboundRecord">
|
|
|
49
|
+ SELECT record.type,
|
|
|
50
|
+ record.shengName,
|
|
|
51
|
+ record.material_name as materialName,
|
|
|
52
|
+ record.quantity,
|
|
|
53
|
+ record.specs,
|
|
|
54
|
+ record.bound_time as boundTime
|
|
|
55
|
+ FROM (
|
|
|
56
|
+ SELECT
|
|
|
57
|
+ 1 AS type,
|
|
|
58
|
+ null as shengName,
|
|
|
59
|
+ std.NAME_ as material_name,
|
|
|
60
|
+ ruku.quantity,
|
|
|
61
|
+ ruku.specs,
|
|
|
62
|
+ ruku.inbound_time AS bound_time
|
|
|
63
|
+ FROM "inbound_status" flow
|
|
|
64
|
+ LEFT JOIN "inbound_material_info" ruku ON ruku."inbound_id" = flow."inbound_id"
|
|
|
65
|
+ LEFT JOIN SYS_TREE_DICT std ON std.id = ruku.material_name
|
|
|
66
|
+ WHERE
|
|
|
67
|
+ flow.is_invalid = 0
|
|
|
68
|
+ AND ruku.is_available = 0
|
|
|
69
|
+ <!-- 审核通过的 -->
|
|
|
70
|
+ AND flow."status" = 5
|
|
|
71
|
+
|
|
|
72
|
+ UNION ALL
|
|
|
73
|
+
|
|
|
74
|
+ SELECT
|
|
|
75
|
+ 2 AS type,
|
|
|
76
|
+ dict.DESCRIPTION as shengName,
|
|
|
77
|
+ std.NAME_ as material_name,
|
|
|
78
|
+ chuku.quantity,
|
|
|
79
|
+ chuku.specs,
|
|
|
80
|
+ chuku.outbound_time AS bound_time
|
|
|
81
|
+ FROM "outbound_status" flow
|
|
|
82
|
+ LEFT JOIN "outbound_material_info" chuku ON chuku."outbound_id" = flow."outbound_id"
|
|
|
83
|
+ LEFT JOIN SYS_DICT_ITEM dict ON dict.ITEM_VALUE = chuku."province"
|
|
|
84
|
+ LEFT JOIN SYS_TREE_DICT std ON std.id = chuku.material_name
|
|
|
85
|
+ WHERE
|
|
|
86
|
+ flow.is_invalid = 0
|
|
|
87
|
+ AND chuku.is_available = 0
|
|
|
88
|
+ <!-- 审核通过的 -->
|
|
|
89
|
+ AND flow."status" = 5
|
|
|
90
|
+ AND dict.DICT_TYPE = 'province_ch'
|
|
|
91
|
+ ) record
|
|
|
92
|
+ <where>
|
|
|
93
|
+ <if test="type != null and type > 0">
|
|
|
94
|
+ AND record.type = #{type}
|
|
|
95
|
+ </if>
|
|
|
96
|
+ </where>
|
|
|
97
|
+ ORDER BY record.bound_time desc
|
|
|
98
|
+ </select>
|
|
|
99
|
+
|
|
47
|
100
|
</mapper>
|