ソースを参照

Merge branch 'master' of huangrui/CostAccount into dev

lijiaxi 4 年 前
コミット
246ce38442
1 ファイル変更5 行追加2 行削除
  1. 5 2
      src/main/resources/mapper/AllocationMapper.xml

+ 5 - 2
src/main/resources/mapper/AllocationMapper.xml

@@ -31,23 +31,26 @@
         <result property="deleteTime" column="delete_time"/>
     </resultMap>
     <select id="queryAfterAllocationList" resultType="com.imed.costaccount.model.vo.AfterAllocationVO">
-        select * from cost_allocation_query where delete_time = 0 and hosp_id = #{hospId}
+        select *,sum(amount) as amount from cost_allocation_query where delete_time = 0 and hosp_id = #{hospId}
         <if test="dateYear != null">
             and date_year = #{dateYear} and date_month = #{dateMonth}
         </if>
         <if test="responsibilityCode != null and responsibilityCode != ''">
             and responsibility_code = #{responsibilityCode}
         </if>
+        group by accounting_code
         limit #{startIndex},#{pageSize}
     </select>
     <select id="queryAfterAllocationListCount" resultType="java.lang.Integer">
-        select count(*) from cost_allocation_query where delete_time = 0 and hosp_id = #{hospId}
+        select count(*) from
+        (select id from cost_allocation_query where delete_time = 0 and hosp_id = #{hospId}
         <if test="dateYear != null">
             and date_year = #{dateYear} and date_month = #{dateMonth}
         </if>
         <if test="responsibilityCode != null and responsibilityCode != ''">
             and responsibility_code = #{responsibilityCode}
         </if>
+        group by accounting_code)t
     </select>
     <select id="queryAfterAllocationListSum" resultType="java.math.BigDecimal">
         select sum(amount) from cost_allocation_query where delete_time = 0 and hosp_id = #{hospId}