HospProfitAndLossMapper.xml 1.2 KB

123456789101112131415161718192021222324252627282930313233
  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. and delete_time = 0
  16. group by report_num
  17. limit #{startIndex}, #{pageSize}
  18. </select>
  19. <select id="getPageCount" resultType="java.lang.Integer">
  20. select count(*)
  21. from (
  22. select *
  23. from cost_hosp_profit_and_loss
  24. where date_year = #{year}
  25. and date_month = #{month}
  26. and hosp_id = #{hospId}
  27. and delete_time = 0
  28. group by report_num) t
  29. </select>
  30. </mapper>