HospProfitAndLossMapper.xml 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.imed.costaccount.mapper.HospProfitAndLossMapper">
  4. <select id="getPageList" resultType="com.imed.costaccount.model.HospProfitAndLoss">
  5. select id as id,
  6. date_year as dateYear,
  7. date_month as dateMonth,
  8. report_num as reportNum,
  9. report_name as reportName,
  10. sum(amount) as amount
  11. from cost_hosp_profit_and_loss
  12. where date_year = #{year}
  13. and date_month = #{month}
  14. and hosp_id = #{hospId}
  15. group by report_num
  16. limit #{startIndex}, #{pageSize}
  17. </select>
  18. <select id="getPageCount" resultType="java.lang.Integer">
  19. select count(*)
  20. from (
  21. select *
  22. from cost_hosp_profit_and_loss
  23. where date_year = #{year}
  24. and date_month = #{month}
  25. and hosp_id = #{hospId}
  26. group by report_num) t
  27. </select>
  28. </mapper>