|
|
@@ -2,7 +2,7 @@
|
|
2
|
2
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
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
|
|
- select * from (
|
|
|
5
|
+ <!-- select * from (
|
|
6
|
6
|
SELECT
|
|
7
|
7
|
row_number() over(partition by t2.storehouse_code ) rn,
|
|
8
|
8
|
case substr(t2.storehouse_code,1,2) when 'YG' then t4.tank_type else t2.storehouse_type end as storehouse_type,
|
|
|
@@ -70,7 +70,75 @@
|
|
70
|
70
|
</if>
|
|
71
|
71
|
</where>
|
|
72
|
72
|
) a
|
|
73
|
|
- where a.rn = 1
|
|
|
73
|
+ where a.rn = 1 -->
|
|
|
74
|
+
|
|
|
75
|
+ SELECT
|
|
|
76
|
+ case substr(t2.storehouse_code,1,2) when 'YG' then t4.tank_type else t2.storehouse_type end as storehouse_type,
|
|
|
77
|
+ t2.storehouse_code,
|
|
|
78
|
+ t2.storehouse_name,
|
|
|
79
|
+ case substr(t2.storehouse_code,1,2) when 'YG' then t4.tank_capacity else t2.design_capacity end as design_capacity,
|
|
|
80
|
+ t2.house_doot_position,
|
|
|
81
|
+ case substr(t2.storehouse_code,1,2) when 'YG' then t4.tank_status else t2.storehouse_state end as storehouse_state,
|
|
|
82
|
+ t2.dutyStoreman,
|
|
|
83
|
+ t1.lkmc,
|
|
|
84
|
+ t1.pz,
|
|
|
85
|
+ t1.hwxz,
|
|
|
86
|
+ t1.dj,
|
|
|
87
|
+ t1.kcsl,
|
|
|
88
|
+ char(t1.rq,'yyyy-MM-dd HH24:mi:ss') AS rq,
|
|
|
89
|
+ char(t1.rq,'yyyy-MM-dd HH24:mi:ss') AS rcrq,
|
|
|
90
|
+ char(t1.cjsj,'yyyy-MM-dd HH24:mi:ss') AS cjsj,
|
|
|
91
|
+ t1.UnitID
|
|
|
92
|
+ FROM crk_qh.data_kcgl_kcsw_default AS t1
|
|
|
93
|
+ LEFT JOIN depot_qh.basic_storehouse t2 ON t1.UnitID = t2.org_id AND t1.ch = t2.storehouse_id AND del_flag = 1
|
|
|
94
|
+ LEFT JOIN depot_qh.basic_tank t4 on t4.id=t2.storehouse_id
|
|
|
95
|
+ <where>
|
|
|
96
|
+ <if test="org_id != null">
|
|
|
97
|
+ t2.org_id = #{org_id}
|
|
|
98
|
+ </if>
|
|
|
99
|
+ <if test="library_type != null">
|
|
|
100
|
+ AND t2.library_type = #{library_type}
|
|
|
101
|
+ </if>
|
|
|
102
|
+ <if test="cfCdoe != null">
|
|
|
103
|
+ AND t2.storehouse_code = #{cfCdoe}
|
|
|
104
|
+ </if>
|
|
|
105
|
+ </where>
|
|
|
106
|
+ group by t2.storehouse_code
|
|
|
107
|
+
|
|
|
108
|
+ union all
|
|
|
109
|
+ SELECT
|
|
|
110
|
+ case substr(t2.storehouse_code,1,2) when 'YG' then t4.tank_type else t2.storehouse_type end as storehouse_type,
|
|
|
111
|
+ t2.storehouse_code,
|
|
|
112
|
+ t2.storehouse_name,
|
|
|
113
|
+ case substr(t2.storehouse_code,1,2) when 'YG' then t4.tank_capacity else t2.design_capacity end as design_capacity,
|
|
|
114
|
+ t2.house_doot_position,
|
|
|
115
|
+ case substr(t2.storehouse_code,1,2) when 'YG' then t4.tank_status else t2.storehouse_state end as storehouse_state,
|
|
|
116
|
+ t2.dutyStoreman,
|
|
|
117
|
+ t3.org_name,
|
|
|
118
|
+ t1.lypz,
|
|
|
119
|
+ t1.lyxz,
|
|
|
120
|
+ t1.lydj,
|
|
|
121
|
+ t1.kcsl,
|
|
|
122
|
+ char(t1.rksj,'yyyy-MM-dd HH24:mi:ss') AS rq,
|
|
|
123
|
+ char(t1.rksj,'yyyy-MM-dd HH24:mi:ss') AS rcrq,
|
|
|
124
|
+ char(t1.input_time,'yyyy-MM-dd HH24:mi:ss') AS cjsj,
|
|
|
125
|
+ t1.org_id
|
|
|
126
|
+ FROM depot_qh.storage_product_kcsl AS t1
|
|
|
127
|
+ LEFT JOIN depot_qh.basic_storehouse t2 ON t1.org_id = t2.org_id AND t1.house_id = t2.storehouse_id AND t2.del_flag = 1
|
|
|
128
|
+ LEFT JOIN depot_qh.org_info t3 ON t3.org_id = t2.org_id
|
|
|
129
|
+ LEFT JOIN depot_qh.basic_tank t4 on t4.id=t2.storehouse_id
|
|
|
130
|
+ <where>
|
|
|
131
|
+ <if test="org_id != null">
|
|
|
132
|
+ t2.org_id = #{org_id}
|
|
|
133
|
+ </if>
|
|
|
134
|
+ <if test="library_type != null">
|
|
|
135
|
+ AND t2.library_type = #{library_type}
|
|
|
136
|
+ </if>
|
|
|
137
|
+ <if test="cfCdoe != null">
|
|
|
138
|
+ AND t2.storehouse_code = #{cfCdoe}
|
|
|
139
|
+ </if>
|
|
|
140
|
+ </where>
|
|
|
141
|
+ group by t2.storehouse_code
|
|
74
|
142
|
</select>
|
|
75
|
143
|
|
|
76
|
144
|
<select id="getColumn1Max" parameterType="java.util.Map" resultType="java.util.Map">
|