Kaynağa Gözat

添加新粮情分析功能

lvzhikai 4 yıl önce
ebeveyn
işleme
a98ab53ea0

+ 19 - 15
src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentTankMapper.xml

@@ -1,5 +1,5 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
1
+<?xml version="1.0" encoding="UTF-8"?>
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.agent.basic.mapper.BusinessAgentTankMapper">
4 4
   <resultMap id="BaseResultMap" type="com.chinaitop.depot.agent.basic.model.BusinessAgentTank">
5 5
     <id column="id" jdbcType="VARCHAR" property="id" />
@@ -394,7 +394,7 @@ LEFT JOIN basic_tank t ON t.id = e.tank_id
394 394
         treasury_bonds treasuryBonds,
395 395
         enable_date enableDate,
396 396
         state,
397
-        keeper,
397
+        keeper keepNames,
398 398
         '0' third
399 399
     FROM
400 400
         business_agent_tank agTank
@@ -414,11 +414,13 @@ LEFT JOIN basic_tank t ON t.id = e.tank_id
414 414
         '' treasuryBonds,
415 415
         bt.createDate enableDate,
416 416
         bt.tank_status state,
417
-        '' keeper,
418
-        '1' third
417
+        group_concat(bk. NAME) keepNames,
418
+        '1' third,
419 419
     FROM
420 420
         basic_tank bt
421 421
     LEFT JOIN business_agent_tank_exist exis ON exis.tank_id = bt.id
422
+    LEFT JOIN basic_keeper_house bkh ON bkh.house_Id = bt.id
423
+    LEFT JOIN basic_keeper bk ON bk.id = bkh.keeper_Id
422 424
     WHERE
423 425
         exis.org_id = #{orgId,jdbcType=INTEGER}
424 426
     AND exis.del_flag = 1
@@ -426,15 +428,17 @@ LEFT JOIN basic_tank t ON t.id = e.tank_id
426 428
     <if test="tankNumber != null">
427 429
       AND bt.storageTank_code like #{tankNumber,jdbcType=VARCHAR}
428 430
     </if>
429
-  </select>
430
-  
431
-  <select id="getAgentTankId" resultType="java.lang.String" parameterType="java.lang.Integer">
432
-	SELECT
433
-		tank_id
434
-	FROM
435
-		business_agent_tank_exist
436
-	WHERE
437
-		agent_depot_id in (select id from business_agent_depot where depot_id=#{orgId,jdbcType=INTEGER} and del_flag=1 )
438
-    and del_flag=1
431
+    GROUP BY
432
+    bt.id
433
+  </select>
434
+  
435
+  <select id="getAgentTankId" resultType="java.lang.String" parameterType="java.lang.Integer">
436
+	SELECT
437
+		tank_id
438
+	FROM
439
+		business_agent_tank_exist
440
+	WHERE
441
+		agent_depot_id in (select id from business_agent_depot where depot_id=#{orgId,jdbcType=INTEGER} and del_flag=1 )
442
+    and del_flag=1
439 443
   </select>
440 444
 </mapper>