gaodd před 2 roky
rodič
revize
b499f1a1f7

+ 4 - 2
src/main/java/com/chinaitop/depot/intelligent/basicdata/mapper/AlarmPhoneMapper.xml

@@ -105,7 +105,7 @@
105 105
         insert into monitor_alarm_phone (id, org_id, alarm_man,
106 106
         alarm_role, alarm_phone, detection_type,
107 107
         updatetime)
108
-        values (SEQ_MONITOR_ALARM_PHONE.nextVal, #{orgId,jdbcType=INTEGER}, #{alarmMan,jdbcType=VARCHAR},
108
+        values (#{id,jdbcType=INTEGER}, #{orgId,jdbcType=INTEGER}, #{alarmMan,jdbcType=VARCHAR},
109 109
         #{alarmRole,jdbcType=VARCHAR}, #{alarmPhone,jdbcType=VARCHAR}, #{detectionType,jdbcType=VARCHAR},
110 110
         #{updatetime,jdbcType=TIMESTAMP})
111 111
       </insert>
@@ -135,7 +135,9 @@
135 135
           </if>
136 136
         </trim>
137 137
         <trim prefix="values (" suffix=")" suffixOverrides="," >
138
-          SEQ_MONITOR_ALARM_PHONE.nextVal,
138
+          <if test="id != null" >
139
+            #{id,jdbcType=INTEGER},
140
+          </if>
139 141
           <if test="orgId != null" >
140 142
             #{orgId,jdbcType=INTEGER},
141 143
           </if>

+ 70 - 2
src/main/java/com/chinaitop/depot/intelligent/basicdata/mapper/WareHouseBasicInfoMapper.xml

@@ -2,7 +2,7 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 3
 <mapper namespace="com.chinaitop.depot.intelligent.basicdata.mapper.WareHouseBasicInfoMapper" >
4 4
     <select id="getStorehouseInfo" parameterType="java.util.Map" resultType="java.util.Map">
5
-        select * from (
5
+        <!-- select * from (
6 6
         SELECT
7 7
         row_number() over(partition by t2.storehouse_code ) rn,
8 8
         case substr(t2.storehouse_code,1,2) when 'YG' then t4.tank_type else t2.storehouse_type end as storehouse_type,
@@ -70,7 +70,75 @@
70 70
             </if>
71 71
         </where>
72 72
         ) a
73
-        where a.rn = 1
73
+        where a.rn = 1 -->
74
+        
75
+        SELECT
76
+        case substr(t2.storehouse_code,1,2) when 'YG' then t4.tank_type else t2.storehouse_type end as storehouse_type,
77
+        t2.storehouse_code,
78
+        t2.storehouse_name,
79
+        case substr(t2.storehouse_code,1,2) when 'YG' then t4.tank_capacity else t2.design_capacity end as design_capacity,
80
+        t2.house_doot_position,
81
+        case substr(t2.storehouse_code,1,2) when 'YG' then t4.tank_status else t2.storehouse_state end as storehouse_state,
82
+        t2.dutyStoreman,
83
+        t1.lkmc,
84
+        t1.pz,
85
+        t1.hwxz,
86
+        t1.dj,
87
+        t1.kcsl,
88
+        char(t1.rq,'yyyy-MM-dd HH24:mi:ss') AS rq,
89
+        char(t1.rq,'yyyy-MM-dd HH24:mi:ss') AS rcrq,
90
+        char(t1.cjsj,'yyyy-MM-dd HH24:mi:ss') AS cjsj,
91
+        t1.UnitID
92
+	    FROM crk_qh.data_kcgl_kcsw_default AS t1
93
+	    LEFT JOIN depot_qh.basic_storehouse t2 ON t1.UnitID = t2.org_id AND t1.ch = t2.storehouse_id AND del_flag = 1
94
+	    LEFT JOIN depot_qh.basic_tank t4 on t4.id=t2.storehouse_id
95
+	    <where>
96
+            <if test="org_id != null">
97
+                t2.org_id = #{org_id}
98
+            </if>
99
+            <if test="library_type != null">
100
+                AND t2.library_type = #{library_type}
101
+            </if>
102
+            <if test="cfCdoe != null">
103
+                AND t2.storehouse_code = #{cfCdoe}
104
+            </if>
105
+        </where>
106
+	    group by t2.storehouse_code
107
+        
108
+      union all
109
+    	SELECT
110
+        case substr(t2.storehouse_code,1,2) when 'YG' then t4.tank_type else t2.storehouse_type end as storehouse_type,
111
+        t2.storehouse_code,
112
+        t2.storehouse_name,
113
+        case substr(t2.storehouse_code,1,2) when 'YG' then t4.tank_capacity else t2.design_capacity end as design_capacity,
114
+        t2.house_doot_position,
115
+        case substr(t2.storehouse_code,1,2) when 'YG' then t4.tank_status else t2.storehouse_state end as storehouse_state,
116
+        t2.dutyStoreman,
117
+        t3.org_name,
118
+        t1.lypz,
119
+        t1.lyxz,
120
+        t1.lydj,
121
+        t1.kcsl,
122
+        char(t1.rksj,'yyyy-MM-dd HH24:mi:ss') AS rq,
123
+        char(t1.rksj,'yyyy-MM-dd HH24:mi:ss') AS rcrq,
124
+        char(t1.input_time,'yyyy-MM-dd HH24:mi:ss') AS cjsj,
125
+        t1.org_id
126
+	    FROM depot_qh.storage_product_kcsl AS t1
127
+	    LEFT JOIN depot_qh.basic_storehouse t2 ON t1.org_id = t2.org_id AND t1.house_id = t2.storehouse_id AND t2.del_flag = 1
128
+	    LEFT JOIN depot_qh.org_info t3 ON t3.org_id = t2.org_id
129
+	    LEFT JOIN depot_qh.basic_tank t4 on t4.id=t2.storehouse_id
130
+	     <where>
131
+            <if test="org_id != null">
132
+                t2.org_id = #{org_id}
133
+            </if>
134
+            <if test="library_type != null">
135
+                AND t2.library_type = #{library_type}
136
+            </if>
137
+            <if test="cfCdoe != null">
138
+                AND t2.storehouse_code = #{cfCdoe}
139
+            </if>
140
+        </where>
141
+	    group by t2.storehouse_code
74 142
     </select>
75 143
 
76 144
     <select id="getColumn1Max" parameterType="java.util.Map" resultType="java.util.Map">

+ 63 - 2
src/main/java/com/chinaitop/depot/intelligent/supervise/mapper/TDepotStyleMapper.xml

@@ -465,7 +465,7 @@ GROUP BY
465 465
 
466 466
 
467 467
     <select id="selectByWarning" parameterType="java.util.Map" resultType="java.util.HashMap">
468
-select
468
+<!-- select
469 469
  *
470 470
 from
471 471
  (
@@ -532,6 +532,67 @@ from
532 532
    and st.t_type = 2
533 533
  ) a
534 534
 where
535
- a.rn = 1
535
+ a.rn = 1 -->
536
+ 
537
+ 
538
+ select
539
+   st.styles,
540
+   st.imgdata,
541
+   hw.input_year TestDate,
542
+   house.storehouse_name barnName,
543
+   house.storehouse_code vCf,
544
+   t3.wThreshold wThreshold,
545
+   t3.threshold threshold,
546
+   t3.wRemark wRemark,
547
+   t3.w_time time,
548
+   t3.vCfCode vCfCode,
549
+   house.storehouse_id house_id,
550
+   house.storehouse_name,
551
+   house.storehouse_type,
552
+   hw.sub_type
553
+  from
554
+   basic_storehouse house left join t_depot_style st on
555
+   st.indexid = house.storehouse_id left join storage_foodbasicinfo hw on
556
+   house.storehouse_id = hw.house_id left join(
557
+    select
558
+     th.v_cf_code vCfCode,
559
+     th.w_time,
560
+     th.w_threshold wThreshold,
561
+     th.threshold threshold,
562
+     th.w_remark wRemark
563
+    from
564
+     t_warning_threshold_history th
565
+    where
566
+     th.org_id =#{orgId}
567
+     and(
568
+      th.v_cf_code in(
569
+       select
570
+        v_cf_code
571
+       from
572
+        t_warning_threshold_history
573
+       where
574
+        org_id =#{orgId}
575
+       group by
576
+        v_cf_code
577
+      )
578
+     )
579
+     and th.w_time in(
580
+      select
581
+       max( w_time ) w_time
582
+      from
583
+       t_warning_threshold_history
584
+      where
585
+       org_id =#{orgId}
586
+      group by
587
+       w_time
588
+     )
589
+    order by
590
+     th.w_time desc
591
+   ) t3 on
592
+   house.storehouse_code = t3.vCfCode
593
+  where
594
+   1 = 1
595
+   and st.t_type = 2
596
+   group by house.storehouse_code
536 597
     </select>
537 598
 </mapper>

+ 1 - 1
src/main/java/com/chinaitop/depot/intelligent/ventilation/mapper/BusinessApprovalMapper.xml

@@ -182,7 +182,7 @@
182 182
       title, version, task_type_name, 
183 183
       is_hide, is_countersign, apply_name, 
184 184
       apply_name_id, apply_time)
185
-    values (business_approval_seq.nextVal, #{createTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=INTEGER},
185
+    values (#{id,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=INTEGER},
186 186
       #{remark,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{content,jdbcType=VARCHAR}, 
187 187
       #{fromDepartment,jdbcType=VARCHAR}, #{fromPeople,jdbcType=VARCHAR}, #{fromUserName,jdbcType=VARCHAR}, 
188 188
       #{lastPeople,jdbcType=VARCHAR}, #{operateTime,jdbcType=VARCHAR}, #{operator,jdbcType=VARCHAR},