|
@@ -160,7 +160,7 @@
|
|
|
|
|
|
<select id="getBuildingAssetNum" parameterType="String" resultType="Long">
|
|
|
SELECT
|
|
|
- building_asset_num
|
|
|
+ SUM( building_asset_num ) AS building_asset_num
|
|
|
FROM
|
|
|
large_plat_logistics a
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_code = b.app_code
|
|
@@ -181,7 +181,7 @@
|
|
|
|
|
|
<select id="getServiceAssetNum" parameterType="String" resultType="Long">
|
|
|
SELECT
|
|
|
- service_asset_num
|
|
|
+ SUM( service_asset_num ) AS service_asset_num
|
|
|
FROM
|
|
|
large_plat_logistics a
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_code = b.app_code
|
|
@@ -202,7 +202,7 @@
|
|
|
|
|
|
<select id="getOfficeAssetNum" parameterType="String" resultType="Long">
|
|
|
SELECT
|
|
|
- SUM( office_asset_num )
|
|
|
+ SUM( office_asset_num ) AS office_asset_num
|
|
|
FROM
|
|
|
large_plat_logistics a
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_code = b.app_code
|
|
@@ -211,38 +211,35 @@
|
|
|
|
|
|
<select id="getStockAssetNum" parameterType="String" resultMap="LargePlatLogisticsResult">
|
|
|
SELECT
|
|
|
- stock_building_asset_num,
|
|
|
- stock_service_asset_num,
|
|
|
- stock_office_asset_num
|
|
|
+ SUM( stock_building_asset_num ) AS stock_building_asset_num,
|
|
|
+ SUM( stock_service_asset_num ) AS stock_service_asset_num,
|
|
|
+ SUM( stock_office_asset_num ) AS stock_office_asset_num
|
|
|
FROM
|
|
|
large_plat_logistics a
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_code = b.app_code
|
|
|
- WHERE
|
|
|
- b.app_org = #{appOrg}
|
|
|
+ <if test="appOrg != '0000'">WHERE b.app_org = #{appOrg}</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getNewAssetNum" parameterType="String" resultMap="LargePlatLogisticsResult">
|
|
|
SELECT
|
|
|
- new_building_asset_num,
|
|
|
- new_service_asset_num,
|
|
|
- new_office_asset_num
|
|
|
+ SUM( new_building_asset_num ) AS new_building_asset_num,
|
|
|
+ SUM( new_service_asset_num ) AS new_service_asset_num,
|
|
|
+ SUM( new_office_asset_num ) AS new_office_asset_num
|
|
|
FROM
|
|
|
large_plat_logistics a
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_code = b.app_code
|
|
|
- WHERE
|
|
|
- b.app_org = #{appOrg}
|
|
|
+ <if test="appOrg != '0000'">WHERE b.app_org = #{appOrg}</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getScrapAssetNum" parameterType="String" resultMap="LargePlatLogisticsResult">
|
|
|
SELECT
|
|
|
- scrap_building_asset_num,
|
|
|
- scrap_service_asset_num,
|
|
|
- scrap_office_asset_num
|
|
|
+ SUM( scrap_building_asset_num ) AS scrap_building_asset_num,
|
|
|
+ SUM( scrap_service_asset_num ) AS scrap_service_asset_num,
|
|
|
+ SUM( scrap_office_asset_num ) AS scrap_office_asset_num
|
|
|
FROM
|
|
|
large_plat_logistics a
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_code = b.app_code
|
|
|
- WHERE
|
|
|
- b.app_org = #{appOrg}
|
|
|
+ <if test="appOrg != '0000'">WHERE b.app_org = #{appOrg}</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getCodedAndLabelRate" parameterType="String" resultType="Map">
|
|
@@ -250,28 +247,26 @@
|
|
|
TRIM(
|
|
|
TRAILING '.'
|
|
|
FROM
|
|
|
- ROUND( a.coded_num / a.asset_num, 3 )) * 100 AS codedRate,
|
|
|
+ ROUND( SUM( a.coded_num ) / SUM( a.asset_num ), 3 )) * 100 AS codedRate,
|
|
|
TRIM(
|
|
|
TRAILING '.'
|
|
|
FROM
|
|
|
- ROUND( a.label_num / a.asset_num, 3 )) * 100 AS labelRate
|
|
|
+ ROUND( SUM( a.label_num ) / SUM( a.asset_num ), 3 )) * 100 AS labelRate
|
|
|
FROM
|
|
|
large_plat_logistics a
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_code = b.app_code
|
|
|
- WHERE
|
|
|
- b.app_org = #{appOrg}
|
|
|
+ <if test="appOrg != '0000'">WHERE b.app_org = #{appOrg}</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getMainlyRate" parameterType="String" resultMap="LargePlatLogisticsResult">
|
|
|
SELECT
|
|
|
- building_asset_num,
|
|
|
- service_asset_num,
|
|
|
- office_asset_num
|
|
|
+ SUM( building_asset_num ) AS building_asset_num,
|
|
|
+ SUM( service_asset_num ) AS service_asset_num,
|
|
|
+ SUM( office_asset_num ) AS office_asset_num
|
|
|
FROM
|
|
|
large_plat_logistics a
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_code = b.app_code
|
|
|
- WHERE
|
|
|
- b.app_org = #{appOrg}
|
|
|
+ <if test="appOrg != '0000'">WHERE b.app_org = #{appOrg}</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getSceneRateX" resultMap="LargePlatLogisticsResult">
|
|
@@ -300,15 +295,14 @@
|
|
|
|
|
|
<select id="getOperation" resultMap="LargePlatLogisticsResult">
|
|
|
SELECT
|
|
|
- inspection_anomaly_record_num,
|
|
|
- repair_record_num,
|
|
|
- maintenance_record_num,
|
|
|
- important_device_type_inspection_execute_rate
|
|
|
+ SUM( inspection_anomaly_record_num ) AS inspection_anomaly_record_num,
|
|
|
+ SUM( repair_record_num ) AS repair_record_num,
|
|
|
+ SUM( maintenance_record_num ) AS maintenance_record_num,
|
|
|
+ ROUND(AVG(important_device_type_inspection_execute_rate), 2) AS important_device_type_inspection_execute_rate
|
|
|
FROM
|
|
|
large_plat_logistics a
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_code = b.app_code
|
|
|
- WHERE
|
|
|
- b.app_org = #{appOrg}
|
|
|
+ <if test="appOrg != '0000'">WHERE b.app_org = #{appOrg}</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getInspectionSchemeNumX" resultMap="LargePlatLogisticsResult">
|
|
@@ -319,8 +313,8 @@
|
|
|
large_plat_logistics a
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_code = b.app_code
|
|
|
WHERE
|
|
|
- b.app_parent_org = '10001'
|
|
|
- AND b.app_org NOT LIKE '1A%'
|
|
|
+ ( b.app_parent_org = '10001'
|
|
|
+ AND b.app_org NOT LIKE '1A%' ) OR b.app_org = '1A003'
|
|
|
</select>
|
|
|
|
|
|
<select id="getInspectionSchemeNumY" resultMap="LargePlatLogisticsResult">
|
|
@@ -332,6 +326,6 @@
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_code = b.app_code
|
|
|
WHERE
|
|
|
b.app_parent_org = '10001'
|
|
|
- AND b.app_org LIKE '1A%'
|
|
|
+ AND b.app_org LIKE '1A%' AND b.app_org != '1A003'
|
|
|
</select>
|
|
|
</mapper>
|