浏览代码

去除组织机构管理删除按钮;粮库决策-汽车出去库记录日期区间查询无法获取最后一条修复;

zlq 3 年之前
父节点
当前提交
66a473e0c1

+ 6 - 4
src/main/java/com/chinaitop/depot/intelligent/statisticalReport/mapper/StatisticalReportMapper.xml

@@ -151,10 +151,8 @@
151
 	    	td.avg avgTemp, sq.water,DATE_FORMAT(sq.input_time, '%Y-%m') inputTime,sq.harvest_time harvestTime
151
 	    	td.avg avgTemp, sq.water,DATE_FORMAT(sq.input_time, '%Y-%m') inputTime,sq.harvest_time harvestTime
152
 		FROM basic_storehouse bs
152
 		FROM basic_storehouse bs
153
 		LEFT JOIN storage_qualitycheck sq on bs.storehouse_id = sq.house_id and sq.org_id = bs.org_id
153
 		LEFT JOIN storage_qualitycheck sq on bs.storehouse_id = sq.house_id and sq.org_id = bs.org_id
154
-		LEFT JOIN t_testdata td on td.storehouse = bs.storehouse_code and td.iLq_yq = '0' and td.org_id = bs.org_id   
155
-		<if test="startDate != null and startDate != ''">
156
-	          and DATE_FORMAT(td.time, '%Y-%m-%d') = #{startDate}
157
-	    </if>
154
+		LEFT JOIN t_testdata td on td.storehouse = bs.storehouse_code  and td.org_id = bs.org_id
155
+
158
 	    <!-- LEFT JOIN t_testdata_layer tdl ON tdl.lHouse = bs.storehouse_code
156
 	    <!-- LEFT JOIN t_testdata_layer tdl ON tdl.lHouse = bs.storehouse_code
159
 	    <if test="orgId!=null">
157
 	    <if test="orgId!=null">
160
 	    	and tdl.org_id = ${orgId}   
158
 	    	and tdl.org_id = ${orgId}   
@@ -164,9 +162,13 @@
164
 	    </if> -->
162
 	    </if> -->
165
 		<where>
163
 		<where>
166
 			bs.del_flag = 1
164
 			bs.del_flag = 1
165
+			and td.iLq_yq = '0'
167
 			<if test="orgId!=null">
166
 			<if test="orgId!=null">
168
 	            and bs.org_id = ${orgId}   
167
 	            and bs.org_id = ${orgId}   
169
 	        </if>
168
 	        </if>
169
+			<if test="startDate != null and startDate != ''">
170
+				and DATE_FORMAT(td.time, '%Y-%m-%d') = #{startDate}
171
+			</if>
170
 		</where>
172
 		</where>
171
 		GROUP BY bs.storehouse_code
173
 		GROUP BY bs.storehouse_code
172
 	) bs LEFT JOIN t_testdata_layer tdl ON tdl.lHouse = bs.storeHouse 
174
 	) bs LEFT JOIN t_testdata_layer tdl ON tdl.lHouse = bs.storeHouse