|
|
@@ -588,60 +588,7 @@
|
|
588
|
588
|
</update>
|
|
589
|
589
|
|
|
590
|
590
|
<select id="getDataByExample" parameterType="java.util.Map" resultType="java.util.HashMap">
|
|
591
|
|
- SELECT
|
|
592
|
|
- temperAll.*
|
|
593
|
|
- FROM
|
|
594
|
|
- (
|
|
595
|
|
- SELECT DISTINCT
|
|
596
|
|
- temper.id id,
|
|
597
|
|
- temper.org_id orgId,
|
|
598
|
|
- depot.depot_id agentOrgId,
|
|
599
|
|
- depot.depot_id agentStoreOrgId,
|
|
600
|
|
- '1' sign,
|
|
601
|
|
- depot.agent_depot_name agentDepotName,
|
|
602
|
|
- store.storehouse_name storehouseName,
|
|
603
|
|
- ba.agent_name agentName,
|
|
604
|
|
- temper.lspz lspz,
|
|
605
|
|
- temper.detection_time detectionTime,
|
|
606
|
|
- temper.house_temperature houseTemperature,
|
|
607
|
|
- temper.house_humidity houseHumidity,
|
|
608
|
|
- temper.max max,
|
|
609
|
|
- temper.min min,
|
|
610
|
|
- temper.avg avg,
|
|
611
|
|
- store.storehouse_type storehouseType,
|
|
612
|
|
- store.design_capacity designCapacity,
|
|
613
|
|
- temper.enter_time enterTime,
|
|
614
|
|
- temper.nature nature,
|
|
615
|
|
- temper.level level,
|
|
616
|
|
- temper.actual_amount actualAmount,
|
|
617
|
|
- temper.harvest_year harvestYear,
|
|
618
|
|
- temper.gas_temperature gasTemperature,
|
|
619
|
|
- temper.gas_humidity gasHumidity,
|
|
620
|
|
- temper.keeper keeper,
|
|
621
|
|
- temper.updatetime updatetime
|
|
622
|
|
- FROM
|
|
623
|
|
- business_agent_temperature temper
|
|
624
|
|
- LEFT JOIN business_agent_depot depot ON depot.id = temper.agent_depot_id
|
|
625
|
|
- AND depot.org_id = #{orgId,jdbcType=INTEGER}
|
|
626
|
|
- LEFT JOIN basic_storehouse store ON store.storehouse_id = temper.storehouse_id
|
|
627
|
|
- LEFT JOIN business_agent ba ON depot.org_id = ba.org_id
|
|
628
|
|
- WHERE temper.org_id = #{orgId,jdbcType=INTEGER}
|
|
629
|
|
- <if test="agentDepotId != null">
|
|
630
|
|
- AND temper.agent_depot_id = #{agentDepotId,jdbcType=INTEGER}
|
|
631
|
|
- </if>
|
|
632
|
|
- <if test="storehouseId != null">
|
|
633
|
|
- AND temper.storehouse_id = #{storehouseId,jdbcType=INTEGER}
|
|
634
|
|
- </if>
|
|
635
|
|
- <if test="startTime != null and endTime != null">
|
|
636
|
|
- AND temper.detection_time BETWEEN #{startTime} AND #{endTime}
|
|
637
|
|
- </if>
|
|
638
|
|
- <if test="temperId != null">
|
|
639
|
|
- AND temper.id = #{temperId,jdbcType=INTEGER}
|
|
640
|
|
- </if>
|
|
641
|
|
- <if test="lspz != null">
|
|
642
|
|
- AND temper.lspz = #{lspz,jdbcType=INTEGER}
|
|
643
|
|
- </if>
|
|
644
|
|
- UNION ALL
|
|
|
591
|
+-- 去除手动添加的测温数据查询,如果需要可以去山西项目那,不过不推荐,测温表数据量过大,如果多方查询会造成查询过慢
|
|
645
|
592
|
SELECT DISTINCT
|
|
646
|
593
|
tt.id id,
|
|
647
|
594
|
tt.org_id orgId,
|
|
|
@@ -649,7 +596,7 @@
|
|
649
|
596
|
depot.depot_id agentStoreOrgId,
|
|
650
|
597
|
'0' sign,
|
|
651
|
598
|
depot.agent_depot_name agentDepotName,
|
|
652
|
|
- store.storehouse_name storehouseName,
|
|
|
599
|
+ agentStore.storehouse_id storehouseName,
|
|
653
|
600
|
ba.agent_name agentName,
|
|
654
|
601
|
tt.storehouse lspz,
|
|
655
|
602
|
tt.time detectionTime,
|
|
|
@@ -658,8 +605,6 @@
|
|
658
|
605
|
tt.max max,
|
|
659
|
606
|
tt.min min,
|
|
660
|
607
|
tt.avg avg,
|
|
661
|
|
- store.storehouse_type storehouseType,
|
|
662
|
|
- store.design_capacity designCapacity,
|
|
663
|
608
|
tt.storehouse enterTime,
|
|
664
|
609
|
tt.storehouse nature,
|
|
665
|
610
|
tt.storehouse level,
|
|
|
@@ -673,21 +618,19 @@
|
|
673
|
618
|
business_agent_depot depot
|
|
674
|
619
|
INNER JOIN business_agent_storehouse agentStore ON depot.id = agentStore.agent_depot_id
|
|
675
|
620
|
INNER JOIN business_agent ba ON depot.org_id = ba.org_id
|
|
676
|
|
- INNER JOIN basic_storehouse store ON store.storehouse_id = agentStore.storehouse_id
|
|
677
|
|
- AND store.del_flag = 1
|
|
678
|
621
|
LEFT JOIN t_testdata tt ON depot.depot_id = tt.org_id
|
|
679
|
|
- AND tt.storehouse = store.storehouse_code
|
|
680
|
622
|
AND tt.org_id != #{orgId,jdbcType=INTEGER}
|
|
681
|
623
|
AND tt.updatetime >= depot.updatetime
|
|
682
|
624
|
WHERE
|
|
683
|
625
|
tt.iLq_yq = '0'
|
|
|
626
|
+ AND tt.org_id = #{orgId,jdbcType=INTEGER}
|
|
684
|
627
|
AND depot.org_id = #{orgId,jdbcType=INTEGER}
|
|
685
|
628
|
AND depot.del_flag = 1
|
|
686
|
629
|
<if test="agentDepotId != null">
|
|
687
|
630
|
AND depot.id = #{agentDepotId,jdbcType=INTEGER}
|
|
688
|
631
|
</if>
|
|
689
|
632
|
<if test="storehouseId != null">
|
|
690
|
|
- AND store.storehouse_id = #{storehouseId,jdbcType=INTEGER}
|
|
|
633
|
+ AND agentStore.storehouse_id = #{storehouseId,jdbcType=INTEGER}
|
|
691
|
634
|
</if>
|
|
692
|
635
|
<if test="startTime != null and endTime != null">
|
|
693
|
636
|
AND tt.time BETWEEN #{startTime} AND #{endTime}
|
|
|
@@ -695,10 +638,9 @@
|
|
695
|
638
|
<if test="lspz != null and endTime != null">
|
|
696
|
639
|
AND tt.storehouse = #{lspz,jdbcType=INTEGER}
|
|
697
|
640
|
</if>
|
|
698
|
|
- ) temperAll
|
|
699
|
|
- WHERE temperAll.orgId IS NOT NULL AND temperAll.id IS NOT NULL
|
|
|
641
|
+ AND tt.org_id IS NOT NULL AND tt.id IS NOT NULL
|
|
700
|
642
|
ORDER BY
|
|
701
|
|
- temperAll.updatetime DESC
|
|
|
643
|
+ tt.updatetime DESC
|
|
702
|
644
|
</select>
|
|
703
|
645
|
|
|
704
|
646
|
<select id="getTestDataList" parameterType="java.util.Map" resultType="java.util.HashMap">
|