DESKTOP-2K9OVK9\siwei 4 月之前
父節點
當前提交
6dd3001c73

+ 6 - 12
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/gdbh/TGdbhGdMapper.xml

@@ -8,11 +8,9 @@
         select t2.*, round(mj*0.0015,2) mj_m, round(mj*0.0001,2) mj_gq, round(mj*0.000001,2) mj_qm from (
         select round((coalesce(sum(mj::numeric), 0)),2) mj ,count(*) gs from (
         select "${areacolumn}" as mj from vector."${sjy}"
+        where bsm like concat(#{xzqhdm},'%')
         <if test="dlbm!=null and dlbm!='' ">
-            where dlbm like concat(#{dlbm},'%')
-        </if>
-        <if test="xzqhdm!=null and xzqhdm!='' ">
-            where bsm like concat(#{xzqhdm},'%')
+            and dlbm like concat(#{dlbm},'%')
         </if>
         )t1)t2
     </select>
@@ -22,11 +20,9 @@
         (
         select round((coalesce(sum(mj::numeric), 0)),2) mj ,count(*) gs ,dlmc from (
         select "${areacolumn}" as mj ,dlmc from vector."${sjy}"
+        where bsm like concat(#{xzqhdm},'%')
         <if test="dlbm!=null and dlbm!='' ">
-            where dlbm like concat(#{dlbm},'%')
-        </if>
-        <if test="xzqhdm!=null and xzqhdm!='' ">
-            where bsm like concat(#{xzqhdm},'%')
+            and dlbm like concat(#{dlbm},'%')
         </if>
         )t1 group by dlmc)t2
     </select>
@@ -36,11 +32,9 @@
         t3.name xqdmc from (
         select round((coalesce(sum(mj::numeric), 0)),2) mj ,count(*) gs ,xzqdm from (
         select "${areacolumn}" as mj ,dlmc,substr(bsm,1,6) xzqdm from vector."${sjy}"
+        where bsm like concat(#{xzqhdm},'%')
         <if test="dlbm!=null and dlbm!='' ">
-            where dlbm like concat(#{dlbm},'%')
-        </if>
-        <if test="xzqhdm!=null and xzqhdm!='' ">
-            where bsm like concat(#{xzqhdm},'%')
+            and dlbm like concat(#{dlbm},'%')
         </if>
         )t1 group by xzqdm)t2 left join vector.xzqh t3 on t3.id = t2.xzqdm
     </select>

+ 6 - 12
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/gdbh/TGdbhYjjbntMapper.xml

@@ -8,11 +8,9 @@
         select t2.*, round(mj*0.0015,2) mj_m, round(mj*0.0001,2) mj_gq, round(mj*0.000001,2) mj_qm from (
         select round((coalesce(sum(mj::numeric), 0)),2) mj ,count(*) gs from (
         select "${areacolumn}" as mj from vector."${sjy}"
+        where xzqdm like concat(#{xzqhdm},'%')
         <if test="dlbm!=null and dlbm!='' ">
-            where dlbm like concat(#{dlbm},'%')
-        </if>
-        <if test="xzqhdm!=null and xzqhdm!='' ">
-            where xzqdm like concat(#{xzqhdm},'%')
+            and dlbm like concat(#{dlbm},'%')
         </if>
         )t1)t2
     </select>
@@ -22,11 +20,9 @@
         (
         select round((coalesce(sum(mj::numeric), 0)),2) mj ,count(*) gs ,dlmc from (
         select "${areacolumn}" as mj ,dlmc from vector."${sjy}"
+        where xzqdm like concat(#{xzqhdm},'%')
         <if test="dlbm!=null and dlbm!='' ">
-            where dlbm like concat(#{dlbm},'%')
-        </if>
-        <if test="xzqhdm!=null and xzqhdm!='' ">
-            where xzqdm like concat(#{xzqhdm},'%')
+            and dlbm like concat(#{dlbm},'%')
         </if>
         )t1 group by dlmc)t2
     </select>
@@ -36,11 +32,9 @@
         t3.name xqdmc from (
         select round((coalesce(sum(mj::numeric), 0)),2) mj ,count(*) gs ,xzqdm from (
         select "${areacolumn}" as mj ,dlmc,substr(xzqdm,1,6) xzqdm from vector."${sjy}"
+        where xzqdm like concat(#{xzqhdm},'%')
         <if test="dlbm!=null and dlbm!='' ">
-            where dlbm like concat(#{dlbm},'%')
-        </if>
-        <if test="xzqhdm!=null and xzqhdm!='' ">
-            where xzqdm like concat(#{xzqhdm},'%')
+            and dlbm like concat(#{dlbm},'%')
         </if>
         )t1 group by xzqdm)t2 left join vector.xzqh t3 on t3.id = t2.xzqdm
     </select>