WaterFeeDao.xml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  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="platform.modules.build.dao.WaterFeeDao">
  4. <select id="findDueWaterFee" resultType="platform.modules.build.entity.WaterFee"
  5. parameterType="platform.modules.build.DTO.ElectricWaterDto">
  6. SELECT * FROM y_water_fee t
  7. WHERE
  8. t.build_id = #{build_id}
  9. and t.del_flag=0 and (t.status=0 or t.status is null)
  10. <if test="company_id!=null">
  11. and t.company_id=#{company_id}
  12. </if>
  13. order by t.create_time limit #{count}
  14. </select>
  15. <select id="getBeforeReadByCompanyId" resultType="platform.modules.build.entity.WaterFee">
  16. SELECT * FROM y_water_fee t WHERE t.company_id = #{company_id}
  17. and t.del_flag=0
  18. order by create_time desc limit 1
  19. </select>
  20. <select id="getLastPeriod" resultType="Integer">
  21. SELECT t.current_period FROM y_water_fee t WHERE t.company_id = #{company_id}
  22. and t.del_flag=0
  23. order by t.current_period desc limit 1
  24. </select>
  25. <select id="getByCompanyIdAndRecordId" resultType="platform.modules.build.entity.WaterFee">
  26. SELECT t.* FROM y_water_fee t WHERE t.company_id = #{company_id}
  27. and t.del_flag=0 and t.record_id=#{record_id}
  28. </select>
  29. </mapper>