瀏覽代碼

台区停电周报

tudc 4 年之前
父節點
當前提交
c162f61d39

+ 10 - 5
src/main/resources/com/minpay/db/table/own/mapper/ReportManageMapper.xml

@@ -9,18 +9,23 @@
 			a.DRI_CREAT_USER creatUser,
 			a.DRI_BRANCH branch,
 			a.DRI_TYPE typeId,
-			a.DRI_STATE state
-        from dw_report_inf a
+			a.DRI_STATE state,
+			b.DBRT_TYPE type
+        from dw_report_inf a,dw_branch_report_type b
 		where
 			a.DRI_STATE = '0'
+			and a.DRI_TYPE = b.DBRT_ID
 			<if test="fileName != null  and fileName != ''">
-		    	and DRI_FILE_NAME like concat('%', #{fileName,jdbcType=VARCHAR} ,'%')
+		    	and a.DRI_FILE_NAME like concat('%', #{fileName,jdbcType=VARCHAR} ,'%')
 		   	</if>
 			<if test="branchId != null  and branchId != ''">
-		    	and DRI_BRANCH = #{branchId,jdbcType=VARCHAR}
+		    	and a.DRI_BRANCH = #{branchId,jdbcType=VARCHAR}
 		   	</if>
 			<if test="date != null  and date != ''">
-		    	and DRI_UPLOAD_DATE between substring(#{date,jdbcType=VARCHAR},1,8) and substring(#{date,jdbcType=VARCHAR},9,16)
+		    	and a.DRI_UPLOAD_DATE between substring(#{date,jdbcType=VARCHAR},1,8) and substring(#{date,jdbcType=VARCHAR},9,16)
+		   	</if>
+			<if test="timeType != null  and timeType != ''">
+		    	and b.DBRT_TIME_TYPE = #{timeType,jdbcType=VARCHAR}
 		   	</if>
 	</select>
 </mapper>

+ 17 - 0
src/main/resources/com/minpay/db/table/own/mapper/ReportServiceMapper.xml

@@ -63,4 +63,21 @@
 		   	</if>
 		group by a.DFD0_ADDRESS_NUM
 	</select>
+	<select id="selectDetail00ByArea" resultType="hashmap" parameterType="java.util.Map">
+		select
+			a.DFD0_AREA area,
+			cast(count(1) as char) count,
+			cast(SUM(TIMESTAMPDIFF(MINUTE,DFD0_START_TIME,DFD0_END_TIME)) as char) timeMinute
+        from 
+        	dw_file_detail_00 a
+		where
+			1 = 1
+			<if test="beginTime != null  and beginTime != ''">
+		    	and DFD0_START_TIME &gt; #{beginTime,jdbcType=VARCHAR}
+		   	</if>
+			<if test="endTime != null  and endTime != ''">
+		    	and DFD0_START_TIME &lt; #{endTime,jdbcType=VARCHAR}
+		   	</if>
+		group by a.DFD0_AREA
+	</select>
 </mapper>