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