123456789101112131415161718192021222324252627282930313233 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.imed.costaccount.mapper.HospProfitAndLossMapper">
- <select id="getPageList" resultType="com.imed.costaccount.model.HospProfitAndLoss">
- select id as id,
- date_year as dateYear,
- date_month as dateMonth,
- report_num as reportNum,
- report_name as reportName,
- sum(amount) as amount
- from cost_hosp_profit_and_loss
- where date_year = #{year}
- and date_month = #{month}
- and hosp_id = #{hospId}
- and delete_time = 0
- group by report_num
- limit #{startIndex}, #{pageSize}
- </select>
- <select id="getPageCount" resultType="java.lang.Integer">
- select count(*)
- from (
- select *
- from cost_hosp_profit_and_loss
- where date_year = #{year}
- and date_month = #{month}
- and hosp_id = #{hospId}
- and delete_time = 0
- group by report_num) t
- </select>
- </mapper>
|