|
@@ -289,7 +289,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
WHERE DATE( delivery_time ) = DATE( NOW( ) )
|
|
|
<if test="enterpriseId != null and enterpriseId != ''"> and a.enterprise_id = #{enterpriseId}</if>
|
|
|
${params.dataScope}
|
|
|
- UNION ALL
|
|
|
+ <!-- UNION ALL
|
|
|
SELECT
|
|
|
'空罐回收' type,
|
|
|
count( b.id ) num
|
|
@@ -299,7 +299,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
|
|
|
WHERE DATE( recycling_time ) = DATE( NOW( ) )
|
|
|
<if test="enterpriseId != null and enterpriseId != ''"> and a.enterprise_id = #{enterpriseId}</if>
|
|
|
- ${params.dataScope}
|
|
|
+ ${params.dataScope}-->
|
|
|
+ union all
|
|
|
+ SELECT
|
|
|
+ '钢瓶待检' type,
|
|
|
+ count( a.id ) num
|
|
|
+ FROM
|
|
|
+ centerdata_t_housingconstruction_inspect a
|
|
|
+ JOIN ( SELECT steelcylinder_id, MAX( create_time ) max_time
|
|
|
+ FROM centerdata_t_housingconstruction_inspect GROUP BY steelcylinder_id ) b
|
|
|
+ ON a.steelcylinder_id = b.steelcylinder_id AND a.create_time = b.max_time
|
|
|
+ WHERE
|
|
|
+ a.next_inspect_time < DATE( NOW( ) )
|
|
|
+ <if test="enterpriseId != null and enterpriseId != ''"> and a.dept_id = #{enterpriseId}</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getJoinHouseUserList" parameterType="CenterdataTHousingconstructionSteelcylinder" resultType="map">
|
|
@@ -371,4 +383,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
${params.dataScope}
|
|
|
GROUP BY a.id
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="getReport" parameterType="CenterdataTHousingconstructionEnterpriseproductionreport" resultType="map">
|
|
|
+ SELECT
|
|
|
+ a.enterprise_name enterpriseName,
|
|
|
+ a.report_type reportType,
|
|
|
+ c.dict_label reportTypeLabel,
|
|
|
+ GROUP_CONCAT(b.attach_path) attachPaths
|
|
|
+ FROM
|
|
|
+ centerdata_t_housingconstruction_enterpriseproductionreport a
|
|
|
+ LEFT JOIN centerdata_t_housingconstruction_attach b ON a.id = b.bus_id
|
|
|
+ left join ${database_system}.sys_dict_data c on a.report_type = c.dict_value
|
|
|
+ where a.report_type LIKE concat( 'enterprise_production_report', '%' )
|
|
|
+ <if test="enterpriseId != null and enterpriseId != ''"> and a.enterprise_id = #{enterpriseId}</if>
|
|
|
+ GROUP BY a.id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getInspectionRecords" parameterType="CenterdataTHousingconstructionSafetyinspectionrecords" resultType="map">
|
|
|
+ SELECT
|
|
|
+ a.id,
|
|
|
+ a.censor_name censorName,
|
|
|
+ a.client_name clientName,
|
|
|
+ b.dict_label typeLabel,
|
|
|
+ a.steelcylinder_name steelcylinderName
|
|
|
+ FROM
|
|
|
+ centerdata_t_housingconstruction_safetyinspectionrecords a
|
|
|
+ left join ${database_system}.sys_dict_data b on a.enterprise_inspection_type = b.dict_value
|
|
|
+ WHERE
|
|
|
+ b.dict_type = 'enterprise_inspection_type'
|
|
|
+ <if test="clientId != null and clientId != ''"> and a.client_id = #{clientId}</if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getItems" parameterType="CenterdataTHousingconstructionSafetyinspectionrecordsdetail" resultType="map">
|
|
|
+ SELECT
|
|
|
+ if(a.standard_status='0','不合格','合格') `status`,
|
|
|
+ a.remark,
|
|
|
+ b.inspection_name inspectionName,
|
|
|
+ b.inspection_sort inspectionSort,
|
|
|
+ if(b.update_time is null,b.create_time,b.update_time) time,
|
|
|
+ GROUP_CONCAT(c.attach_path) attachPaths
|
|
|
+ FROM
|
|
|
+ centerdata_t_housingconstruction_safetyinspectionrecordsdetail a
|
|
|
+ LEFT JOIN centerdata_t_housingconstruction_safetyinspectionitem b ON a.item_id = b.id
|
|
|
+ left join centerdata_t_housingconstruction_attach c on a.id = c.bus_id
|
|
|
+ WHERE
|
|
|
+ a.record_id = #{recordId}
|
|
|
+ GROUP BY a.id
|
|
|
+ ORDER BY b.inspection_sort
|
|
|
+ </select>
|
|
|
</mapper>
|