瀏覽代碼

sql更改

gaodd 1 年之前
父節點
當前提交
c63ba80e9b

+ 4 - 4
src/main/java/com/chinaitop/agile/mapper/BgmxzMapper.xml

@@ -83,10 +83,10 @@
83
         c.lqss,
83
         c.lqss,
84
         b.tzdh,
84
         b.tzdh,
85
         d.y_dataid ydataid
85
         d.y_dataid ydataid
86
-        from lsreport_ts:data_kcgl_fcbgz_default a
87
-        left join lsreport_ts:data_kcgl_xckc_default b on b.dataid=a.dataid
88
-        left join depot:business_delivery_storage_notice c on c.bill_number=b.tzdh and c.org_id=b.unitid
89
-        left join depot:storage_keep_voucher d on d.y_dataid=a.DataID
86
+        from data_kcgl_fcbgz_default a
87
+        left join data_kcgl_xckc_default b on b.dataid=a.dataid
88
+        left join depot_qh.business_delivery_storage_notice c on c.bill_number=b.tzdh and c.org_id=b.unitid
89
+        left join depot_qh.storage_keep_voucher d on d.y_dataid=a.DataID
90
         where 1=1 and (a.srsl > 0.0  or a.zcsl > 0.0) AND a.Direction = 1
90
         where 1=1 and (a.srsl > 0.0  or a.zcsl > 0.0) AND a.Direction = 1
91
         <if test="ch != null">
91
         <if test="ch != null">
92
             and a.ch = #{ch}
92
             and a.ch = #{ch}

+ 10 - 1
src/main/java/com/chinaitop/agile/mapper/DataKcglFcbgzDefaultMapper.xml

@@ -687,7 +687,7 @@
687
   </select>
687
   </select>
688
   <!-- 分仓保管账 -->
688
   <!-- 分仓保管账 -->
689
   <select id="countByDay" parameterType="com.chinaitop.agile.model.DataKcglFcbgzDefaultExample" resultMap="BaseResultMap">
689
   <select id="countByDay" parameterType="com.chinaitop.agile.model.DataKcglFcbgzDefaultExample" resultMap="BaseResultMap">
690
-    select
690
+    <!-- select
691
         unitid UnitID, to_char(rq,'yyyy-mm-dd') as rqs, ch, hwh, hwxz, pz,
691
         unitid UnitID, to_char(rq,'yyyy-mm-dd') as rqs, ch, hwh, hwxz, pz,
692
     sum(srsl) as srsl, sum(zcsl) as zcsl
692
     sum(srsl) as srsl, sum(zcsl) as zcsl
693
     from data_kcgl_fcbgz_default
693
     from data_kcgl_fcbgz_default
@@ -695,6 +695,15 @@
695
       	<include refid="Example_Where_Clause" />
695
       	<include refid="Example_Where_Clause" />
696
       </if>
696
       </if>
697
     group by unitid, ch, hwh, hwxz, pz, rqs
697
     group by unitid, ch, hwh, hwxz, pz, rqs
698
+    order by rqs desc -->
699
+    select
700
+        unitid UnitID, DATE_FORMAT(rq,'%Y-%m-%d') as rqs, ch, hwh, hwxz, pz,
701
+    sum(srsl) as srsl, sum(zcsl) as zcsl
702
+    from data_kcgl_fcbgz_default
703
+      <if test="_parameter != null">
704
+      	<include refid="Example_Where_Clause" />
705
+      </if>
706
+    group by unitid, ch, hwh, hwxz, pz, rqs
698
     order by rqs desc
707
     order by rqs desc
699
   </select>
708
   </select>
700
 
709