From b805858ea0341e13f6213c3a9b01da6a13d22f83 Mon Sep 17 00:00:00 2001
From: gdg <764716047@qq.com>
Date: 星期四, 10 十二月 2020 10:39:50 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into master

---
 src/main/java/com/nanometer/smartlab/dao/SysReagentDao.xml              |   66 +++++++++++++++++++++++++-------
 src/main/webapp/WEB-INF/szygs/szygs.properties                          |    4 +-
 src/main/webapp/apply_mng_new.xhtml                                     |    2 
 src/main/webapp/WEB-INF/gcs/gcs.properties                              |    4 +-
 src/main/webapp/WEB-INF/hws/hws.properties                              |    4 +-
 src/main/java/com/nanometer/smartlab/service/SysReagentServiceImpl.java |    1 
 src/main/webapp/WEB-INF/test/test.properties                            |    2 
 7 files changed, 60 insertions(+), 23 deletions(-)

diff --git a/src/main/java/com/nanometer/smartlab/dao/SysReagentDao.xml b/src/main/java/com/nanometer/smartlab/dao/SysReagentDao.xml
index c4b89a2..83619fa 100644
--- a/src/main/java/com/nanometer/smartlab/dao/SysReagentDao.xml
+++ b/src/main/java/com/nanometer/smartlab/dao/SysReagentDao.xml
@@ -96,12 +96,52 @@
   </select>
 
   <select id="reagentList" parameterType="java.util.Map" resultMap="SysReagent">
-    select sr.*, ss.meta_value as product_home_name, bm.meta_value as control_products_name,supplier.name as supplierName,f.id favor,f.create_time favortime
-    from sys_reagent as sr
-    left join base_meta as ss on sr.product_home = ss.id
-    left join base_meta bm	on bm.id = sr.control_products
-    left join sys_supplier supplier on supplier.id = sr.supplier_id
-    LEFT JOIN favor f on f.reagent_id = sr.id AND f.user_id = #{user}
+    SELECT
+    *
+    FROM
+    (
+    SELECT
+    sr.*, ss.meta_value AS product_home_name,
+    bm.meta_value AS control_products_name,
+    supplier. NAME AS supplierName,
+    f.id favor,
+    f.create_time favortime
+    FROM
+    sys_reagent AS sr
+    LEFT JOIN base_meta AS ss ON sr.product_home = ss.id
+    LEFT JOIN base_meta bm ON bm.id = sr.control_products
+    LEFT JOIN sys_supplier supplier ON supplier.id = sr.supplier_id
+    LEFT JOIN favor f ON f.reagent_id = sr.id
+    AND f.user_id= #{user}
+    WHERE f.id IS NOT NULL
+    and sr.valid_flag = 1
+    <if test="cas != null and cas != ''">
+      and sr.cas like concat("%", #{cas} ,"%")
+    </if>
+    <if test="supplierId != null and supplierId != ''">
+      and sr.supplier_id = #{supplierId}
+    </if>
+    <if test="name != null and name != ''">
+      and sr.name like concat("%", #{name} ,"%")
+    </if>
+    <if test="productSn != null and productSn != ''">
+      and sr.product_sn like concat("%", #{productSn} ,"%")
+    </if>
+    UNION ALL
+    SELECT
+    sr.*, ss.meta_value AS product_home_name,
+    bm.meta_value AS control_products_name,
+    supplier.NAME AS supplierName,
+    f.id favor,
+    f.create_time favortime
+    FROM
+    sys_reagent AS sr
+    LEFT JOIN base_meta AS ss ON sr.product_home = ss.id
+    LEFT JOIN base_meta bm ON bm.id = sr.control_products
+    LEFT JOIN sys_supplier supplier ON supplier.id = sr.supplier_id
+    LEFT JOIN favor f ON f.reagent_id = sr.id
+    AND f.user_id = #{user}
+    AND f.id IS NULL
     where sr.valid_flag = 1
     <if test="cas != null and cas != ''">
       and sr.cas like concat("%", #{cas} ,"%")
@@ -115,6 +155,11 @@
     <if test="productSn != null and productSn != ''">
       and sr.product_sn like concat("%", #{productSn} ,"%")
     </if>
+    <if test="MaxSize != null">
+      limit #{MaxSize}
+    </if>
+    ) as reagent
+    ORDER BY reagent.favortime DESC
     <if test="first != null and pageSize != null">
       limit #{first}, #{pageSize}
     </if>
@@ -275,15 +320,6 @@
       and sr.type = #{type}
     </if>
 
-  </select>
-
-  <select id="getReagentUnitByReagentId" parameterType="java.lang.String" resultType="java.lang.String">
-   SELECT bm.meta_value
-  from sys_reagent sr
-  LEFT JOIN base_meta bm on bm.id = sr.reagent_unit
-  where sr.valid_flag  =1
-  and bm.valid_flag = 1
-  and sr.id = #{reagentId}
   </select>
 
 
diff --git a/src/main/java/com/nanometer/smartlab/service/SysReagentServiceImpl.java b/src/main/java/com/nanometer/smartlab/service/SysReagentServiceImpl.java
index cefc942..d615fcc 100644
--- a/src/main/java/com/nanometer/smartlab/service/SysReagentServiceImpl.java
+++ b/src/main/java/com/nanometer/smartlab/service/SysReagentServiceImpl.java
@@ -133,6 +133,7 @@
         params.put("productSn", productSn);
         params.put("first", first);
         params.put("pageSize", pageSize);
+        params.put("MaxSize", first+pageSize);
         return sysReagentDao.reagentList(params);
     }
 
diff --git a/src/main/webapp/WEB-INF/gcs/gcs.properties b/src/main/webapp/WEB-INF/gcs/gcs.properties
index 78f58e9..e608d09 100644
--- a/src/main/webapp/WEB-INF/gcs/gcs.properties
+++ b/src/main/webapp/WEB-INF/gcs/gcs.properties
@@ -1,10 +1,10 @@
 jdbc.url=jdbc:mysql://localhost:3306/smartlabdb?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
 jdbc.username=root
 jdbc.password=Sinanoaq#415
-#\uFFFD\u0439\uFFFD\uFFFD\uFFFD\u0467\u053A\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0339\uFFFD\uFFFD\uFFFD\uFFFD\u043E\uFFFD\uFFFD\uFFFD
+
 institute.id = 11
 institute.name = \u4E2D\u56FD\u79D1\u5B66\u9662\u5317\u4EAC\u8FC7\u7A0B\u5DE5\u7A0B\u7814\u7A76\u6240
 institute.url  = http://gcs.sinanoaq.com
 institute.app.id = wx7ab4d938ce5ce618
 institute.app.secret = c66b740b60220698570767c807361d3a
-alarm.url =
\ No newline at end of file
+alarm.url = http://gcs.sinanoaq.com/daping/sendWarnInfo.json
diff --git a/src/main/webapp/WEB-INF/hws/hws.properties b/src/main/webapp/WEB-INF/hws/hws.properties
index 28e2387..adf63de 100644
--- a/src/main/webapp/WEB-INF/hws/hws.properties
+++ b/src/main/webapp/WEB-INF/hws/hws.properties
@@ -1,10 +1,10 @@
 jdbc.url=jdbc:mysql://localhost:3306/smartlabdb?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
 jdbc.username=root
 jdbc.password=Sinanoaq#415
-#\uFFFD\u0439\uFFFD\uFFFD\uFFFD\u0467\u053A\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0467\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u043E\uFFFD\uFFFD\uFFFDtest.properties
+
 institute.id = 9
 institute.name = \u4E2D\u56FD\u79D1\u5B66\u9662\u5927\u8FDE\u5316\u5B66\u7269\u7406\u7814\u7A76\u6240
 institute.url  = http://hws.sinanoaq.com
 institute.app.id = wx7ab4d938ce5ce618
 institute.app.secret = c66b740b60220698570767c807361d3a
-alarm.url =
\ No newline at end of file
+alarm.url = http://hws.sinanoaq.com/daping/sendWarnInfo.json
diff --git a/src/main/webapp/WEB-INF/szygs/szygs.properties b/src/main/webapp/WEB-INF/szygs/szygs.properties
index 605fe7e..07f9aaa 100644
--- a/src/main/webapp/WEB-INF/szygs/szygs.properties
+++ b/src/main/webapp/WEB-INF/szygs/szygs.properties
@@ -2,9 +2,9 @@
 jdbc.username=root
 jdbc.password=SZYGS@uss20201!
 
-institute.id = 25
+institute.id = 28
 institute.name = \u4E2D\u56FD\u79D1\u5B66\u9662\u82CF\u5DDE\u751F\u7269\u533B\u5B66\u5DE5\u7A0B\u6280\u672F\u7814\u7A76\u6240
 institute.url  = http://58.210.42.60:8001/
 institute.app.id =
 institute.app.secret =
-alarm.url =
+alarm.url = http://58.210.42.60:8001/daping/sendWarnInfo.json
diff --git a/src/main/webapp/WEB-INF/test/test.properties b/src/main/webapp/WEB-INF/test/test.properties
index ae8b1b9..75c14a0 100644
--- a/src/main/webapp/WEB-INF/test/test.properties
+++ b/src/main/webapp/WEB-INF/test/test.properties
@@ -7,4 +7,4 @@
 institute.url  = http://sinanoaq.com
 institute.app.id = wx81a00e3350861b25
 institute.app.secret = c307d394875af2cbbe25e01b9e43dcb2
-alarm.url =
\ No newline at end of file
+alarm.url =
diff --git a/src/main/webapp/apply_mng_new.xhtml b/src/main/webapp/apply_mng_new.xhtml
index 23584d6..3115715 100644
--- a/src/main/webapp/apply_mng_new.xhtml
+++ b/src/main/webapp/apply_mng_new.xhtml
@@ -307,7 +307,7 @@
                                  resizableColumns="true" paginator="true" paginatorAlwaysVisible="false" paginatorPosition="bottom"
                                  lazy="true" value="#{applyMngController.reagentDataModel}" var="row" rowKey="#{row.id}"
                                  emptyMessage="无数据" selectionMode="single"
-                                 rows="50" pageLinks="5">
+                                 rows="15" pageLinks="5">
 
                         <p:ajax event="rowDblselect" listener="#{applyMngController.onReagentRowSelect}" update=":applyMngNewForm,:applyDialog"></p:ajax>
                         <p:column headerText="产品编号">

--
Gitblit v1.9.2